﻿var GradeArray ="幼儿,小一,小二,小三,小四,小五,小六,初一,初二,初三,高一,高二,高三,大一,大二,大三,大四,成人,其他".split (",");
var CourseArray = "语文,数学,英语,科学,物理,化学,生物,政治,历史,地理,心理,电脑,奥数,美术,钢琴,音乐,其他".split (",");
var LanguageArray = "汉语,英语,粤语,日语,法语,德语,俄语,方言,其他".split (",");
var CishiArray = "2,2.5,3,3.5,4,4.5,5,其他".split (",");
var CixinArray = "20,25,30,35,40,45,50,55,60,65,70,75,80,90,100,110,120,130,140,150,160,170,180,190,200,210,220,230,240,250,260,270,280,290,300,300,其他".split (",");
var stuWeekTimes="1,2,3,4,5,6,7,8,9,10,11,12".split (",");
var GradeArr = "小学,初中,高中,大学,其他".split (",");

function set_select_options(select_name, array , selected_option)
{
    var select_num ;
	var i ;
	select_num=array.length+1;
	
	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)] ;
		select_name.options[i].text = array[(i-1)] ;
		
		if( array[(i-1)] == selected_option )
			select_name.selectedIndex = i ;	
	}
}
    
String.prototype.Trim = function() 
{ 
    return this.replace(/(^\s*)|(\s*$)/g, ""); 
}  
function isNull(obj)
{
    if(obj.value.replace(/(^\s*)|(\s*$)/g, '').length<=0)
    {
        return true;
    }
    else{
        return false;
    }
}
    
function openWinOnlyOne(url,name)
{
    var win;
    win=window.open(url,name,"");
    win.focus(); 
}

function EmploytutorParentMenu(spa,n)
{
    if(location.href!=parent .location.href)
    {
        try
        {
            var arr=parent.document.getElementsByTagName ("a"); 
            for(var i=0;i<arr.length ;i++)
            {
                if(arr[i].id.indexOf ("a_",0)>-1)
                    parent.document.getElementById (arr[i].id).style.color="#0033ff"; 
            }
            parent.document.getElementById ("a_"+spa).style.color="#f00";
            if(parent.document.getElementById ("left"+n).style.display=="none")
            {
                parent.document.getElementById ("menu"+n+"_set").click();
            }
            if(document.title.length >8)
                parent.document.title=document.title;
        }
        catch(err)
        {
        }
    }
    else
    {            
        location .href="Employtutor.aspx#"+spa;
    }
}
var Province_Arr=new Array (
"1","安徽省",
"2","澳门特区",
"3","北京市",
"4","福建省",
"5","甘肃省",
"6","广东省",
"7","广西自治区",
"8","贵州省",
"9","海南省",
"10","河北省",
"11","河南省",
"12","黑龙江省",
"13","湖北省",
"14","湖南省",
"15","吉林省",
"16","江苏省",
"17","江西省",
"18","辽宁省",
"19","内蒙古自治区",
"20","宁夏自治区",
"21","青海省",
"22","山东省",
"23","山西省",
"24","陕西省",
"25","上海市",
"26","四川省",
"27","台湾地区",
"28","天津市",
"29","西藏自治区",
"30","香港特区",
"31","新疆自治区",
"32","云南省",
"33","浙江省",
"34","重庆市"
 );
function set_select_optionsT(select_name, array , selected_option )
{
    var select_num ;
	var i ;
	
	select_num = array.length/2 +1 ;
	
	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] ;
		
		if( array[(i-1)*2] == selected_option )
			select_name.selectedIndex = i ;	
	}
}

 function set_select_optionsEduT(select_name, array , selected_option )
{
    var select_num ;
	var i ;
	var myDate =new Date ();
	select_num = 50+6 ;
	
	select_name.options.length = select_num ;
	select_name.selectedIndex = 0 ;
	for(var j=1,i=(myDate.getFullYear()-50) ; j<55 ; j++,i++ )
	{
		select_name.options[j].value = i ;
		select_name.options[j].text = i ;
		
		if( i== selected_option )
			select_name.selectedIndex = j ;	
	}
}
function SetCookie(name,value)
{
    var Days = 30;
    var exp  = new Date();
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
function getCookie(name)
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;
}
function delCookie(name)
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}

function __firefox(){
    HTMLElement.prototype.__defineGetter__("runtimeStyle", __element_style);
    window.constructor.prototype.__defineGetter__("event", __window_event);
    Event.prototype.__defineGetter__("srcElement", __event_srcElement);
}
function __element_style(){
    return this.style;
}
function __window_event(){
    return __window_event_constructor();
}
function __event_srcElement(){
    return this.target;
}
function __window_event_constructor(){
    if(document.all){
        return window.event;
    }
    var _caller = __window_event_constructor.caller;
    while(_caller!=null){
        var _argument = _caller.arguments[0];
        if(_argument){
            var _temp = _argument.constructor;
            if(_temp.toString().indexOf("Event")!=-1){
                return _argument;
            }
        }
        _caller = _caller.caller;
    }
    return null;
}
if(window.addEventListener){
    __firefox();
}
