window.onerror=function(){return true}
ThisPageName = location.pathname.replace(/(.*)\//, "");
var PSearchType="";
function LoadBookPic(ProductBookID,CorNo,CorWebID)
{
var ww = window.screen.width;
var hh = window.screen.height - 20;
GUrl = "BookView.asp?ProductBookID="+ProductBookID + "&CorNo=" + CorNo + "&CorWebID=" + CorWebID;
pop = window.open(GUrl, "","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=yes,status=no,top=0,left=0,width="+ww+",height="+hh);
  pop.moveTo(0,0);
  pop.focus();
}
function ReTest()
{
	alert('fff');
}
function JJRloadFrom()
{
   document.getElementById("JJTC").src = "http://www.0595stw.cn";
}

function QZRloadFrom()
{
   document.getElementById("QZTC").src = "http://www.0595stw.net/";
}
function ShowMessageError(MessageErrorText)
{
	document.getElementById("MessageError").innerHTML = '<img src="Images/blank_reg.gif" width="20" height="24" align="absmiddle">'+MessageErrorText;
	document.getElementById("MessageError").style.display='block';
	window.setTimeout(ClearMessageError, 1000);
}
function ClearMessageError()
{
	document.getElementById("MessageError").style.display='none';
	document.getElementById("MessageError").innerHTML = '';
}
function SendMessage()
{
	var MessageContentV
	var MessageSendUserNameV
	MessageContentV = document.getElementById("MessageContent").value;
	MessageSendUserNameV = document.getElementById("MessageSendUserName").value;
	MessageContentV = trim(MessageContentV)
	MessageSendUserNameV = trim(MessageSendUserNameV)
	if (MessageSendUserNameV=="")
	{
		ShowMessageError('请输入聊天昵称!')
		return false;
	}
	if (MessageContentV=="")
	{
		ShowMessageError('请输入聊天内容!')
		return false;
	}
    loadAJAXTab("/AjaxFile/Index/SendMessage.asp?MessageContent="+MessageContentV+'&MessageSendUserName='+MessageSendUserNameV,"GetMessage");
	document.getElementById("MessageContent").value = "";
	document.getElementById("MessageContent").focus();
}
function trim(str)
{
	for(var i = 0;i<str.length && str.charAt(i)=="";i++);
	for(var j = str.length;j>0 && str.charAt(j-1)=="";j--);
	if(i>j) return "";
	return str.substring(i,j);
}
function GetMessage()
{
	//document.getElementById("GetMessage").innerHTML = '';
	loadAJAXTab("/AjaxFile/Index/GetMessage.asp?a="+Math.random(),"GetMessage");
	window.top.focus();
	document.getElementById("MessageContent").focus();
}
function ReflashMessage()
{
	
	loadAJAXTab("/AjaxFile/Index/ReflashMessage.asp?f="+Math.random(),"ReflashMessage");
	setTimeout("ReflashMessage()",500);
}
function GoSearch(SearchKeyWord)
{
	 PSearchType = "";
	 document.getElementById("SearchKeyWord").value=SearchKeyWord;
	 PageSearch();
}
function ClassGoCorSearch(SearchKeyWord,SearchType)
{
   document.getElementById("SearchKeyWord").value=SearchKeyWord
   PSearchType = SearchType;
   PageObj.PageNumber = 1;
   PageObj.CRecordcounts = "";
   PageObj.SearchKeyWord = SearchKeyWord;
   RecordList();
}
function GoCorSearch(SearchKeyWord,SearchCorWebID)
{
	 document.SearchForm.target="_blank";
	 document.SearchForm.action = "ProductList.asp?SearchCorWebID="+SearchCorWebID;
	 document.SearchForm.SearchWord.value=SearchKeyWord;
	 document.SearchForm.submit();
}
function ChangNewTable(NTValue)
{
//alert(TValue);
 NIndexKHtml = "IndexKT" + NTValue + ".html";
 if (NTValue!=Nfirsttvalue)
 {
	document.getElementById("NewTable"+NTValue).className='TableKuangLine';
	document.getElementById("NewTD"+NTValue).className='TDBGT';
	document.getElementById("NewTD"+Nfirsttvalue).className='';
	document.getElementById("NewTable"+Nfirsttvalue).className='';
    Nfirsttvalue = NTValue;
 }
 // loadAJAXTab("/Html/"+NIndexKHtml,"IndexKT");
}

var firsttvalue=1;
function MenuSelect(MenuName,SelectMenuID,MenuDivName)
{
	if (SelectMenuID!=firsttvalue)
	{
		document.getElementById(MenuName+SelectMenuID).className='TableBGClass';
		document.getElementById(MenuName+firsttvalue).className='TableBGClassClick'
		
		document.getElementById(MenuDivName+SelectMenuID).style.display='block';
		document.getElementById(MenuDivName+firsttvalue).style.display='none';
		firsttvalue = SelectMenuID;
	}
}
function SortClassShow(SClassID)
{
	if (document.getElementById("YpSort"+SClassID).style.display=='none')
	{
		document.getElementById("YpSort"+SClassID).style.display='block';
		document.getElementById("YpSortImg"+SClassID).src='../Images/exp.gif';
	}
	else
	{
	   document.getElementById("YpSort"+SClassID).style.display='none';
	   document.getElementById("YpSortImg"+SClassID).src='../Images/expand.gif';
	}
}
function ChangTable(TValue)
{
//alert(TValue);
 Obj = "T" + TValue;
 FObj = "T" + firsttvalue;
 NObj = "IndexNews" + TValue;
 NFObj = "IndexNews" + firsttvalue;
 if (TValue!=firsttvalue)
 {
	document.getElementById(Obj).className='BG1';
	document.getElementById(FObj).className='BG2'
	
	document.getElementById(NObj).style.display='block';
    document.getElementById(NFObj).style.display='none';
    firsttvalue = TValue;
 }
// loadAJAXTab("/AjaxFile/Index/PicNews.asp?ShowType="+TValue,"IndexNews");
}


var firsttvalueT=1;
function CorInfo(TValueT)
{
 ObjT = "TT" + TValueT;
 FObjT = "TT" + firsttvalueT;
if (TValueT!=firsttvalueT)
 {
	document.getElementById(ObjT).className='TableBGClass';
	document.getElementById(FObjT).className='TableBGClassClick'
    firsttvalueT = TValueT;
 }
 loadAJAXTab("/AjaxFile/Index/CorInfo.asp?ShowType="+TValueT,"IndexCorInfo");
}

function Open_Show_Img(ImgUrl)
{
   window.open("ShowAllPic.asp?ImgUrl="+ImgUrl,"ImgShow","height=300,width=400,top=90,left=120,toolbar=no,menubar=no,scrollbars=1,resizable=1,location=no, status=no")
}

function ShowProduct(ShowID)
{
   pop=window.open("ProductShow"+ShowID+".html","ProductShow","height=600,width=900,top=40,left=30")
   pop.focus();
}

function fGTO(id){
	return document.getElementById(id);
}
function PlayShow()
{
 fGTO("Music").src="Play.html";
}
function SetDiv()
{
   loadAJAXTab("/Html/MusicList.html","MusicList");
   loadAJAXTab("/HTML/TcZt.html","TcZt");
   loadAJAXTab("/HTML/TJPP.html","TJPP");
   loadAJAXTab("/Html/ZH.asp","ZH");
   loadAJAXTab("/Html/CYWZ.html","CYWZ");
}
function IndexUrl()
{
   loadAJAXTab("/AjaxFile/Index/IndexUrl.asp","IndexUrl");
}
function WebLink()
{
   loadAJAXTab("/AjaxFile/Index/NewWebLink.asp","WebLink");
}
var firstmenuid=2;
function SearchMenu(Menuid)
{
 MenuObj = "Menu" + Menuid;
 FMenuObj = "Menu" + firstmenuid;
 if (Menuid!=firstmenuid)
 {
	document.getElementById(MenuObj).className='STYLE49';
	document.getElementById(FMenuObj).className='STYLE50'
    firstmenuid = Menuid;
 }
 if (Menuid==1)
 {
    document.SearchForm.SearchButton.value="企业　搜索";
	document.SearchForm.action = "CorList.asp";
 }
 else if(Menuid==2)
 {
    document.SearchForm.SearchButton.value="企业　搜索";
	document.SearchForm.action = "CorList.asp";
 }
 else if(Menuid==3)
 {
    document.SearchForm.SearchButton.value="产品　搜索";
    document.SearchForm.action = "ProductList.asp";
 }
 else if(Menuid==4)
 {
    document.SearchForm.SearchButton.value="黄页　搜索";
    document.SearchForm.action = "YellowPages.asp";
 }
 else if(Menuid==5)
 {
    document.SearchForm.SearchButton.value="新闻　搜索";
    document.SearchForm.action = "NewsList.asp";
 }
 else if(Menuid==6)
 {
    document.SearchForm.SearchButton.value="网站　搜索";
    document.SearchForm.action = "STWebs.asp";
 }
 else if(Menuid==7)
 {
    document.SearchForm.SearchButton.value="招聘　搜索";
    document.SearchForm.action = "CorJobList.asp";
 }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function changefont(obj,font_size,font_color,bg_color){
	if(obj == null) return;
	if(font_size == null) font_size = 'bold';
	if(font_color == null) font_color = '#ff6600';
	if(bg_color == null) bg_color = '#ffffff';
	
	obj.style.fontWeight = font_size;
	obj.style.color = font_color;
	obj.style.backgroundColor = bg_color;
}

//写cookies函数 作者：翟振凯
function SetCookie(name,value)//两个参数，一个是cookie的名子，一个是值
{
    var Days = 30; //此 cookie 将被保存 30 天
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
function getCookie(name)//取cookies函数        
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;

}
function delCookie(name)//删除cookie
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
function PlayMusic(PlayID)
{
  var w=480;
  var h=520;
  if (!isNaN(PlayID))
  {
   PlayID = "'" + PlayID + "'";
  }
  pop=window.open("MusicPlay.html?PlayID="+PlayID,"musicplay","fullscreen=no,location=no,menubar=no,resizable=no,menubar=no,width="+w+",height="+h);
  pop.moveTo((screen.width-w)/2,(screen.height-h)/2);
  pop.focus();
}
function OpenWin(GoUrl,GoCorWebID,GoWinName)
{
  pop=window.open(GoUrl+"?SearchCorWebID="+GoCorWebID,GoWinName);
  pop.focus();
}
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
			e.checked = true// form.chkall.checked;
	}
}
function CheckOthers(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
//		if (e.name != 'chkall')
			if (e.checked==false)
			{
				e.checked = true;// form.chkall.checked;
			}
			else
			{
				e.checked = false;
			}
	}
}



