﻿
function echo(obj,html)
{
	$$(obj).innerHTML=html;
}
function fopen(obj)
{
	$$(obj).style.display="";
}
function fclose(obj)
{
	$$(obj).style.display="none";
}
function createxmlhttp()
{
	var xmlhttp=false;
	try	{
  		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} 
	catch (e) {
  		try {
   			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  		} 
		catch (e) {
   			xmlhttp = false;
 		}
 	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  		xmlhttp = new XMLHttpRequest();
				if (xmlhttp.overrideMimeType) {//设置MiME类别
			xmlhttp.overrideMimeType('text/xml');
		}
	}	

	return xmlhttp;	
}

function getdata(url,obj1,obj2)
{
		var xmlhttp=createxmlhttp();
		if(!xmlhttp)
		{
			alert("你的浏览器不支持XMLHTTP！！");
			return;
		}
		var  Digital=new  Date();
		Digital=Digital+40000;
		url=url+"&k="+Digital;
		xmlhttp.onreadystatechange=requestdata;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
		function requestdata()
		{
				fopen(obj1);
				echo(obj1,"正在加载数据，请稍等......");
				if(xmlhttp.readyState==4)
				{
					if(xmlhttp.status==200)
					{
						if(obj1!=obj2){fclose(obj1);};
						echo(obj2,xmlhttp.responseText);
						
					}
				}
			
		}
}

function showckbd(){
	var xmlhttp=createxmlhttp();
		if(!xmlhttp)
		{
			alert("你的浏览器不支持XMLHTTP！！");
			return;
		}
		var  Digital=new  Date();
		Digital=Digital+40000;
		url="../request.aspx?action=checklogin&k="+Digital;
		xmlhttp.onreadystatechange=requestdata;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
		function requestdata()
		{
			if(xmlhttp.readyState==4)
			{
				if(xmlhttp.status==200)
				{
					if(xmlhttp.responseText=="1"){
						delCookie("gotourl");
						setCookie("gotourl","../shop/ckbd.aspx");
						$$("mask").style.display='';
						Demo_login('<div align=center><iframe src="../member/register.aspx?action=login" scrolling="no" frameBorder=0 width=297 height=250></iframe></div>',298,250,298,250)
					}
					else{
						window.location.href="ckbd.aspx";	
					}
				}
			}
		}
}

function showwytg(val){
	window.location.href="../tuangou/zftg.aspx?a="+escape(val);	
	return false;
	var xmlhttp=createxmlhttp();
		if(!xmlhttp)
		{
			alert("你的浏览器不支持XMLHTTP！！");
			return;
		}
		var  Digital=new  Date();
		Digital=Digital+40000;
		url="../request.aspx?action=checklogin&k="+Digital;
		xmlhttp.onreadystatechange=requestdata;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
		function requestdata()
		{
			if(xmlhttp.readyState==4)
			{
				if(xmlhttp.status==200)
				{
					if(xmlhttp.responseText=="1"){
						delCookie("gotourl");
						setCookie("gotourl","../tuangou/zftg.aspx");
						$$("mask").style.display='';
						Demo_login('<div align=center><iframe src="../member/register.aspx?action=login" scrolling="no" frameBorder=0 width=297 height=250></iframe></div>',298,250,298,250)
					}
					else{
						window.location.href="../tuangou/zftg.aspx";	
					}
				}
			}
		}
}
function showindexwytg(){
	window.open("tuangou/zftg.aspx","_blank");	
	//return false;
	/*var xmlhttp=createxmlhttp();
		if(!xmlhttp)
		{
			alert("你的浏览器不支持XMLHTTP！！");
			return;
		}
		var  Digital=new  Date();
		Digital=Digital+40000;
		url="request.aspx?action=checklogin&k="+Digital;
		xmlhttp.onreadystatechange=requestdata;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
		function requestdata()
		{
			if(xmlhttp.readyState==4)
			{
				if(xmlhttp.status==200)
				{
					if(xmlhttp.responseText=="1"){
						delCookie("gotourl");
						setCookie("gotourl","../tuangou/zftg.aspx");
						$$("mask").style.display='';
						Demo_login('<div align=center><iframe src="member/register.aspx?action=login" scrolling="no" frameBorder=0 width=297 height=250></iframe></div>',298,250,298,250)
					}
					else{
						window.location.href="tuangou/zftg.aspx";	
					}
				}
			}
		}*/
}
function showorder(val){
	var xmlhttp=createxmlhttp();
		if(!xmlhttp)
		{
			alert("你的浏览器不支持XMLHTTP！！");
			return;
		}
		var  Digital=new  Date();
		Digital=Digital+40000;
		url="../request.aspx?action=checklogin&k="+Digital;
		xmlhttp.onreadystatechange=requestdata;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
		function requestdata()
		{
			if(xmlhttp.readyState==4)
			{
				if(xmlhttp.status==200)
				{
					
					if(xmlhttp.responseText=="1"){
						delCookie("gotourl");
						setCookie("gotourl","../order.aspx?id="+val+"");
						$$("mask").style.display='';
						//Demo_login('<div align=center><iframe src="../order.aspx?id='+val+'" scrolling="no" frameBorder=0 width=935 height=625></iframe></div>',935,625,935,625)
						Demo_login('<div align=center><iframe src="../member/register.aspx?action=login" scrolling="no" frameBorder=0 width=297 height=250></iframe></div>',298,250,298,250)
					}
					else{
						$$("mask").style.display='';
						Demo_login('<div align=center><iframe src="../order.aspx?id='+val+'" scrolling="no" frameBorder=0 width=935 height=591></iframe></div>',935,591,935,591)	
					}
				}
			}
		}
}
function showwybaoming(val){
	var xmlhttp=createxmlhttp();
		if(!xmlhttp)
		{
			alert("你的浏览器不支持XMLHTTP！！");
			return;
		}
		var  Digital=new  Date();
		Digital=Digital+40000;
		url="../request.aspx?action=checklogin&k="+Digital;
		xmlhttp.onreadystatechange=requestdata;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
		function requestdata()
		{
			if(xmlhttp.readyState==4)
			{
				if(xmlhttp.status==200)
				{
					if(xmlhttp.responseText=="1"){
						delCookie("gotourl");
						setCookie("gotourl","../baoming.aspx?activeid="+val);
						$$("mask").style.display='';
						Demo_login('<div align=center><iframe src="../member/register.aspx?action=login" scrolling="no" frameBorder=0 width=297 height=250></iframe></div>',298,250,298,250)
					}
					else{
						$$("mask").style.display='';
						Demo_login('<div align=center><iframe src="../baoming.aspx?activeid='+val+'" scrolling="no" frameBorder=0 width=935 height=570></iframe></div>',935,570,935,570)	
					}
				}
			}
		}
}


