﻿	var CurrentDiv; //当前控件
	//显示层
    function Subject_Show(obj,Cagetory,OptionDiv,eventhandler)
    {
        CurrentDiv=OptionDiv;
      //Cagetory的值:1-课后 0-课外
       GetObject(OptionDiv).style.left=document.body.scrollLeft+eventhandler.clientX+5+"px";
       GetObject(OptionDiv).style.top=document.body.scrollTop+eventhandler.clientY+6+"px";
       GetObject(OptionDiv).style.display=""; //显示科目层
       GetObject(OptionDiv).style.zIndex=600;
       var GradeName,GradeValue; //年级名称，年级值
       GradeValue=obj.title; //年级值
       GradeName=School.Components.BusApp.Teacher.Ajax.GetGrade_Text(Number(GradeValue)).value; //年级名称
        switch(Cagetory)
        {
            case 1: //课后
                GetObject("Lbl_Content").innerHTML=School.Components.BusApp.Teacher.Exercise.ShowPreviousSubject(GradeName,GradeValue,5,1).value;
                break;
            case 0: //课外
                GetObject("Lbl_Content").innerHTML=School.Components.BusApp.Teacher.Exercise.ShowPreviousSubject(GradeName,GradeValue,5,0).value;
                break;
             case 3://查找学校编号
                GetObject(OptionDiv).style.display="";
                GetObject(OptionDiv).style.top=document.body.scrollTop+370+"px"; 
                GetObject(OptionDiv).style.left=document.body.scrollLeft+45+"px";
                break;
            
        }
        
        if(eventhandler.clientX+GetObject(OptionDiv).offsetWidth>screen.width-30)
        {
        GetObject(OptionDiv).style.left=eventhandler.clientX-document.body.scrollLeft-GetObject(OptionDiv).offsetWidth;
        }
        
    }
    //查看分册
    function ViewPreviousBookCategory(Subject_Name,GradeName,GradeValue,Action)
    {
        Span_PreviousChapter.innerHTML="";
        Span_PreviousBookCategory.innerHTML=School.Components.BusApp.Teacher.Exercise.ShowPreviousBookCategory(Subject_Name,GradeName,GradeValue,Action).value;
    }
    //显示章节
    function GetPreviousChapter(BookCategory,Subject_Name,GradeValue,GradeName)
    {
        Span_PreviousChapter.innerHTML=School.Components.BusApp.Teacher.Exercise.ShowPreviousChapter(BookCategory,Subject_Name,GradeValue,GradeName).value;
    }
      //显示课后练习的内容
      function InExerciseShow(Id,ChapterId,Parent_Id)
	     {
	   location.href="/jxt/InExerciseShow.aspx?Id="+Id;
	     } 
	    //显示课外练习的内容
	     function OutExerciseShow(Id)
	     {
	   location.href="/jxt/OutExerciseShow.aspx?Id="+Id;
	     } 
   function ShowHorizonGrade(StatusValue)
      {
        if(StatusValue==1) //显示课后年级
        {
            GetObject("Div_InGrade").innerHTML=School.Components.BusApp.Teacher.Ajax.GetFirstPrevious(StatusValue).value;
        }
        else
            if(StatusValue==0) //显示课外年级
            {
                GetObject("Div_OutGrade").innerHTML=School.Components.BusApp.Teacher.Ajax.GetFirstPrevious(StatusValue).value;
            }
            else //课件年级
            {
                 GetObject("TeachPlanGrade").innerHTML=School.Components.BusApp.Teacher.Ajax.GetFirstPrevious(StatusValue).value;
            }
        
      }
    
	 //获取控件
    function GetObject(Id)
        { 
         return document.getElementById(Id);
        }
        
  
    
