﻿/**打开一个不可见的窗口*/
function openHideWin(sPath)
{
    window.open(sPath,'welcome','width=10px,height=10px,top=2000px,left=2000px');
}
/**下拉菜单选择*/
function selectOnchange(mainitem,subitem,catalog)
{
    setSubSelectItem(catalog,mainitem,subitem);}


/*表单重复提示框*/
function showWaitDiv(){	
	var obj = document.getElementById("ts");
	if(typeof(obj)=="object"){
		obj.style.display="block";
		obj.style.left=((document.body.offsetWidth-parseFloat (obj.style.width))/2)+document.body.scrollLeft;
		obj.style.top=((document.body.offsetHeight-parseFloat (obj.style.height))/2)+document.body.scrollTop;
	}
}


///**回车事件处理*/
//function keyword_onkeydown()
//{
//	if(window.event.keyCode==13)  document.TheForm.GotoButton.onclick();
//}
//
///**回车事件处理*/
//function Password_onkeydown()
//{
//	if (window.event.keyCode==13) CheckForm();
//}
//function isStr(s) {
//	if (s.length == 0) return false;
//	var regu = "^[0-9A-Za-z_]*$";
//	var re   = new RegExp(regu);
//	s = s.replace('@', '');
//	s = s.replace('.', '');
//	if (s.search(re) != -1)
//	{
//		return true;
//	}
//	else
//	{
//		if (isEmail(s))
//			return true;
//		else
//			return false;
//	}
//}
function setSubSelectItem(catalog,mainitem,subitem)
{
	
	var itemCount;
	var items = new Array();
	var filterStr='北京天津上海重庆';
	var subvalue=mainitem.options[mainitem.selectedIndex].value;
	if(catalog=='jobcatelog')
	{
		subitem.length = 0;
		itemCount = catelogCount;
		items = catelogs;
		var opt=document.createElement("OPTION");
		if((subvalue == ''))
		{
			with(opt)
			{
				text="不限";
				value="";
				style.color="navy";
			}
			try{
			  subitem.add(opt);
		  } catch(e) {
		    subitem.add(opt, null);
		  }
		}
		var flag = false;
		for (i=0;i<itemCount; i++)
		{
			if ((items[i][2]).substring(0,2) == subvalue.substring(0,2))
			{
				flag = true;
				var opt=document.createElement("OPTION");
				opt.text=items[i][0];
				opt.value=items[i][2];
  				try{
	  				  subitem.add(opt);
		  		  } catch(e) {
	  				  subitem.add(opt, null);
  				  }
			}
			else{
				if (flag)
					{
						break;
					}	
			}

		}
	}
	else if(catalog=='citys1')
	{
		subitem.length = 0;
		itemCount = cityCount;
		items = citys;
		var opt=document.createElement("OPTION");
		if((subvalue == ''))
		{
			with(opt)
			{
				text="不限";
				value="";
			}
			try{
			  subitem.add(opt);
		  } catch(e) {
		    subitem.add(opt, null);
		  }
		}
		for (i=0;i < itemCount; i++)
		{
			if (items[i][1] == subvalue)
			{
				var opt=document.createElement("OPTION");
				opt.text=items[i][0];
				opt.value=items[i][5];				
  			try{
  			  subitem.add(opt);
  		  } catch(e) {
  		    subitem.add(opt, null);
  		  }
			}
		}
	}
}

function selectSheng(FSheng){
	Sheng=$("Sheng");
		for (i=0;i<Sheng.options.length;i++){
			if (Sheng.options[i].value==FSheng){
				Sheng.options[i].selected=true;
			}
			
		}		
	
}
	
function selectCity(Fcity){
	
	selectOnchange($("Sheng"),$("City"),'citys1')
	City=$("City");
		for (i=0;i<City.options.length;i++){
			if (City.options[i].value==Fcity){
				City.options[i].selected=true;
			}
			
		}		
}


function selectSC(SC,FSheng){
	
		for (i=0;i<SC.options.length;i++){
			if (SC.options[i].value==FSheng){
				SC.options[i].selected=true;
			}
			
		}		
	
}


function selectGw(GwDaLei,str){
	GwDaleiValue=str;
	Gw=GwDaLei;
		for (i=0;i<Gw.options.length;i++){
			if (Gw.options[i].value==GwDaleiValue){
				Gw.options[i].selected=true;
			}
			
		}		
	
}