function CallCollectGarbage()
{
	CollectGarbage();
	window.setTimeout(CallCollectGarbage, 10000);
}
var FirstHitBgID=5
function SetOrderByID(OrderBy,HitBgID)
{
    document.getElementById("HitBG"+FirstHitBgID).className='HitBg2';
	document.getElementById("HitBG"+HitBgID).className='HitBg1';
	FirstHitBgID = HitBgID;
	PageObj.OrderBy = OrderBy;
	RecordList();
}
function RecordList()
{
	document.getElementById("RecordList").innerHTML = '';
	window.setTimeout(ShowLoadIng, 100);
	alert(PageName)
	if (PageName=="CORLIST.ASP")
	{
		LoadText = '正在读取企业列表...';

		loadAJAXTab('/AjaxFile/MainList/'+ PageName +'?CRecordcounts='+ PageObj.CRecordcounts + '&PageNumber=' + PageObj.PageNumber + '&AscDesc='+ PageObj.AscDesc +'&OrderBy='+ PageObj.OrderBy +'&SearchKeyWord='+ PageObj.SearchKeyWord +'&a='+Math.random(),'RecordList');
	}
	else if (PageName=="CORJOBLIST.ASP")
	{
		LoadText = '正在读取招聘信息...';
		loadAJAXTab('/AjaxFile/MainList/'+ PageName +'?CRecordcounts='+ PageObj.CRecordcounts + '&PageNumber=' + PageObj.PageNumber + '&AscDesc='+ PageObj.AscDesc +'&OrderBy='+ PageObj.OrderBy +'&SearchCorWebID='+ PageObj.SearchCorWebID +'&SearchKeyWord='+ PageObj.SearchKeyWord +'&a='+Math.random(),'RecordList');
	}
	else if (PageName=="YELLOWPAGES.ASP")
	{
		LoadText = '正在读取企业黄页信息，因上百万条数据记录，请等待...';
		loadAJAXTab('/AjaxFile/MainList/'+ PageName +'?CRecordcounts='+ PageObj.CRecordcounts + '&PageNumber=' + PageObj.PageNumber + '&AscDesc='+ PageObj.AscDesc +'&OrderBy='+ PageObj.OrderBy +'&SearchKeyWord='+ PageObj.SearchKeyWord +'&a='+Math.random(),'RecordList');
	}
	else if (PageName=="PRODUCTLIST.ASP")
	{
		LoadText = '正在读取产品信息...';
		loadAJAXTab('/AjaxFile/MainList/'+ PageName +'?CRecordcounts='+ PageObj.CRecordcounts + '&PageNumber=' + PageObj.PageNumber + '&AscDesc='+ PageObj.AscDesc +'&OrderBy='+ PageObj.OrderBy +'&SearchCorWebID='+ PageObj.SearchCorWebID +'&SearchKeyWord='+ PageObj.SearchKeyWord +'&PSearchType='+PSearchType + '&a='+Math.random(),'RecordList');
	}
	else if (PageName=="NEWSLIST.ASP" || PageName=="NEWSLIST.HTML")
	{
		LoadText = '正在读取新闻数据...';
		loadAJAXTab('/AjaxFile/MainList/NEWSLIST.ASP?CRecordcounts='+ PageObj.CRecordcounts + '&PageNumber=' + PageObj.PageNumber + '&AscDesc='+ PageObj.AscDesc +'&OrderBy='+ PageObj.OrderBy +'&SearchCorWebID='+ PageObj.SearchCorWebID +'&SearchKeyWord='+ PageObj.SearchKeyWord +'&a='+Math.random(),'RecordList');
	}
}
function SetColor(obj, color)
{
	obj.style.backgroundColor=color;
}
function OpenContent(ID)
{
	var Obj = document.getElementById("JobInfo" + ID);
	if(Obj.style.display == "none")
		Obj.style.display = "";
	else
		Obj.style.display = "none";
}
/******************************************/
/*功能：弹出窗体                          */
/*参数：URL 地址,TYPE 模式/全屏,SC 是否显示滚动条*/
/*      iW 宽度,iH 高度,TOP 头部位置,LEFT 左边位置,*/
/*      R 改变大小,S 状态栏显示,T,TB 帮助显示,FN窗口名称*/
/*返回：无                                */
/******************************************/
function OW(URL,FN,TYPE,SC,iW,iH,TOP,LEFT,R,S,T,TB)
{
	var sF="dependent=yes,resizable=no,toolbar=no,status=1,directories=no,menubar=no,";
	
	sF+="scrollbars="+(SC?SC:"NO")+",";
		if(FN=="")
		{
			FN = "_blank";
		}	
	if (TYPE=="full"){
		sF+=" Width=1010,";
		sF+=" Height=750,";
		sF+=" Top=0,";
		sF+=" Left=0,";
		pop = window.open(URL, FN, sF, false);
		pop.focus();
		return;
	}
	
	
	if (TYPE=="modal"){
		sF ="resizable:no; status:no; scroll:yes;";
		sF+=" dialogWidth:800px;";
		sF+=" dialogHeight:570px;";
			if(parent.length<2){
				sF+="dialogTop:"+(parseInt(parent.dialogTop)+25)+"px;";					
				sF+="dialogLeft:"+(parseInt(parent.dialogLeft)+25)+"px;";
				}
		
		var alpha = '?';
		var _URL = URL;
		var unique = (new Date()).getTime();
		//如果没有参数		
		if (_URL.indexOf(alpha) == -1){
			_URL+= "?time="+unique;
		}
		else
		{
		//如果带有参数，含有‘?’
			_URL+= "&time="+unique;
		}
		//alert(_URL.indexOf(alpha));alert(_URL);
		return window.showModalDialog(_URL,window,sF);
	}
	else if (TYPE=="modeless"){
		
		sF ="resizable:no; status:no; scroll:yes;";
		sF+=" dialogWidth:800px;";
		sF+=" dialogHeight:570px;";
			if(parent.length<2){
				sF+="dialogTop:"+(parseInt(parent.dialogTop)+25)+"px;";					
				sF+="dialogLeft:"+(parseInt(parent.dialogLeft)+25)+"px;";
				}
		
		var alpha = '?';
		var _URL = URL;
		var unique = (new Date()).getTime();
		//如果没有参数		
		if (_URL.indexOf(alpha) == -1){
			_URL+= "?time="+unique;
		}
		else
		{
		//如果带有参数，含有??
			_URL+= "&time="+unique;
		}
		//alert(_URL.indexOf(alpha));alert(_URL);
		return window.showModelessDialog(_URL,window,sF);
	}	
	else
	{
		if(iW!=undefined && iH!=undefined){
			sF+=" Width="+iW+",";
			sF+=" Height="+iH+",";
		}
		else{
			iW=800;
			iH=570;
			sF+=" Width=800,";
			sF+=" Height=570,";
		}
		if(window.opener==null || window.opener==undefined){
			sF+=" Top=" + (screen.height-iH)/2 + "px,";
			sF+=" Left=" + (screen.width-iW)/2 + "px,";
		}else{
			sF+="Top="+(parseInt(window.screenTop)+20)+"px,";					
			sF+="Left="+(parseInt(window.screenLeft)+30)+"px,";
		}
		if (SC=="")
		{
		   sF+=" scrollbars=yes,"
		}
		else
		{
		   sF+=" scrollbars=" + SC + ","
		}
		
		pop = window.open(URL, FN, sF, false);
		pop.focus();
	}
}
var copytoclip=1;
function copyToClipboard(theField,isalert) {	
	var tempval=$(theField);		
	if (navigator.appVersion.match(/\bMSIE\b/)){
		tempval.select();		
		if (copytoclip==1){
			therange=tempval.createTextRange();
			therange.execCommand("Copy");
			if(isalert!=false)alert("复制成功。现在您可以粘贴（Ctrl+v）给您的好友了。");
		}
		return;
	}else{
		alert("您使用的浏览器不支持此复制功能，请使用Ctrl+C或鼠标右键。");
		tempval.select();		
	}
}
function SetNewHtml(NewID)
{
	loadAJAXTab("/AjaxFile/NewShow.asp?NewID="+NewID,"ArticleCnt");
}
function ShowNewsHits(NewID)
{
}
window.setTimeout(CallCollectGarbage, 1000);
MM_preloadImages('/Images/Newloading.gif');
MM_preloadImages('/images/QQonline.gif');
MM_preloadImages('/Images/Logo.gif');
MM_preloadImages('/Images/TOPLB_09.gif');
MM_preloadImages('/Images/TOPLB_19.gif');
MM_preloadImages('/Images/TOPLB_12.gif');
MM_preloadImages('/Images/BT_32.gif');
MM_preloadImages('/Images/BT_29.gif');