 function changebg(obj,tdbg)
{
	if (tdbg!='')
	{
		document.getElementById(obj).style.backgroundImage="url(" + tdbg + ")";
	}
	else
	{document.getElementById(obj).style.backgroundImage='';}
//document.body.background = id + '.jpg'; 
	
	
	
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changebg(obj,tdbg)
{
	if (tdbg!='')
	{
        //img.src = tdbg;
		document.getElementById(obj).style.backgroundImage="url(" + tdbg + ")";
	}
	else
	{document.getElementById(obj).style.backgroundImage='';}	
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		button_news_over = newImage("img png/news_.jpg");
			
		button_nolige_over = newImage("img png/works_.jpg");
		
		button_nolige_over = newImage("img png/nolige_.jpg");
		button_downs_over = newImage("img png/downs_.jpg");
		button_earthweb_over = newImage("img png/earthweb_.jpg");
		button_cussup_over = newImage("img png/cussup_.jpg");
		
		button_recase_over = newImage("img png/recase_.jpg");
		button_hotmes_over = newImage("img png/hotmes_.jpg");
			
		button_daymes_over = newImage("img png/daymes_.jpg");
			
		button_goods_over =  newImage("img png/goods_.jpg");
		button_saysea_over = newImage("img png/saysea_.jpg");
		
		button_base_over = newImage("../img png/person_base.jpg");
		button_ex_over = newImage("../img png/person_ex.jpg");
		button_pas_over = newImage("../img png/person_pas.jpg");
		button_stu_over = newImage("../img png/person_stu.jpg");
		button_qx_over = newImage("../img png/person_qx.jpg");
		button_qu_over = newImage("../img png/person_qu.jpg");
		
		button_newsc_over = newImage("../img png/news_c.jpg");
		button_alls_over = newImage("../img png/allearth_c.jpg");
		button_rep_over = newImage("../img png/rep_c.jpg");
		button_downsc_over = newImage("../img png/down_c.jpg");
		button_ass_over = newImage("../img png/allearht_c.jpg");
		button_cus_over = newImage("../img png/cus_c.jpg");
		preloadFlag = true;
	}
}
//window.onload=function()
//{
//var o=document.getElementById('infozone');
//window.setInterval(function(){scrollup(o,20,0);},2000);
//}
//
//function scrollup(o,d,c)
//{
//if(d==c){
//var t=o.firstChild.cloneNode(true);
//o.removeChild(o.firstChild);
//o.appendChild(t);
//t.style.marginTop=o.firstChild.style.marginTop='0px';
//}
//else{
//var s=3,c=c+s,l=(c>=d?c-d:0);
//o.firstChild.style.marginTop=-c+l+'px';
//window.setTimeout(function(){scrollup(o,d,c-l)},100);
//}
//}

function changediv(divname)
{
	
	if (divname=="xi"){
		document.getElementById("xi").style.display= '';

		document.getElementById("cx").style.display= 'none';
		document.getElementById("jj").style.display= 'none';
		document.getElementById("cc").style.display= 'none';
		}
		if (divname=="cx"){
			
		document.getElementById("cx").style.display= '';

		document.getElementById("xi").style.display= 'none';
		document.getElementById("jj").style.display= 'none';
		document.getElementById("cc").style.display= 'none';
		}
		if (divname=="jj"){
		document.getElementById("cx").style.display= 'none';
		document.getElementById("xi").style.display= 'none';
		document.getElementById("jj").style.display= '';
		document.getElementById("cc").style.display= 'none';

		}
		if (divname=="cc"){
		document.getElementById("cx").style.display= 'none';
		document.getElementById("xi").style.display= 'none';
		document.getElementById("jj").style.display= 'none';

		document.getElementById("cc").style.display= '';
		}
		//if (divname=="hy"){
//		document.getElementById("cx").style.display= 'none';
//		document.getElementById("xi").style.display= 'none';
//		document.getElementById("jj").style.display= 'none';
//		document.getElementById("hy").style.display= '';
//		document.getElementById("cc").style.display= 'none';
//		}
	return true;
}

