// JavaScript Document

function $(id)
{
    return document.getElementById(id);
}

function divop(objid,stat,num)//控制层的显示和隐藏(order过程的注册和登陆DIV)
{
//alert(objid);
if (stat=="show")
{
$(objid).style.display="block";
$(objid).style.left=(num*530)+"px";//
$(objid).style.top=(num*450)+"px";
}
else
{
$(objid).style.display="none";

}
}


function divop2(objid,stat,num)//控制层的显示和隐藏(member过程的修改邮寄信息DIV)
{
//alert(objid);
if (stat=="show")
{
$(objid).style.display="block";
$(objid).style.left=(num*450)+"px";//
$(objid).style.top=(num*330)+"px";
}
else
{
$(objid).style.display="none";

}
}



//控制层拖动开始
var drag_=false
var D=new Function('obj','return document.getElementById(obj);')
var oevent=new Function('e','if (!e) e = window.event;return e')
function Move_obj(obj){
 var x,y;
 D(obj).onmousedown=function(e){
  drag_=true;
  with(this){
   style.position="absolute";
   var temp1=offsetLeft;
   var temp2=offsetTop;
   x=oevent(e).clientX;
   y=oevent(e).clientY;
   document.onmousemove=function(e){
    if(!drag_)return false;
    with(this){
     style.left=temp1+oevent(e).clientX-x+"px";
     style.top=temp2+oevent(e).clientY-y+"px";
    }
   }
  }
  document.onmouseup=new Function("drag_=false");
 }
}

//以上控制层拖动结束

function cookiesave(n, v, mins, dn, path)
{
    if(n)
    {
		
	    if(!mins) mins = 365 * 24 * 60;
		if(!path) path = "/";
	    var date = new Date();
		
	    date.setTime(date.getTime() + (mins * 60 * 1000));
		
	    var expires = "; expires=" + date.toGMTString();
		
	    if(dn) dn = "domain=" + dn + "; ";
	    document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
    }
}
function cookieget(n)
{
    var name = n + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
	}
	return "";
}
function closeclick(){
	document.getElementById('topp').style.display='none';
	cookiesave('closeclick','closeclick','5','','');  //COOKIE 5分钟后过期
}
function clickclose(){
	if(cookieget('closeclick')=='closeclick'){
		document.getElementById('topp').style.display='none';
	}else{
		document.getElementById('topp').style.display='block';
	}
}
window.onload=clickclose;

//以上层关闭后即使刷新也不显示











