﻿// JScript 文件
function cg(id)
{
 document.getElementById("px"+id).className = 'px_d0';
}
function hid(id)
{
document.getElementById(id).className = 'hid';
}
function bs()
{
  var ali = document.getElementById("yx").getElementsByTagName("ul");
  for(var i = 0 ; i < ali.length ;i++)
  {
    ali[i].onmouseover = function(){this.style.backgroundColor ="#EAF4FD";} 
   ali[i].onmouseout = function(){this.style.backgroundColor ="#ffffff";} 
  }
}

function sswz()
 {
  var inp = document.getElementById("yh").getElementsByTagName("input");
 
 	if(Jtrim(inp[0].value) == "" || Jtrim(inp[0].value) == "请输入公司名称或职位名称") {
		window.alert("请输入关键字!");
		inp[0].focus();
		return false;
	}else{
	  var ke = Jtrim(inp[0].value);
	  var kk = ke.replace("'","");
	  window.location.href = "../search/keyword_search.aspx?keyword="+encodeURIComponent(inp[0].value);
		return false;
	}
 
 }
 function chky(obj,txt,l)
   {
   if(l == '1')
   {
    obj.style.color = '#000000';
     if(obj.value == txt){
     
		obj.value = '';
		
		}
	}
	else if(l == '2')
   {
    if(obj.value==""){
		obj.value = txt;
		obj.style.color = '#999999';
	}
	else obj.style.color = '#000000';
   
   }	 
   }
   function Jtrim(str)
{
	var i = 0;
	var len = str.length;
	
	if(str == "")
	{
		return(str);
	}
	
	j = len -1;
	flagbegin = true;
	flagend = true;
	
	while((flagbegin == true) && (i< len))
	{
		if(str.charAt(i) == " ")
		{
			i = i + 1;
			flagbegin = true;
		}
		else
		{
			flagbegin = false;
		}
	}
	
	while((flagend == true) && (j >= 0))
	{
		if(str.charAt(j) == " ")
		{
			j = j - 1;
			flagend = true;
		}
		else
		{
			flagend = false;
		}
	}
	
	if(i > j)
	{
		return ("");
	}
	
	trimstr = str.substring(i,j+1);
	return trimstr;
}
