//访问次数自增1
 function visitorNumAdd(url,siteId){
	var xmlhttp=false;
	if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.open("POST",url+"/webSite/site.do?actionMethod=doGetData&siteId="+siteId,true);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send("");
}
//取网站的访问量——————尾部
 function getVisitorNum(url,siteId,style){
	var xmlhttp=false;
	if(window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	}else{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
   			var obj =document.getElementById("footerDiv");
			var responseContext;
			responseContext = xmlhttp.responseText;
			var nodeStr="";
			for(var i=0;i<responseContext.length;i++){
				nodeStr+="<img src='"+url+"/images/visitorNum/"+style+"/"+responseContext.substring(i,i+1)+".gif' alt='' />";
			}
			obj.innerHTML = nodeStr;
		}
	}
	xmlhttp.open("POST",url+"/webSite/site.do?actionMethod=doGetDataList&siteId="+siteId,true);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send("");
}
  
//取网站的访问量__板块中
 function getVisitorNumById(url,siteId,style,model_id){
	var xmlhttp=false;
	if(window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	}else{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
   			var obj =document.getElementById(''+model_id);
			var responseContext;
			responseContext = xmlhttp.responseText;
			var nodeStr="";
			for(var i=0;i<responseContext.length;i++){
				nodeStr+="<img src='"+url+"/images/visitorNum/"+style+"/"+responseContext.substring(i,i+1)+".gif' alt='' />";
			}
			obj.innerHTML = nodeStr;
		}
	}
	xmlhttp.open("POST",url+"/webSite/site.do?actionMethod=doGetDataList&siteId="+siteId,true);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send("");
}
function submitFormjump(str,totleNum){
  var nums=totleNum;
  var content=document.getElementById("jump").value;
  var reg=/^[0-9]*$/;
  if(content==''){
	alert("请输入要跳转至第几页");
  }else if(!reg.test(content)){
	alert("只能输入数字");
  }else{
  	  if(str=="product_"||str=="news_"||str=="job_"||str=="supply_"||str=="file_"){
  	  	  if(content<=1){
		  	content='';
		  	str=str.split("_")[0];
		  }else if(content>=nums){
		  	if(nums==1){
		  		content='';
		  		str=str.split("_")[0];
		  	}else{
		  		content=nums;
		  	}
		  }
  	  }else{
	  	  if(content<=1){
		  	content=1;
		  }else if(content>=nums){
		  	if(nums==1){
		  		content=nums;
		  		str=str.split("_")[0];
		  	}else{
		  		content=nums;
		  	}
		  }
  	  }
	  window.location.href=""+str+content+".html";
  }
}
function enterListener(str,totleNum){
	if (event.keyCode == 13){
       	submitFormjump(str,totleNum);
   	}
}
function check(f){
	if(f.name.value=='')return false;
	f.submit();
}
