﻿	var http_request=false;
	var http_requestb=false;
	var http_requestc=false;
	var mu;
	var chulib;
	var chulic;
	var zhankai=0;
	var faqc=20;

	var temp='Company News';
	var suptemp='Inks for Desktop Printers';
	var morenchang=10;
  function send_request(url){//初始化，指定处理函数，发送请求函数
  http_request=false;
  //初始化XMLHttprequest对象
  if(window.XMLHttpRequest){//Mozilla浏览器
  http_request=new XMLHttpRequest();
  if(http_request.overrideMimeType){//设置mime类别
  	http_request.overrideMimeType("text/xml");
	}
}
else if(window.ActiveXObject){//IE浏览器
	try{
		http_request=new ActiveXObject("Msxml2.XMLHTTP"); 
			}catch(e) { 
				try{
				http_request=new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e){}
			}
		}
		if(!http_request){//异常，创建实例对象失败
		window.alert("不能创建XMLHRequest对象");
		return false;
		}
		http_request.onreadystatechange=processRequest;
		//确认发送请求的方法和URL以及是否同步执行下段代码
		http_request.open("GET",url,true);
		http_request.send(null);
		return true;
		}
		//处理返回信息函数
		function processRequest(){
		if(http_request.readyState==4){//判断对象状态函数
			if(http_request.status==200){//信息已经返回成功，开始处理信息
				//alert(http_request.responseText);
				document.getElementById(ceshu).innerHTML=http_request.responseText;
				return; 
				} else{//页面不正常
					alert("您请求的页面有异常");
					}
				}
			}

			
function send_requestb(url){//初始化，指定处理函数，发送请求函数
  http_requestb=false;
  //初始化XMLHttprequest对象
  if(window.XMLHttpRequest){//Mozilla浏览器
  http_requestb=new XMLHttpRequest();
  if(http_requestb.overrideMimeType){//设置mime类别
  	http_requestb.overrideMimeType("text/xml");
	}
}
else if(window.ActiveXObject){//IE浏览器
	try{
		http_requestb=new ActiveXObject("Msxml2.XMLHTTP"); 
			}catch(e) { 
				try{
				http_requestb=new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e){}
			}
		}
		if(!http_requestb){//异常，创建实例对象失败
		window.alert("不能创建XMLHRequest对象");
		return false;
		}
		http_requestb.onreadystatechange=processRequestb;
		//确认发送请求的方法和URL以及是否同步执行下段代码
		http_requestb.open("GET",url,true);
		http_requestb.send(null);
		return true;
		}
		//处理返回信息函数
		function processRequestb(){
		if(http_requestb.readyState==4){//判断对象状态函数
			if(http_requestb.status==200){//信息已经返回成功，开始处理信息
				
				document.getElementById(ceshub).innerHTML=http_requestb.responseText;
				return; 
				} else{//页面不正常
					alert("您请求的页面有异常");
					}
				}
			}			

			
function send_requestc(url){//初始化，指定处理函数，发送请求函数
  http_requestc=false;
  //初始化XMLHttprequest对象
  if(window.XMLHttpRequest){//Mozilla浏览器
  http_requestc=new XMLHttpRequest();
  if(http_requestc.overrideMimeType){//设置mime类别
  	http_requestc.overrideMimeType("text/xml");
	}
}
else if(window.ActiveXObject){//IE浏览器
	try{
		http_requestc=new ActiveXObject("Msxml2.XMLHTTP"); 
			}catch(e) { 
				try{
				http_requestc=new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e){}
			}
		}
		if(!http_requestc){//异常，创建实例对象失败
		window.alert("不能创建XMLHRequest对象");
		return false;
		}
		http_requestc.onreadystatechange=processRequestc;
		//确认发送请求的方法和URL以及是否同步执行下段代码
		http_requestc.open("GET",url,true);
		http_requestc.send(null);
		return true;
		}
		//处理返回信息函数
		function processRequestc(){
		if(http_requestc.readyState==4){//判断对象状态函数
			if(http_requestc.status==200){//信息已经返回成功，开始处理信息
				
				document.getElementById(ceshuc).innerHTML=http_requestc.responseText;
				return; 
				} else{//页面不正常
					alert("您请求的页面有异常");
					}
				}
			}			

function getparastr(strname){//获取地址栏参数
   var hrefstr,pos,parastr,para,tempstr;
   hrefstr = window.location.href;
   pos = hrefstr.indexOf("?")
   parastr = hrefstr.substring(pos+1);
   para = parastr.split("&");
   tempstr="";
   for(i=0;i<para.length;i++)
   {
    tempstr = para[i];
    pos = tempstr.indexOf("=");
    if(tempstr.substring(0,pos) == strname)
    {
     return tempstr.substring(pos+1);
     }
   }
   return null;
  }			
			