function changenewsdiv(divname)
{
	
	if (divname=="xi"){
		document.getElementById("xi").style.display= '';
		document.getElementById("cx").style.display= 'none';
		document.getElementById("jj").style.display= 'none';
		document.getElementById("cc").style.display= 'none';
		document.getElementById("hy").style.display= 'none';
		}
		if (divname=="cx"){
		document.getElementById("cx").style.display= '';
		document.getElementById("xi").style.display= 'none';
		document.getElementById("jj").style.display= 'none';
		document.getElementById("cc").style.display= 'none';
		document.getElementById("hy").style.display= 'none';
		}
		if (divname=="jj"){
		document.getElementById("cx").style.display= 'none';
		document.getElementById("xi").style.display= 'none';
		document.getElementById("jj").style.display= '';
		document.getElementById("cc").style.display= 'none';
		document.getElementById("hy").style.display= 'none';
		}
		if (divname=="cc"){
		document.getElementById("cx").style.display= 'none';
		document.getElementById("xi").style.display= 'none';
		document.getElementById("jj").style.display= 'none';
		document.getElementById("hy").style.display= 'none';
		document.getElementById("cc").style.display= '';
		}
		if (divname=="hy"){
		document.getElementById("cx").style.display= 'none';
		document.getElementById("xi").style.display= 'none';
		document.getElementById("jj").style.display= 'none';
		document.getElementById("hy").style.display= '';
		document.getElementById("cc").style.display= 'none';
		}
		
	return true;
}

