
function GotoDefaultOut()
{
   var objimg=document.getElementById("imggotodefault");
   if(objimg!=null)
   {
       objimg.src="/defaultimg/godefault.gif";
   }
}

function nulldata(obj)
{
	if(obj.value == "请输入关键字")
	{
			obj.value = "";
	}
}

function setdata(obj)
{
	if(obj.value == "")
	{
		obj.value = "请输入关键字";
	}
}

function ChangeSearchMenu(obj)
{
    if(obj.id=="btnSearchSite")
    {
        document.all.divBottom0.style.display = "none";
		document.all.divBottom1.style.display = "inline";

      // document.all.SearchBarBehind.innerHTML=document.all.tempSearchBehind2.value;
       document.all.txtSearchKey.size=20;
       document.all.drpIndustry.style.display="inline";
       document.all.drpProvince.style.display="inline";
       document.all.drpCity.style.display="inline";
       //document.all.maincontent.style.display="inline";
       
       document.all.btnSearchWeb.src="/DefaultImg/intSearch.gif";
       document.all.btnSearchSite.src="/DefaultImg/slocal2.png";
       document.all.topsearch1.style.backgroundImage="url('/DefaultImg/SearchTop1.gif')";
       
       
    }
    else
    {
            document.all.divBottom0.style.display = "inline";
      document.all.divBottom1.style.display = "none";
        // document.all.SearchBarBehind.innerHTML=document.all.tempSearchBehind1.value;
         document.all.txtSearchKey.size=45;
         document.all.drpIndustry.style.display="none";
         document.all.drpProvince.style.display="none";
         document.all.drpCity.style.display="none";
   //      document.all.maincontent.style.display="none";
         var tempfocuspic=document.all.hseachertypeselect.value;
         
         document.all.btnSearchWeb.src="DefaultImg/sInt.png";
         document.all.btnSearchSite.src="DefaultImg/TopSearchB2.gif";
         document.all.topsearch1.style.backgroundImage="url('/DefaultImg/SearchTop2.gif')";
       
    }
}
function ChangeInPic(obj)
{
       obj.src="/DefaultImg/TopSearchBg"+obj.alt+".gif"; 
}
function ChangeOutPic(obj)
{
      obj.src="/DefaultImg/TopSearchBg0"+obj.alt+".gif"; 
     
      if(document.all.hseachertypeselect.value!="");  
      {
        var tempvalue=document.all.hseachertypeselect.value;
        if(tempvalue!="")
        {
			var objfocus=document.getElementById(tempvalue);
			if(objfocus!=null)
			{
				if(objfocus.id=="Image1")
				{
					objfocus.src="/DefaultImg/TopSearchBg6.gif";
				}
				else if(objfocus.id=="Image2")
				{
					objfocus.src="/DefaultImg/TopSearchBg7.gif";
				}
				else if(objfocus.id=="Image3")
				{
					objfocus.src="/DefaultImg/TopSearchBg8.gif";
				}
				else if(objfocus.id=="Image4")
				{
					objfocus.src="/DefaultImg/TopSearchBg9.gif";
				}
		   }
		}
     }
 
     
}

function cityResult()
{ 
	var city=document.getElementById("drpProvince");
	var cityid=city.value;
	AjaxMethod.GetCityList(city.value,get_city_Result_CallBack);
	/*
	if(cityid=="110000" || cityid=="120000" || cityid=="310000" || cityid=="500000" )
	{
	    AjaxMethod.GetDirectlyAreaList(cityid.substring(0,2),get_city_Result_CallBack);
	}
	else
	{
	   AjaxMethod.GetCityList(city.value,get_city_Result_CallBack);
	}
	*/
}
function get_city_Result_CallBack(response)
{
	if (response.value != null)
	{
		//debugger;
		document.all("drpCity").length=0;
　　　　var ds = response.value;
		if(ds != null && typeof(ds) == "object" && ds.Tables != null)
		{					
			for(var i=0; i<ds.Tables[0].Rows.length; i++)
　　　　	{
　　　　		var name=ds.Tables[0].Rows[i].city;
　　　　　　	var id=ds.Tables[0].Rows[i].cityID;
　　　　　　	document.all("drpCity").options.add(new Option(name,id));
　　　　	}
　　　　	if(document.all("drpCity").length>1)
　　　　	{
　　　　	  document.all("drpCity").options.add(new Option("=所有地区=",""));
　　　　	}
		}
	}				
	return
}



function SetTypeFocus(objpicid)
{

//obj.src="/DefaultImg/TopSearchBg"+obj.alt+".gif";
//objpicid= 1,2,3,4
   document.all.hseachertypeselect.value="Image"+objpicid;
    
    for(var i =1;i<=4;i++){
    if(i!=objpicid){
		var s = document.getElementById("Image"+i).src;
		var s1 = s.replace("TopSearchBg","TopSearchBg0").replace("TopSearchBg00","TopSearchBg0");
		document.getElementById("Image"+i).src = s1;
		}
    }
    
    if(document.getElementById("txtSearchKey").value!='' && document.getElementById("txtSearchKey").value != "请输入关键字")
	{
		changeSeachWeb(document.getElementById("txtSearchKey").value);
	}
   
}
function changeSeach(strSeach,strType,strArea1,strArea2)
{
	if(document.getElementById("txtSearchKey").value=='' || document.getElementById("txtSearchKey").value == "请输入关键字")
	{
		alert("请输入关键字!");
		return;
	}
	if(strArea1 == 0)
	{
		strArea1 = '';
	}
	if(strArea2 == 0)
	{
		strArea2 = '';
	}
	if(strType == 0)
	{
		strType = '';
	}
	//window.open('/Company/ShowList.aspx?C_Company='+ strSeach + '&C_CType=' +strType + '&C_Area2=' +strArea2);
	window.open('/Search/SearchResult.aspx?C_Company='+ strSeach + '&C_CType=' +strType + '&C_Area1=' +strArea1 + '&C_Area2=' +strArea2);
}
function changeSeachWeb(strSearch){
	if(document.getElementById("txtSearchKey").value=='' || document.getElementById("txtSearchKey").value == "请输入关键字")
	{
		alert("请输入关键字!");
		return;
	}
	var tempvalue=document.all.hseachertypeselect.value;
	if(tempvalue==null||tempvalue==""){
		tempvalue="Image1";
		document.all.hseachertypeselect.value="Image1";
	}
	var vs = "html";
	if(tempvalue=="Image1"){
	vs="html";
	}
	if(tempvalue=="Image2"){
	vs="image";
	}
	if(tempvalue=="Image3"){
	vs="mp3";
	}
	if(tempvalue=="Image4"){
	vs="video";
	}
	
	window.open('/SearchInt/searchresult.aspx?search='+strSearch+'&vs='+vs);
}

function document.onkeydown()
{
	if (event.keyCode == 13)
	{
		if(document.all.txtSearchKey.value != ""&& document.all.txtSearchKey.value != "请输入关键字")
		{
			var div0 = document.all.divBottom0.style.display;
			var btn = document.getElementById("btnSearchWeb");
			if(div0=="none")
			{
				btn = document.getElementById("btnSearchSite");
			}
			if (btn != event.srcElement)
			{
				btn.click();
				return false;
			}
		}else {
			return false;
		}
	}
}
