function showpn(str)
{
	document.getElementById("diva01").style.visibility = "hidden";
    document.getElementById("diva02").style.visibility = "hidden";
	document.getElementById("diva03").style.visibility = "hidden";
	document.getElementById("diva04").style.visibility = "hidden";
    document.getElementById("a01").className="";
    document.getElementById("a02").className="";
	document.getElementById("a03").className="";
	document.getElementById("a04").className="";
	if (document.getElementById("a"+str)!=null)
	{
	   document.getElementById("a"+str).className="now";
       document.getElementById("diva"+str).style.visibility = "visible";
	}
}

function showpn2(str)
{
	document.getElementById("diva05").style.visibility = "hidden";
    document.getElementById("diva06").style.visibility = "hidden";
	document.getElementById("diva07").style.visibility = "hidden";
	document.getElementById("diva08").style.visibility = "hidden";
    document.getElementById("a05").className="";
    document.getElementById("a06").className="";
	document.getElementById("a07").className="";
	document.getElementById("a08").className="";
	if (document.getElementById("a"+str)!=null)
	{
	   document.getElementById("a"+str).className="now";
       document.getElementById("diva"+str).style.visibility = "visible";
	}
}

function move(str)
{
	if (imgw<=550) return;
	
	if (str=="left")
	{
		if (tmpc + imgw <550) return;		
		tmpc -= 110;
		
	}
	else if (str=="right")
	{
	   if (tmpc==0) return;	   
       tmpc +=110;
	}
	$("#idiv").animate({left:tmpc+"px"},"slow");
}

function chanageUrl(url)
{
   document.getElementById ("bigimg").src = url;
}

function dataupdate()
{
   $.get("/aspx/dataupdate.aspx");
}

function ShowYZ()
	{
	  document .getElementById ("yzm").value="";
	  document .getElementById ("yzm").style.color="#000";
	  document.getElementById("imgyzm").src = "/aspx/netcode.aspx?id="+ new Date ().getSeconds();
	}

function dingdan()
{
   fResize("dataload");
   $.post("/aspx/dingdan.aspx",{xl:$("#xianlu").val(),ctime:$("#ctime").val(),denji:$("#denji").val(),name:$("#name").val(),address:$("#address").val(),shenfen:$("#shenfen").val(),email:$("#email").val(),tel:$("#tel").val(),ren01:$("#ren01").val(),ren02:$("#ren02").val(),ren03:$("#ren03").val(),ren04:$("#ren04").val(),ren05:$("#ren05").val(),zhu01:$("#zhu01").val(),zhu02:$("#zhu02").val(),zhu03:$("#zhu03").val(),zhu04:$("#zhu04").val(),memo:$("#memo").val(),yzm:$("#yzm").val()},
	   function(data){
	    if (data=="1000")
	      {
	        alert("订单提交成功，我们稍后会和您联系!");	  
	        location .href=location ;      
	      }
	      else 
	      {
	         alert(data);
	         divclose ("dataload");	
	      }
	   });	   
}

function liuyan()
{
   fResize("dataload");
   $.post("/aspx/liuyan.aspx",{name:$("#name").val(),tel:$("#tel").val(),memo:$("#memo").val()},
	   function(data){
	    if (data=="1000")
	      {
	        alert("留言提交成功!");	  
	        location .href=location ;      
	      }
	      else 
	      {
	         alert(data);
	         divclose ("dataload");	
	      }
	   });	   
}

function divclose(str)
{
   if (document.getElementById(str)!=null)
   {
      document.getElementById(str).style.visibility = "hidden";
      document.getElementById("mask").style.visibility = "hidden"
   }
}

function fGetPageSize(){
		var xScroll, yScroll, windowWidth, windowHeight;
		if (window.innerHeight && window.scrollMaxY){
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		}
		else if(document.body.scrollHeight > document.body.offsetHeight){
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		}
		else {
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		if(self.innerHeight){
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		}
		else if(document.documentElement && document.documentElement.clientHeight){
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		}
		else if(document.body){
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}

		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		}
		else{
			pageHeight = yScroll;
		}

		if(xScroll < windowWidth){
			pageWidth = windowWidth;
		}
		else {
			pageWidth = xScroll;
		}
		arrayPageSize = {width : parseInt(pageWidth, 10), height : parseInt(pageHeight, 10)};//new Array(pageWidth,pageHeight,windowWidth,windowHeight)
		return arrayPageSize;
	}
	
function fResize(str)
{
	//alert("a");
		var oMask = document.getElementById("mask"),
			oSize;
		oSize = fGetPageSize();
		
		oMask.style.width = "100%";//oSize.width + "px";
		oMask.style.height = oSize.height + "px";
		oMask.style.visibility="visible";


		if (document.getElementById("dataload")!=null && str=="dataload")
		{
		   var tmpw = document.getElementById("dataload").style.width;		   		   
		   if (tmpw.length>0)
		   {
		      tmpw = tmpw.replace("px","");
		   }
		   else 
		   {
		      tmpw = 200;
		   }
		   
           document.getElementById("dataload").style.left = Math.round((document.body.clientWidth - tmpw) / 2) + "px"; //遮罩里面的层的定位
		   document.getElementById("dataload").style.top = document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("dataload").offsetHeight)/2+"px";
		   document.getElementById("dataload").style.visibility="visible";
		}
}

