// JavaScript Document
var IsFirst;
IsFirst="Y";
function ProShowHideArea(id,intStart,intEnd)
{
	for(i=intStart;i<=intEnd;i++)
	{
		if(id==i)
		{
			document.getElementById("divtop_"+i).style.display="";
		}
		else
		{
			document.getElementById("divtop_"+i).style.display="none";
		}
	}
}

function ProShowHideArea2(id,intStart,intEnd)
{
	for(i=intStart;i<=intEnd;i++)
	{
		if(id==i)
		{
			document.getElementById("divtop_"+i).style.display="";
			document.getElementById("tdHit_"+i).className='clsTab_hit_change_show';
		}
		else
		{
			document.getElementById("divtop_"+i).style.display="none";
			document.getElementById("tdHit_"+i).className='clsTab_hit_change_hide';
		}
	}
}
function ProShowHideArea3(id,intStart,intEnd)
{
	for(i=intStart;i<=intEnd;i++)
	{
		if(id==i)
		{
			document.getElementById("divtop_"+i).style.display="";
			document.getElementById("tdHit_"+i).className='exchange_blue_show';
		}
		else
		{
			document.getElementById("divtop_"+i).style.display="none";
			document.getElementById("tdHit_"+i).className='exchange_blue_hide';
		}
	}
}
function ProShowHideArea4(id,intStart,intEnd)
{
	for(i=intStart;i<=intEnd;i++)
	{
		if(id==i)
		{
			document.getElementById("divtop_"+i).style.display="";
			document.getElementById("tdHit_"+i).className='exchange_grey_show';
		}
		else
		{
			document.getElementById("divtop_"+i).style.display="none";
			document.getElementById("tdHit_"+i).className='exchange_grey_hide';
		}
	}
}

function ProClearTip()
{
	if(IsFirst=="Y")
	{
		 
		var tempObj=document.getElementById("MainTxtKey");
		tempObj.value="";
		IsFirst="N";
	}
}
function ProRemoveSpace(strValue)
{
   return  strValue.replace(/(^\s*)|(\s*$)/g,"");   
}

function ProEnter()
{
	if(event.keyCode==13)
	{
		ProMainFind();
	}

}

 function ProMainFind()
{
       var MainSelectType=document.getElementById("MainSelectType");
	var MainKeySearch=document.getElementById("MainTxtKey");
	MainSelectType=MainSelectType.value; //类型
	MainKeySearch=MainKeySearch.value; //值
	MainKeySearch=ProRemoveSpace(MainKeySearch);
	if(MainKeySearch=="")
	{
		alert("请输入要搜索的关键词,如二手电脑");
		return false;
	}
			
	var strUrl;
	switch(MainSelectType) //strType2
	{
		case "1" : //供求信息
			var in_txtType1="-1";		
			var in_txtType2="-1";			
			var in_txtType3="-1";			
			var in_txtType4="-1";			
			var in_txtFromPrice="";			
			var in_txtToPrice="";						
			var in_txtWebSite="-1";
	strUrl="pageNos=1&searchKey="+MainKeySearch+"&types="+MainSelectType+"&type1="+in_txtType1+"&type2="+in_txtType2+"&type3="+in_txtType3;
			strUrl=strUrl+"&type4="+in_txtType4+"&fromPrice="+in_txtFromPrice+"&toPrice="+in_txtToPrice;
			strUrl=strUrl+"&website=0&requesttype=1&AllRecordCount=-1";
//			window.open('/search/oldshouresult.asp?'+strUrl);	
			document.getElementById("mainshou_form").action="/search/oldshouresult.asp?"+strUrl;
			break;
		case "2":			 		
			strUrl="pageNos=1&requesttype=2&searchKey="+MainKeySearch+"&AllRecordCount=-1";
			document.getElementById("mainshou_form").action="/search/oldshouresult.asp?"+strUrl;
	//		window.open('/search/oldshouresult.asp?'+strUrl);			
			break;
		case "3":   //行业资讯
			strUrl="pageNos=1&requesttype=3&searchKey="+MainKeySearch+"&AllRecordCount=-1";
			document.getElementById("mainshou_form").action="/search/oldshouresult.asp?"+strUrl;
		//	window.open('/search/oldshouresult.asp?'+strUrl);			
			break;
		case "4":
			strUrl="pageNos=1&requesttype=4&searchKey="+MainKeySearch+"&AllRecordCount=-1";
			document.getElementById("mainshou_form").action="/search/oldshouresult.asp?"+strUrl;
//			window.open('../search/oldshouresult.asp?'+strUrl);			
			break;
	}	
}


	 
  function ProMainFindTip(strId)
{
 	       var strUrl;
 
			var in_txtType1="-1";		
			var in_txtType2="-1";			
			var in_txtType3="-1";			
			var in_txtType4="-1";			
			var in_txtFromPrice="";			
			var in_txtToPrice="";						
			var in_txtWebSite="-1";
	strUrl="pageNos=1&searchKey="+strId+"&types=1&type1="+in_txtType1+"&type2="+in_txtType2+"&type3="+in_txtType3;
			strUrl=strUrl+"&type4="+in_txtType4+"&fromPrice="+in_txtFromPrice+"&toPrice="+in_txtToPrice;
			strUrl=strUrl+"&website=0&requesttype=1&AllRecordCount=-1";
			window.open('/search/oldshouresult.asp?'+strUrl);	
			 
}