function showduihuan(val){
	$$("mask").style.display='';
	Demo_login('<div align=center><iframe src="duihuan.aspx?id='+val+'" scrolling="no" frameBorder=0 width=935 height=550></iframe></div>',935,550,935,550)
}




function Demo_login(string,ow,oh,w,h){
	 ShowDiv=string;
	 DialogShow(ShowDiv,ow,oh,w,h);	
	 var objDialog = document.getElementById("DialogMove");
	  var lstd = document.getElementById("lstd");
	 
}
function DialogShow(showdata,ow,oh,w,h){
	 var objDialog = document.getElementById("DialogMove");
	 if (!objDialog) 
	 objDialog = document.createElement("div");
	 t_DiglogW = ow;
	 t_DiglogH = oh;
	 DialogLoc();
	 objDialog.id = "DialogMove";
	 var oS = objDialog.style;
	 oS.display = "block";
	 oS.top = t_DiglogY + "px";	
	 oS.left = t_DiglogX + "px"; 
	 oS.margin = "0px";
	 oS.padding = "0px";
	 oS.width = w + "px";
	 oS.height = h + "px";
	 oS.position = "absolute";
	 oS.zIndex = "5";
	 oS.background = "#FFF";
	 oS.border = "solid #1A5189 1px";
	 objDialog.innerHTML = showdata;
	 document.body.appendChild(objDialog);
	 delselect();
}

function LoginHide()
{
	ScreenClean();
	var objDialog = document.getElementById("DialogMove");
	 if (objDialog)
	 {
		 objDialog.style.display = "none";
		 $$("mask").style.display='none';
	 }
}

function ScreenClean(){
	 var objScreen = document.getElementById("ScreenOver");
	 if (objScreen)
	 objScreen.style.display = "none";
	 var allselect = document.getElementsByTagName("select");
	 for (var i=0; i<allselect.length; i++) 
	 allselect[i].style.visibility = "visible";
}

function delselect(){
	var allselect = document.getElementsByTagName("select");
	 for (var i=0; i<allselect.length; i++) 
	 allselect[i].style.visibility = "hidden";	
}
function showselect(){
	var allselect = document.getElementsByTagName("select");
	 for (var i=0; i<allselect.length; i++) 
	 allselect[i].style.visibility = "visible";	
}
function ScreenConvert(str){
	 var browser = new Browser();
	 var objScreen = document.getElementById("ScreenOver");
	 if(!objScreen) 
	 var objScreen = document.createElement("div");
	 var oS = objScreen.style;
	 objScreen.id = "ScreenOver";
	 oS.display = "block";
	 oS.top = oS.left = oS.margin = oS.padding = "0px";
	 if (document.body.scrollHeight)	{
	 	if(document.body.scrollHeight>document.body.clientHeight){
	 		var wh = document.body.scrollHeight + "px";	
	 	}else{
	 		var wh = document.body.clientHeight + "px";
	 	}	 
	 }else if (window.innerHeight){
	 var wh = window.innerHeight + "px";
	 }else{
	 var wh = "100%";
	 }
	 oS.width = "100%";	 
	 oS.height = wh;
	 oS.position = "absolute";
	 oS.zIndex = "3";
	 if ((!browser.isSF) && (!browser.isOP)){
	 oS.background = "black";
	 }else{
	 oS.background = "black";
	 }
	 oS.filter = "alpha(opacity=50)";
	 oS.opacity = 40/100;
	 oS.MozOpacity = 40/100;
	 document.body.appendChild(objScreen);
	 var allselect = document.getElementsByTagName("select");
	 for (var i=0; i<allselect.length; i++) 
	 allselect[i].style.visibility = "hidden";
}

