﻿function INDEX1_k_focus(){
var k=document.getElementById("k");
k.className="theinp1";
if(k.value=="请输入关键字"){k.value="";}
}
function INDEX1_k_blur(){
var k=document.getElementById("k");
if(k.value==""){k.className="theinp2";k.value="请输入关键字";}
}


function INDEX1_toQzoneLogin_(){var A=window.open("/user/logintoqq.aspx","TencentLogin","width=450,height=320,menubar=0,scrollbars=1,resizable=1,status=1,titlebar=0,toolbar=0,location=1");}


function INDEX1_selsearch(obj,value){
var parent=obj.parentNode;
var arr1=parent.getElementsByTagName("span"); 
for(var i=0;i<arr1.length;i++)
{arr1[i].className="";}
obj.className="on";
document.getElementById("search_type_value").value=value;
}


function INDEX1_selsearch_init(){
var url=location.href.toLowerCase();
var arr1=document.getElementById("index1_head_search").getElementsByTagName("span"); 
if(url.indexOf("/life/")!=-1)INDEX1_selsearch(arr1[0],"life");
else if(url.indexOf("/job/")!=-1)INDEX1_selsearch(arr1[1],"job");
else if(url.indexOf("/house/rent_list.aspx")!=-1||url.indexOf("/houserent/")!=-1)INDEX1_selsearch(arr1[2],"rent");
else if(url.indexOf("/house/sell_list.aspx")!=-1||url.indexOf("/housesell/")!=-1)INDEX1_selsearch(arr1[3],"sell");
else if(url.indexOf("/news/")!=-1)INDEX1_selsearch(arr1[4],"news");
else if(url.indexOf("/bbs/")!=-1)INDEX1_selsearch(arr1[5],"bbs");
else if(url.indexOf("/company/")!=-1)INDEX1_selsearch(arr1[6],"company");
}


function INDEX1_dosearch(channeltype,k)
{
var url="";if(k=="请输入关键字")k="";if(k=="")return false;
if(channeltype=="life")
{
if(location.href.indexOf("/life/list.aspx?")!=-1){if(location.href.indexOf("k=")!=-1){var arr1 = location.search.substr(1).split("&");var p1="";p2="";for(i=0;i<arr1.length;i++){if([arr1[i].split("=")[0]].toString()=="k"){p1=arr1[i].split("=")[0];p2=arr1[i].split("=")[1];}}url=location.href.replace("k="+p2,"k="+escape(k));}else url=location.href+"&k="+escape(k);}
else url="/life/list.aspx?classid=0&k="+escape(k);
}
else if(channeltype=="rent")
{
if(location.href.indexOf("/house/rent_list.aspx?")!=-1){if(location.href.indexOf("k=")!=-1){var arr1 = location.search.substr(1).split("&");var p1="";p2="";for(i=0;i<arr1.length;i++){if([arr1[i].split("=")[0]].toString()=="k"){p1=arr1[i].split("=")[0];p2=arr1[i].split("=")[1];}}url=location.href.replace("k="+p2,"k="+escape(k));}else url=location.href+"&k="+escape(k);}
else url="/house/rent_list.aspx?k="+escape(k);
}
else if(channeltype=="sell")
{
if(location.href.indexOf("/house/sell_list.aspx?")!=-1){if(location.href.indexOf("k=")!=-1){var arr1 = location.search.substr(1).split("&");var p1="";p2="";for(i=0;i<arr1.length;i++){if([arr1[i].split("=")[0]].toString()=="k"){p1=arr1[i].split("=")[0];p2=arr1[i].split("=")[1];}}url=location.href.replace("k="+p2,"k="+escape(k));}else url=location.href+"&k="+escape(k);}
else url="/house/sell_list.aspx?k="+escape(k);
}
else if(channeltype=="job")
{
if(location.href.indexOf("/job/list.aspx?")!=-1){if(location.href.indexOf("k=")!=-1){var arr1 = location.search.substr(1).split("&");var p1="";p2="";for(i=0;i<arr1.length;i++){if([arr1[i].split("=")[0]].toString()=="k"){p1=arr1[i].split("=")[0];p2=arr1[i].split("=")[1];}}url=location.href.replace("k="+p2,"k="+escape(k));}else url=location.href+"&k="+escape(k);}
else url="/job/list.aspx?classid=0&k="+escape(k);
}
else if(channeltype=="company")url="/company/list.aspx?classid=0&k="+escape(k);
else if(channeltype=="news")url="/news/list.aspx?classid=0&k="+escape(k);
else if(channeltype=="bbs")url="/bbs/bbs_more.aspx?k="+escape(k);
else {top.location="/search.aspx?k="+escape(k);}
if(url!="")top.location=url;
}


function INDEX1_k_keydown(e)
{
var theEvent=window.event||e;var keyNum=theEvent.keyCode||theEvent.which;
if(keyNum==13)INDEX1_dosearch(document.getElementById('search_type_value').value,document.getElementById('k').value);
}


function ToApDo(type){
if(type=="1"){
document.getElementById("ToAp_td1").className="td1";
document.getElementById("ToAp_td2").className="none";
document.getElementById("ToAp1").className="on";
document.getElementById("ToAp2").className="";
document.getElementById("ToAp_abs").className="abs";
}
else if(type=="2"){
document.getElementById("ToAp_td1").className="none";
document.getElementById("ToAp_td2").className="td1";
document.getElementById("ToAp1").className="";
document.getElementById("ToAp2").className="on";
document.getElementById("ToAp_abs").className="none";
if(document.getElementById("ToAp_src").src!="/plugin/a/main/gather1.aspx"){
document.getElementById("ToAp_src").src="/plugin/a/main/gather1.aspx";
}
}
}