function ProBuild12Area()
{
	var thisDLoc;
	thisDLoc= document.location;
	 var nows=new Date(); 
   var strUrl="/search/build12Area.asp?tmp="+nows+"&siteid="+thisDLoc;
   var mAjaxer = new Ajaxer(strUrl,ProBuild12AreaComple,errorFunction) ;
    mAjaxer.send(); 
}
function errorFunction(strError)
{
	
    alert(strError.code+strError.message);
}
function ProBuild12AreaComple(strText)
{

	var obj,i,strText2,strTemp,strAllText;
	strAllText=strText.split("<T>"); //分解多个表


	ProBuildEach12Area("twcx2",strAllText[0]); //求购
	ProBuildEach12Area("twcx3",strAllText[1]); //维修
 	ProBuildEach12Area("twcx4",strAllText[2]); //回收
 	ProBuildEach12Area("twcx5",strAllText[3]); //批发
 	ProBuildEach12Area("twcx6",strAllText[4]); //合作
 	ProBuildEach12Area("twcx7",strAllText[5]); //交换
 	ProBuildEach12Area("twcx8",strAllText[6]); //出租
 	ProBuildEach12Area("twcx9",strAllText[7]); //求租	
 	ProBuildEach12Area("twcx10",strAllText[8]); //招聘		
 	ProBuildEach12Area("twcx11",strAllText[9]); //招聘			
 	ProBuildEach12Area("twcx12",strAllText[10]); //培训
}
function ProBuildEach12Area(strAreaId,strText)
{
	var strTemp,obj,strtext2,strTempPrice;
	strText=strText.split("<R>");	
	strTemp="<ul class='bt12'>";
	obj=document.getElementById(strAreaId);
	if(strText!="NONEDATA")
	{
	for(i=0;i<strText.length;i++)
	 {
		 strText2=strText[i];
		 strText2=strText2.split("<C>");
		 strTempPrice=strText2[2];
		 if(strTempPrice=="0")
		 {
			 strTempPrice="￥面议";
		 }
		 else
		 {
			  strTempPrice="￥"+strTempPrice;
		 }
 strTemp=strTemp+"<li><span class='a06'>["+strText2[0]+"]</span><span class='a07'><a href='"+strText2[3]+"' target='_blank'>"
		 strTemp=strTemp+""+strText2[1]+"</a></span><span class='a08'>"+strTempPrice+"</span>"
		 strTemp=strTemp+"</li>"
	 }
	}
	else
	{
		strTemp="暂无信息";
	}
	 strTemp=strTemp+"</ul>"
	 obj.innerHTML=strTemp;
}