function ceshi(jiedian,chuli,jieb){
	//alert(chuli);
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;
	if(jiedian=='g_n_l'){
		document.getElementById(jieb).innerHTML="请选择功能";
	}
	if(jieb=='shanlei'){
		if(!confirm("删除类别将同时删除所属子类以及其下的产品，是否继续删除")){
			return;
		}
	}
	if(jieb=='xiangxinxi'){
		
		document.getElementById(jieb).style.display = "";
		document.getElementById('fandaohang').style.display = "none";
		//document.getElementById('news_search').style.display = "none";
		
	}
	document.getElementById(jiedian).innerHTML="Please wait for";
	ceshu=jiedian;
	
	send_request(chulia);
	document.getElementById('ppp').innerHTML=zuoguang+zuoguang_xia;
	document.getElementById('ppp2').innerHTML=youguang+youguang_xia;
	//alert(zuoguang);
	 initAd("ppp","ppp2");
}

function cplie(jiedian,chuli,jieb,jiec){
	//alert(zhankai);
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;
	
	if(document.getElementById(jiec).style.display =="none"){
		document.getElementById(jieb).src="img/M1.gif";
				
		document.getElementById(jiec).style.display = "";
		
		document.getElementById(jiedian).innerHTML="Please wait for";
		ceshu=jiedian;
		send_request(chulia);
	}else	if(document.getElementById(jiec).style.display ==""){
		document.getElementById(jieb).src="img/P1.gif";
		document.getElementById(jiec).style.display = "none";
	}
	
	 
}

function zeng(jiedian,chuli,jieb){
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;

	ceshu=jieb;
	send_request(chulia);
		
}

function cesou(jiedian,mubiao){
 mu=mubiao;
//alert(mubiao);
ceshi(jiedian,'zongc.php?set=0&chang='+morenchang+'&mubiao='+mubiao);
/*
document.getElementById(jiedian).innerHTML="<div class='xw_tj1' id='xinwen'></div><div class='xw_tj1' id='chanpin'></div><div class='zhanwei'></div><div class='xw_tj1' id='zhichi'></div><div class='xw_tj1' id='faq'></div>";
ceshi('xinwen','chaliebiao.php?biao=e_xinwen&shuaxin=xinwen&set=0&chang='+morenchang+'&mubiao='+mubiao);
setTimeout('ceshi(\'chanpin\',\'chaliebiao.php?biao=e_chanpin&shuaxin=chanpin&set=0&chang=\'+morenchang+\'&mubiao=\'+mu)',400);
//ceshi('chanpin','chaliebiao.php?biao=e_chanpin&shuaxin=chanpin&set=0&chang=8&mubiao='+mubiao);	
setTimeout("ceshi('zhichi','chaliebiao.php?biao=e_jishu&shuaxin=zhichi&set=0&chang=\'+morenchang+\'&mubiao='+mu);",800);
setTimeout("ceshi('faq','chaliebiao.php?biao=e_wenti&shuaxin=faq&set=0&chang=\'+morenchang+\'&mubiao='+mu)",1000);
//ceshi('faq','chaliebiao.php?biao=e_wenti&shuaxin=faq&set=0&chang=8&mubiao='+mu);
*/ 
}
function waidiao(jie,chuli,jieb,chu){
	//alert(chu);
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;
	chulib=chu+'&meigaocuo='+aaa;
	
	document.getElementById(jie).innerHTML="Please wait for";
	ceshu=jie;
	send_request(chulia);
	ceshub=jieb;
	
	setTimeout('send_requestb(chulib)',200);
	 
}

function waidiaob(jie,chuli,jieb,chu,jiec,chu2){
	//alert(chu);
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;
	chulib=chu+'&meigaocuo='+aaa;
	chulic=chu2+'&meigaocuo='+aaa;
		
	document.getElementById(jie).innerHTML="Please wait for";
	
	ceshu=jie;
	send_request(chulia);
	
	ceshub=jieb;
	setTimeout('send_requestb(chulib)',200);

	ceshuc=jiec
	setTimeout('send_requestc(chulic)',400);
	 
}

