var loginStatus = "";

function OpenWindow(theURL,winName, sbars, stat, mtop, mleft, wsize, hsize) 
{
	window.open(theURL,winName,"scrollbars="+sbars+", status="+stat+",top="+mtop+",left="+mleft+",width="+wsize+",height="+hsize+"");
}


function fnLayerPopClose(callfunc)
{
	parent.document.all.backDiv.style.display = 'none';
	parent.document.all.layerDiv.style.display = 'none';
	parent.document.all.layerPop.style.display = 'none';
	parent.layerPop.location.href = "about:blank";
	
	if(callfunc != "" && callfunc != "undefined")
		parent.document.Main.SetVariable('callfunc', callfunc);
}


function fnLayerPopClose2()
{
	parent.document.all.backDiv2.style.display = 'none';
	parent.document.all.layerDiv2.style.display = 'none';
	parent.document.all.layerPop2.style.display = 'none';
	parent.layerPop2.location.href = "about:blank";
}


function fnLayerAllClose()
{
	document.all.backDiv.style.display = 'none';
	document.all.layerDiv.style.display = 'none';
	document.all.layerPop.style.display = 'none';
	document.all.backDiv2.style.display = 'none';
	document.all.layerDiv2.style.display = 'none';
	document.all.layerPop2.style.display = 'none';
	document.all.quickLayer.style.display = 'none';
	layerPop.location.href = "about:blank";
	layerPop2.location.href = "about:blank";
}


function fnLayerAllAlphaNo()
{
	document.all.backDiv.style.alpha = 0;
	document.all.layerDiv.style.alpha = 0;
	document.all.layerPop.style.alpha = 0;
	document.all.backDiv2.style.alpha = 0;
	document.all.layerDiv2.style.alpha = 0;
	document.all.layerPop2.style.alpha = 0;
	document.all.quickLayer.style.alpha = 0;
	layerPop.location.href = "about:blank";
	layerPop2.location.href = "about:blank";
}



function fnLayerAllAlphaYes()
{
	document.all.backDiv.style.alpha = 100;
	document.all.layerDiv.style.alpha = 100;
	document.all.layerPop.style.alpha = 100;
	document.all.backDiv2.style.alpha = 100;
	document.all.layerDiv2.style.alpha = 100;
	document.all.layerPop2.style.alpha = 100;
	document.all.quickLayer.style.alpha = 100;
	layerPop.location.href = "about:blank";
	layerPop2.location.href = "about:blank";
}




function fnLoginPop(kind, param)
{	
	
    var sUrl = "2008_mb/store/store_open.htm";
    
    if(param != undefined && param != null && param != "")
    	sUrl += "?" + param;
    
    var nwidth = 780;
    var nheight = 413;
    
	var LeftPosition;
	var TopPosition;
	
	var backObj;
	var layerObj;
	var layerFrmObj;
	var layerFrm;
	
	
	if(kind == "pop" || kind == "script")
	{
		LeftPosition = (document.body.clientWidth) ? (document.body.clientWidth-nwidth)/2 : 0;
		TopPosition = (document.body.clientHeight) ? ((document.body.clientHeight-nheight)/2) + 80 : 0;

		backObj = document.all.backDiv;
		layerObj = document.all.layerDiv;
		layerFrmObj = document.all.layerPop;
		layerFrm = layerPop;
	}
	else if(kind == "popmove")
	{
		LeftPosition = (parent.document.body.clientWidth) ? (parent.document.body.clientWidth-nwidth)/2 : 0;
		TopPosition = (parent.document.body.clientHeight) ? ((parent.document.body.clientHeight-nheight)/2) + 80 : 0;

		backObj = parent.document.all.backDiv;
		layerObj = parent.document.all.layerDiv;
		layerFrmObj = parent.document.all.layerPop;
		layerFrm = parent.layerPop;
		
	}
	else if(kind == "pop2" || kind == "pop2script")
	{
		LeftPosition = (parent.document.body.clientWidth) ? (parent.document.body.clientWidth-nwidth)/2 : 0;
		TopPosition = (parent.document.body.clientHeight) ? ((parent.document.body.clientHeight-nheight)/2) + 80 : 0;

		backObj = parent.document.all.backDiv2;
		layerObj = parent.document.all.layerDiv2;
		layerFrmObj = parent.document.all.layerPop2;
		layerFrm = parent.layerPop2;
	}

		backObj.style.display = "";
		layerObj.style.display = "";
		
		layerObj.style.width = nwidth;
		layerObj.style.height = nheight;
		layerObj.style.top = TopPosition-100;
		layerObj.style.left = LeftPosition;
		
		layerFrmObj.style.display = "";
		layerFrmObj.style.width = nwidth;
		layerFrmObj.style.height = nheight;
		layerFrm.location.href = sUrl;
}

function fnMemberJoinPop()
{
	fnLayerAllClose();
	
    var sUrl = "2008_mb/store/store.htm";
    
    var nwidth = 780;
    var nheight = 413;
    
	var LeftPosition = (document.body.clientWidth) ? (document.body.clientWidth-nwidth)/2 : 0;
	var TopPosition = (document.body.clientHeight) ? ((document.body.clientHeight-nheight)/2) : 0;
	
	document.all.layerDiv.style.display = "";
	
	document.all.layerDiv.style.width = nwidth;
	document.all.layerDiv.style.height = nheight;
	document.all.layerDiv.style.top = TopPosition;
	document.all.layerDiv.style.left = LeftPosition;
	
	document.all.layerPop.style.display = "";
	document.all.layerPop.style.width = nwidth;
	document.all.layerPop.style.height = nheight;
	layerPop.location.href = sUrl;
}



