﻿function ChangeAddress(prov,type,obj)
{           
    var result="";
    if(type=="City")
    {
        result=index.GetCity(prov).value;  
    }
    else if(type=="District")
    {
        result=index.GetDistricts(prov).value;
    }
    else if(type=="sub_district")
    { 
        result=index.GetSub_district(prov).value;      
    }
    var select_name=document .getElementById (obj);          
    if(result !="")
    {      
        var array=result .split("$#￥");
        var select_num=(array.length+1)/2;
        select_name.options.length = select_num ;
        select_name.selectedIndex = 0 ;
        for( i=1 ; i<select_num ; i++)
        {
            select_name.options[i].value =  array[(i-1)*2]  ;
            select_name.options[i].text = array[(i-1)*2+1];
        }            
     }
     else
     {
        select_name.options.length = 1 ;
        select_name.selectedIndex = 0 ;
     }         
}
function TSearchTabs_li(obj)
{
    for(var i=1;i<3;i++)
    {
        document .getElementById ("TSearchTabs_li_"+i).className="";
    }
    obj.className="current";
}

function SearchSumbit()
{
    var p=escape(document.getElementById("Province").options[document.getElementById("Province").selectedIndex].text);
    var c=escape(document.getElementById("City").options[document.getElementById("City").selectedIndex].text);
    var d=escape(document.getElementById("District").options[document.getElementById("District").selectedIndex].text);
    var gr=escape(document.getElementById("Grade").options[document.getElementById("Grade").selectedIndex].text);
    var co=escape(document.getElementById("Course").options[document.getElementById("Course").selectedIndex].text);
    var s=escape(document.getElementById("Sex").options[document.getElementById("Sex").selectedIndex].text);        
    var str="?p="+p+"&c="+c+"&d="+d+"&gr="+gr+"&co="+co+"&s="+s+"#sg";
    if(document.getElementById ("TSearchTabs_li_2").className =="current")
    {
        window .open ("Betutor/Browse.aspx"+str,"","","");            
    } 
    else
    {
        window .open ("Employtutor/Employtutor.aspx"+str,"","",""); 
    }       
}  
function T_Order(obj)
{
   var result= index.JudgmentLogin().value;  
   if(result =="-1")
   {
        alert ("你是学员，这个功能只向教员开放！");
   }
   else if(result=="1")
   { 
        var url=location.href;
        location.href=url.replace("index.aspx","")+"Betutor/Login.aspx?page=Browse&no="+obj;
        return false ;
   }
   else if(result =="0")
   {        
        var result=index.JudgmentComplete(obj).value;
        var complete=result .split("$#￥")[0];
        var mat=result .split("$#￥")[1];
        if(complete=="1")
        {
             var url=location.href;
             location.href=url.replace("index.aspx","")+"Betutor/Login.aspx?page=Browse&no="+obj;
             return false;
        }        
        else if(complete!="")
        {
            var goal=complete.split("$!")[1];
            complete=complete.split("$!")[0]; 
            complete =complete+"没有输入或者输入不正确，请您更新简历后再应聘！\r\n\r\n立刻去更新简历?";  
            if(confirm (complete))
            {
                location.href ="Betutor/"+goal;            
                return false;
            }
           else
                complete="";
        }
        if(complete=="")
        {
            if(mat=="1")
            {                
                var url=location.href;
                location.href=url.replace("index.aspx","")+"Betutor/Login.aspx?page=Browse&no="+obj;
                return false ;
            }
            else if(mat!="")
            {
                alert (mat);
                return false;
            }
            else
            {
               var div3 =document.getElementById("div_Teacher_Note"); 
               div3.style.display="block";         
//               div3.style.left=event.clientX + document.documentElement.scrollLeft-500+"px";
//               div3.style.top=event.clientY + document.documentElement.scrollTop-50+"px";    
               
var theEvent = window.event || arguments.callee.caller.arguments[0];
div3.style.left=theEvent.clientX-650+"px"; 
div3.style.top=theEvent.clientY + document.documentElement.scrollTop-60+"px";
ShowDivBg("div_Teacher_Note_bg");
               div3.style.position="absolute"; 
               document.getElementById("hfcustid").value=obj;
               document.getElementById("txtTeacherNote").value="在此处输入你所有能用来教学此学员的时间段以及其他您迫切想表达或者想知道的信息。\r\n应聘后您的业务会被随机分配给公司业务员，因应聘人数较多，请耐心等待相关业务员的电话；\r\n请你务必保证你简历完整，真实，正确地填写清楚！";               
               document.getElementById("txtTeacherNote").className="input_slight";
           }
       }
   }   
}
function AAT_Order(obj)
{
    var result= index.JudgmentLogin().value;
   if(result =="-1")
   {
        alert ("你是学员，这个功能只向教员开放！");
   }
   else if(result=="1")
   { 
         var url=location.href;
         location.href=url.replace("index.aspx","")+"Betutor/Login.aspx?page=Browse&no="+obj;;
   }
   else if(result =="0")
   {        
        var result=index.JudgmentComplete(obj).value;
        var complete=result .split("$#￥")[0];
        var mat=result .split("$#￥")[1];
        if(complete=="1")
        {
             var url=location.href;
             location.href=url.replace("index.aspx","")+"Betutor/Login.aspx?page=Browse&no="+obj;
             return false;
        }        
        else if(complete!="")
        {
            var goal=complete.split("$!")[1];
            complete=complete.split("$!")[0]; 
            complete =complete+"没有输入或者输入不正确，请您更新简历后再应聘！\r\n\r\n立刻去更新简历?";  
            if(confirm (complete))
            {
                location.href ="Betutor/"+goal;           
                return false;       
            }
            else
                complete="";
        }
        if(complete=="")
        {
            if(mat=="1")
            {                
                var url=location.href;
                location.href=url.replace("index.aspx","")+"Betutor/Login.aspx?page=Browse&no="+obj;
                return false ;
            }
            else if(mat!="")
            {
                alert (mat);
                return false;
            }
            else
            {
               var div3 =  document.getElementById("div_Teacher_Note"); 
               div3.style.display="block"; 
               div3.style.left=event.clientX + document.documentElement.scrollLeft-500+"px";
               div3.style.top=event.clientY + document.documentElement.scrollTop-200+"px";
               ShowDivBg("div_Teacher_Note_bg");    
               div3.style.position="absolute"; 
               document.getElementById("hfcustid").value=obj;
               document.getElementById("txtTeacherNote").value="在此处输入你所有能用来教学此学员的时间段以及其他您迫切想表达或者想知道的信息。\r\n应聘后您的业务会被随机分配给公司业务员，因应聘人数较多，请耐心等待相关业务员的电话；\r\n请你务必保证你简历完整，真实，正确地填写清楚！";           
               document.getElementById("txtTeacherNote").className="input_slight";              
            }
        }
   }
}
function Order_Stu_Close(obj)
{
    var inputNote=document.getElementById("txtTeacherNote");
    if(inputNote.value=="在此处输入你所有能用来教学此学员的时间段以及其他您迫切想表达或者想知道的信息。\r\n应聘后您的业务会被随机分配给公司业务员，因应聘人数较多，请耐心等待相关业务员的电话；\r\n请你务必保证你简历完整，真实，正确地填写清楚！")
    {
        inputNote.className="";
        inputNote.value="";
     }  
    document .getElementById (obj).style.display="none";
    CloseDivBg(obj+"_bg");
}
function SetCondition()
{
    var arr=document.getElementsByTagName ("input");
    for(var i=0;i<arr.length;i++)
    {
        if(arr [i].type=="checkbox")
        {
            arr[i].checked=false;
        }
    }
    var arrs=document.getElementsByTagName ("select");
    for(var i=0;i<arrs.length;i++)
    {
       arrs[i].selectedIndex=0;     
    }
}
function CTeacherNote(obj)
{
    var note=obj.value;
    if(note =="在此处输入你所有能用来教学此学员的时间段以及其他您迫切想表达或者想知道的信息。\r\n应聘后您的业务会被随机分配给公司业务员，因应聘人数较多，请耐心等待相关业务员的电话；\r\n请你务必保证你简历完整，真实，正确地填写清楚！")
    {
        obj.value="";
        obj.className="";
    }
}
function  ShowLearnerDiv(obj,val)
{     
    var divobj=document .getElementById ("divtr"+val);
    var divarr=document .getElementsByTagName ("div");
    for(var i=0;i<divarr .length ;i++)
    {
        if(divarr [i].flage=="divtr"&&divarr [i].id!=("divtr"+val)&&divarr [i].style.display!="none")
        {
            divarr [i].style.display="none"
            document .getElementById ("a"+divarr [i].id).innerText="查看";
        }
    }
    if(divobj.style.display=="none")
    { 
        obj.innerText="收起";        
        $(divobj).slideDown();   
    }
    else   
    {  
        obj .innerText="查看";    
        CloseLearnerDiv(val);        
    } 
}
function CloseLearnerDiv(obj)
{
    $(document .getElementById ("divtr"+obj)).slideUp();
}   
function Div_Close(obj)
{
    document .getElementById (obj).style.display="none";
} 
function ShowMap(nid)
{
    var div3 =  document.getElementById("divAddMap"); 
    div3.style.display="block"; 
    div3.style.left=event.clientX + document.documentElement.scrollLeft-1000+"px";
    div3.style.top=event.clientY + document.documentElement.scrollTop-400+"px";
//var theEvent = window.event || arguments.callee.caller.arguments[0];
//div3.style.left=theEvent.clientX-1000+"px"; 
//div3.style.top=theEvent.clientY + document.documentElement.scrollTop-200+"px";

    div3.style.position="absolute"; 
    var url = "http://searchbox.mapbar.com/publish/template/template1010/index.jsp?CID=jieniu&tid=tid1010&nid="+nid+"&width=600&height=450&control=2&infopoi=1&infoname=1&zoom=12&showSearchDiv=1";
    document.getElementById("map").src = url;  
}
function ShowMap2(nid)
{
    var div3 =  document.getElementById("divAddMap"); 
    div3.style.display="block"; 
    div3.style.left=event.clientX + document.documentElement.scrollLeft-1000+"px";
    div3.style.top=event.clientY + document.documentElement.scrollTop-400+"px";
    div3.style.position="absolute"; 
    var url = "http://searchbox.mapbar.com/publish/template/template1010/index.jsp?CID=jieniu&tid=tid1010&nid="+nid+"&width=600&height=450&control=2&infopoi=1&infoname=1&zoom=12&showSearchDiv=1";
    document.getElementById("map").src = url;  
}
function OpenSendTishi()
{     
alert ("恭喜您，应聘成功，我们将尽快联系您，请您关注手机来电、继续应聘！");  
}