function closexinxi(a){
	//alert(a);
	document.getElementById(a).style.display = "none";
	document.getElementById('fandaohang').style.display = "";
	//document.getElementById('news_search').style.display = "";
}
function closexinxiz(a){
	//alert(a);
	document.getElementById(a).style.display = "none";
	document.getElementById('e_xinwen').style.display = "";
	document.getElementById('e_chanpin').style.display = "";
	document.getElementById('e_wenti').style.display = "";
	
}
function faq(a){
	//alert(a);
	if(document.getElementById(a).style.display =="none"){
		
		document.getElementById(a).style.display =""
	}else if(document.getElementById(a).style.display ==""){
		document.getElementById(a).style.display ="none"
	}
}

function ceshou(jiedian,chuli,jieb){
	//alert(chuli);
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;
	if(jiedian=='g_n_l'){
		document.getElementById(jieb).innerHTML="请选择功能";
	}
	if(jieb=='shanlei'){
		if(!confirm("删除类别将同时删除所属子类以及其下的产品，是否继续删除")){
			return;
		}
	}
	if(jieb=='xiangxinxi'){
		
		document.getElementById(jieb).style.display = "";
		
	}
	document.getElementById(jiedian).innerHTML="Please wait for";
	ceshu=jiedian;
	
	send_request(chulia);
	 
}

function ceshiz(jiedian,chuli,jieb,a,b,c){
	//alert(chuli);
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;
	if(jiedian=='g_n_l'){
		document.getElementById(jieb).innerHTML="请选择功能";
	}
	if(jieb=='shanlei'){
		if(!confirm("删除类别将同时删除所属子类以及其下的产品，是否继续删除")){
			return;
		}
	}
	if(jieb=='xiangxinxi'){
		
		document.getElementById(jieb).style.display = "";
		document.getElementById(a).style.display = "none";
		document.getElementById(b).style.display = "none";
		document.getElementById(c).style.display = "none";
		
		
	}
	document.getElementById(jiedian).innerHTML="Please wait for";
	ceshu=jiedian;
	
	send_request(chulia);
	 
}

function ceshixp(jiedian,chuli){
	//alert(chuli);
	aaa=Math.floor(Math.random()*999);
	chulia=chuli+'&meigaocuo='+aaa;
	
	document.getElementById(jiedian).innerHTML="Please wait for";
	ceshu=jiedian;
	
	send_request(chulia);
	 
}

function about(a){
	//alert(a);
	switch (a) {
	case "about":
	document.getElementById('history').style.display ="none";
	document.getElementById('global').style.display ="none";
	document.getElementById('certification').style.display ="none";
	document.getElementById('business').style.display ="none";
	/*
	document.getElementById('abouta').style.background-color ="#8CCC33";
	document.getElementById('historya').style.background-color ="#003366";
	document.getElementById('globala').style.background-color ="#003366";
	document.getElementById('organizationa').style.background-color ="#003366";
	document.getElementById('distributorshipa').style.background-color ="#003366";
	*/
	break;
	case "history":
	document.getElementById('about').style.display ="none";
	document.getElementById('global').style.display ="none";
	document.getElementById('certification').style.display ="none";
	document.getElementById('business').style.display ="none";
	break;
	case "global":
	document.getElementById('history').style.display ="none";
	document.getElementById('about').style.display ="none";
	document.getElementById('certification').style.display ="none";
	document.getElementById('business').style.display ="none";
	break;
	case "certification":
	document.getElementById('history').style.display ="none";
	document.getElementById('global').style.display ="none";
	document.getElementById('about').style.display ="none";
	document.getElementById('business').style.display ="none";
	break;
	case "business":
	document.getElementById('history').style.display ="none";
	document.getElementById('global').style.display ="none";
	document.getElementById('certification').style.display ="none";
	document.getElementById('about').style.display ="none";
	break;
	}
	document.getElementById(a).style.display ="";

}


function initAd(a,b) {

document.getElementById(a).style.posTop = -100;

document.getElementById(a).style.visibility = 'visible'

document.getElementById(b).style.posTop = -100;

document.getElementById(b).style.visibility = 'visible'

MoveLayer(a,b);

}
function MoveLayer(a,b) {
var x = 0;
var y = 150;
var x2=900;
var diff = (document.body.scrollTop + y - document.getElementById(a).style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
document.getElementById(a).style.posTop = y;
document.getElementById(b).style.posTop = y;
document.getElementById(a).style.posLeft = x;

document.getElementById(b).style.posLeft = x2;
//eval("document.all." + a + ".style.posTop = y");
//document.getElementById(a).innerHTML=document.getElementById(a).innerHTML+"aa"
//alert(document.all.ppp.style.posTop);
setTimeout("MoveLayer('ppp','ppp2');", 20);
}