function newImages(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImagens() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImagens.arguments.length; i+=2) {
			document[changeImagens.arguments[i]].src = changeImagens.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImagens() {
	if (document.images) {
		button_news_over = newImage("img png/news_.jpg");
		button_works_over = newImage("img png/works_.jpg");
		button_nolige_over = newImage("img png/nolige_.jpg");
		button_downs_over = newImage("img png/downs_.jpg");
		button_earthweb_over = newImage("img png/earthweb_.jpg");
		button_cussup_over = newImage("img png/cussup_.jpg");
		button_opersupn_over = newImage("img png/opersupn_.jpg");
		
		button_recase_over = newImage("img png/recasen_.jpg");
		button_hotmes_over = newImage("img png/hotmesn_.jpg");
		button_daymes_over = newImage("img png/daymesn_.jpg");
		button_goods_over =  newImage("img png/goodsn_.jpg");
		button_saysea_over = newImage("img png/saysean_.jpg");
		
		preloadFlag = true;
	}
}



function newImages_p(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImagens_p() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImagens.arguments.length; i+=2) {
			document[changeImagens.arguments[i]].src = changeImagens.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImagens_p() {
	if (document.images) {
		button_news_over = newImages_p("../img png/person_base.gif");
		preloadFlag = true;
	}
}

function Cusshow()
{
	var Cusflag="Cusflag";
	if(document.getElementById(eval(Cusflag)).style.display== 'none')
	{document.getElementById(eval(Cusflag)).style.display= "";}
	else
	{document.getElementById(eval(Cusflag)).style.display= 'none';}
	//if(document.getElementById("Cus").checked==true)
//	{
//		document.getElementById("Cusflag").checked
//	}
//	else
//	{
//		document.getElementById("Cusflag").checked
//	}
}
function searchnote()
{
	var Ordernum=document.getElementById("Ordernum").value;
	if(Ordernum!="")
		{
			window.open("OrderSreach.asp?Ordernum="+Ordernum);
		}
}

function Search_all()
{//document.getElementById("myForm");
//alert(document.getElementById("searchbox").checked);
var results=document.frmSearchBox1.results.value;
var classid=document.frmSearchBox1.classid.value;

//alert(classid);
//alert(results);


	if(classid==5)
	{
		window.open("http://www.google.cn/search?q="+ results +"&ie=gb2312&oe=gb2312&hl=zh-CN");
		return false;
	}
	else
	{
		//alert("searchresulttemp.asp?results="+results+"&classid="+classid);
		window.location.href="../searchresulttemp.asp?results="+escape(results)+"&classid="+classid;
		return false;
	}	
}

function Search_all2()
{//document.getElementById("myForm");
//alert(document.getElementById("searchbox").checked);
var results=document.frmSearchBox2.results2.value;
var classid=document.frmSearchBox1.classid.value;

//alert(classid);
//alert(results);


	if(classid==5)
	{
		window.open("http://www.google.cn/search?q="+ results +"&ie=gb2312&oe=gb2312&hl=zh-CN");
		return false;
	}
	else
	{
		//alert("searchresulttemp.asp?results="+results+"&classid="+classid);
		window.location.href="searchresulttemp.asp?results="+escape(results)+"&classid="+classid;
		return false;
	}	
}
function Search()
{//document.getElementById("myForm");
//alert(document.getElementById("searchbox").checked);

var result=document.searchweb.q.value;

	if(document.getElementById("searchbox").checked==true)
	{
		window.open("http://www.google.cn/search?q="+ result +"&ie=gb2312&oe=gb2312&hl=zh-CN");
		return false;
	}
	else
	{
		if(result!="")
		{
			window.open("searchresulttemp.asp?results="+result);
			//window.open("IndexSreach.asp?result="+result);
			return false;
		}
		
	}	
}
function Search_()
{//document.getElementById("myForm");
//alert(document.getElementById("searchbox").checked);

var result=document.searchweb.q.value;

	if(document.getElementById("searchbox").checked==true)
	{
		window.open("http://www.google.cn/search?q="+ result +"&ie=gb2312&oe=gb2312&hl=zh-CN");
		return false;
	}
	else
	{
		if(result!="")
		{
			window.open("../searchresulttemp.asp?results="+result);
			//window.open("IndexSreach.asp?result="+result);
			return false;
		}
		
	}	
}
function Searchall()
{//document.getElementById("myForm");
//alert(document.getElementById("searchbox").checked);
var result=document.searchweb.q.value;

	if(document.getElementById("searchbox").checked==true)
	{
		window.open("http://www.google.cn/search?q="+ result +"&ie=gb2312&oe=gb2312&hl=zh-CN");
		return false;
	}
	else
	{
		if(result!="")
		{
			window.open("searchresult.asp?result="+result);
			return false;
		}
		
	}	
}
function Search2()
{//document.getElementById("myForm");
//alert(document.getElementById("searchbox").checked);
var result=document.searchweb2.q2.value;

	if(document.getElementById("searchbox2").checked==true)
	{
		window.open("http://www.google.cn/search?q="+ result +"&ie=gb2312&oe=gb2312&hl=zh-CN");
		return false;
	}
	else
	{
		if(result!="")
		{
			window.open("searchresult.asp?result="+result);
			return false;
		}
		
	}	
}
function Searcht()
{//document.getElementById("myForm");
//alert(document.getElementById("searchbox").checked);
var result=document.searchweb.q.value;

	if(document.getElementById("searchbox").checked==true)
	{
		window.open("http://www.google.cn/search?q="+ result +"&ie=gb2312&oe=gb2312&hl=zh-CN");
		return false;
	}
	else
	{
		if(result!="")
		{
			window.open("../IndexSreach.asp?result="+result);
			return false;
		}
		
	}	
}
function logo()
{
	document.logoform.submit();	
}

  var changeOffset = new Date().getTimezoneOffset()/60*-1;
  
  function urlindex()
  {
  window.location.href="../index.asp";
  }
 function setTime() {
	  today   =   new   Date();   
      intYear=today.getYear();   
      intMonth=today.getMonth();   
      intDate=today.getDate();   
      intHours   =   today.getHours();   
      intMinutes   =   today.getMinutes();   
      intSeconds   =   today.getSeconds();   
      curYear=intYear+"-";   
      curMonth=intMonth+1+"-";   
      curDate=intDate+" ";   
      if   (intHours   ==   0)   
          {   
            hours   =   "12:";   
            xfile   =   "PM ";   
          }   
      else   
      if   (intHours   <   12)   
          {   
            hours   =   intHours+":";   
            xfile   =   "AM ";   
          }   
      else   
      if   (intHours   ==   12)   
          {   
            hours   =   "12:";   
            xfile   =   "PM ";   
          }   
      else   
          {   
            intHours   =   intHours   -   12   
            hours   =   intHours   +   ":";   
            xfile   =   "PM ";   
          }   
      if   (intMinutes   <   10)   
          {   
            minutes   =   "0"+intMinutes+":";   
          }   
      else   
          {   
            minutes   =   intMinutes+":";   
          }   
      if   (intSeconds   <   10)   
          {   
            seconds   =   "0"+intSeconds+"   ";   
          }   
      else   
          {   
            seconds   =   intSeconds+"   ";   
          }   
		timeString=curYear+curMonth+curDate+hours+minutes+seconds+xfile;   
  var dateTimeString = timeString;// parse到日期对象中
  var dateTimeObject = new Date(timeString);
 
  // 得到本地(系统)时区s
  var timezoneOffset = new Date().getTimezoneOffset()/60*-1;
  	var worldtime = new Array()
	worldtime[0]="亚述尔群岛,-2";
	worldtime[1]="巴格达&nbsp;,3";
	worldtime[2]="北京&nbsp;&nbsp;,8";
	worldtime[3]="柏林&nbsp;&nbsp;,2";
	worldtime[4]="亚尔河&nbsp;,-3";
	worldtime[5]="芝加哥&nbsp;,-6";
	worldtime[6]="丹佛&nbsp;&nbsp;,-7";
	worldtime[7]="香港&nbsp;&nbsp;,8";
	worldtime[8]="夏威夷&nbsp;,-10";
	worldtime[9]="约翰内斯堡,2";
	worldtime[10]="开罗&nbsp;&nbsp;,2";
	worldtime[11]="利马&nbsp;&nbsp;,-5";
	worldtime[12]="伦敦&nbsp;&nbsp;,0";
	worldtime[13]="墨西哥城,-6";
	worldtime[14]="莫斯科&nbsp;,3";
	worldtime[15]="纽约&nbsp;&nbsp;,-5";
	worldtime[16]="巴黎&nbsp;&nbsp;,1";
	worldtime[17]="北京&nbsp;&nbsp;,8";
	worldtime[18]="Rio de J ,-3";
	worldtime[19]="旧金山&nbsp;,-8";
	worldtime[20]="悉尼&nbsp;&nbsp;,11";
	worldtime[21]="东京&nbsp;&nbsp;,9";
	worldtime[22]="伊斯兰堡,5";
	worldtime[23]="孟买&nbsp;&nbsp;,5.5";
	worldtime[24]="加德满都,5.75";
	worldtime[25]="曼谷&nbsp;&nbsp;,7";
	worldtime[26]="仰光&nbsp;&nbsp;,6.5";
	worldtime[27]="霍巴加&nbsp;,10";
	worldtime[28]="中途岛&nbsp;,-11";
	for (i=0;i<=worldtime.length-1;i++) 
	{
		var thisplace=worldtime[i].split(",");	
		if(eval(thisplace[1])==eval(timezoneOffset))
		{
			var Localname=thisplace[0];
		    footset=timezoneOffset;
		}
	}
	 document.getElementById("htmer_time").innerHTML="当前时区："+Localname+" "+dateTimeString; //+timezoneOffset
	 
    }
	
    setInterval(setTime,1000);
function addurl(articleid,classid)
{
	var custag=document.getElementById("custag").value;
	if  (custag=="")
	{
		alert("请输入自定义标签内容！")
		return false;
		
	}
	else
	{
		window.location.href="newsdetail.asp?articleid="+articleid+"&classid="+classid+"&custag="+custag;
	
	}

}


function downurl(classid)
{
//alert(classid);
window.location.href="download.asp?classid="+classid;
}





function site()
{
	var homesites=document.getElementById("home").value;
	//alert (homesites);
	window.open(homesites);
}

function contacts()
{
	var contacts=document.getElementById("contact").value;
	//alert(contacts);
	var iWidth=550; //窗口宽度
	var iHeight=230;//窗口高度
	var iTop=(window.screen.height-iHeight)/2;
	var iLeft=(window.screen.width-iWidth)/2;
	var url="allweb_nc.asp?url="+contacts;
	window.open(url,"new","Scrollbars=yes,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left=0"); 
	
}

function Urlchat(urlpath)
{
	//alert(contacts);
	var iWidth=565; //窗口宽度
	var iHeight=520;//窗口高度
	var iTop=(window.screen.height-iHeight)/2;
	var iLeft=(window.screen.width-iWidth)/2;
	var url=urlpath;
	window.open(url,"new","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft); 
	
}

function tag()
{
	//var tag=document.getElementById("contact").value;
	var iWidth=550; //窗口宽度
	var iHeight=130;//窗口高度
	var iTop=(window.screen.height-iHeight)/2;
	var iLeft=(window.screen.width-iWidth)/2;
	var url="repository_nc.asp";
	window.open(url,"new","Scrollbars=yes,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left=0"); 
	
}

function correctPNG()  
{ 
for(var i=0; i<document.images.length; i++) 
{ 
  var img = document.images[i] 
  var imgName = img.src.toUpperCase() 
  if (imgName.substring(imgName.length-3, imgName.length) == "PNG") 
  { 
   var imgID = (img.id) ? "id='" + img.id + "' " : "" 
   var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
   var imgStyle = "display:inline-block;" + img.style.cssText  
   if (img.align == "left") imgStyle = "float:left;" + imgStyle 
   if (img.align == "right") imgStyle = "float:right;" + imgStyle 
   if (img.parentElement.href) imgStyle = "cursor:pointer;" + imgStyle   
   var strNewHTML = "<span " + imgID + imgClass + imgTitle 
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 
   + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"  
   img.outerHTML = strNewHTML 
   i = i-1 
  } 
} 
} 
if(navigator.userAgent.indexOf("MSIE")>-1) 
{ 
window.attachEvent("onload", correctPNG); 
}; 