function LoadSearchC()
{ 
    set_select_optionsT(window.document.form1.Province,Province_Arr,"");
    set_select_options(window.document.form1.Grade,GradeArr,"");
    set_select_options(window.document.form1.Course,CourseArray,"");
    
    try{
        var Province = document.getElementById("Province");
        for (var i = 0; i < Province.options.length; i++)
        {
             if (Province.options[i].text.indexOf (remote_ip_info.province,0)>-1)
             {
                Province.options[i].selected = true;
                Province.onchange();
                break;
             }
        }
        var city = document.getElementById("City");
        for (var i = 0; i < city.options.length; i++)
        {
             if (city.options[i].text.indexOf (remote_ip_info.city,0)>-1)
             {
                city.options[i].selected = true;
                city.onchange();
                break;
             }
        }
    }
    catch(err)
    {
    }
    window.document.form1.District.options.length=window.document.form1.District.options.length+1;
    window.document.form1.District.options[window.document.form1.District.options.length-1].value = "" ;		            
    window.document.form1.District.options[window.document.form1.District.options.length-1].text = "不限" ;
    
    window.document.form1.Grade.options.length=window.document.form1.Grade.options.length+1;
    window.document.form1.Grade.options[window.document.form1.Grade.options.length-1].value = "" ;		            
    window.document.form1.Grade.options[window.document.form1.Grade.options.length-1].text = "不限" ;
    
    window.document.form1.Course.options.length=window.document.form1.Course.options.length+1;
    window.document.form1.Course.options[window.document.form1.Course.options.length-1].value = "" ;		            
    window.document.form1.Course.options[window.document.form1.Course.options.length-1].text = "不限" ;
    
    window.document.form1.Sex.options.length=window.document.form1.Sex.options.length+1;
    window.document.form1.Sex.options[window.document.form1.Sex.options.length-1].value = "" ;		            
    window.document.form1.Sex.options[window.document.form1.Sex.options.length-1].text = "不限" ;
    
                 
    document.getElementById("hfProvince").value=document.getElementById("Province").options[document.getElementById("Province").selectedIndex].text;
    document.getElementById("hfCity").value=document.getElementById("City").options[document.getElementById("City").selectedIndex].text;
   
    document .getElementById ("btnSearch").click();
}

function ShowDivBg(div_id)
{
    div3=document.getElementById (div_id);
    div3.style.position = "absolute";
    _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
    _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
    div3.style.width = _scrollWidth + "px";
    div3.style.height = _scrollHeight + "px";
    div3.style.top = "0px";
    div3.style.left = "0px";
    div3.style.background = "#33393C";
    div3.style.filter = "alpha(opacity=40)";
    div3.style.opacity = "0.30";
    div3.style.display = "block";
}
function CloseDivBg(div_id)
{
    try
    {
        document.getElementById (div_id ).style.display="none";
    }
    catch(er)
    {
    }
}
