// JScript 文件
function ShowEditMenu(e)
{
  var menuHtml="<ul id=\"EditMenu\">";
  menuHtml+="<li><a href=\"../../Manage/Shop_Setup.aspx\" target=\"_blank\">店铺设置</a></li>";
  menuHtml+="<li><a href=\"../../Manage/Shop_Product_Category.aspx\" target=\"_blank\">店铺分类</a></li>";
  menuHtml+="<li><a href=\"../../Manage/Shop_Product_Recommend.aspx\" target=\"_blank\">店铺推荐</a></li>";
  menuHtml+="<li><a href=\"../../Manage/Shop_Friend_Link.aspx\" target=\"_blank\">友情链接</a></li>";
  menuHtml+="<li><a href=\"../../Manage/Shop_Leave_Message.aspx\" target=\"_blank\">店铺留言</a></li>";
  menuHtml+="<li><a href=\"../../Manage/Shop_Style.aspx\" target=\"_blank\">店铺风格</a></li>";
  menuHtml+="</ul>";
  var menuObj=document.getElementById("ShopEditLinkDiv");
  if(menuObj!=null)
  {
     menuObj.innerHTML=menuHtml;         
     menuObj.style.display = "block"; 
     var showDiv=e.target||e.srcElement;
     var pos=getPosXY(showDiv,[-50,15]);     
     menuObj.style.left=pos[0]+'px';
	 menuObj.style.top=pos[1]+'px';

  }


}
 function ShowLeaveMesage(action,e)
  {
   
    var LeaveMessageObj=document.getElementById('ShowLeaveMesageDiv');
    if(LeaveMessageObj!=null)
    {
       switch(action)
       {
          case "display":
             LeaveMessageObj.style.display="";    
             var showDiv=e.target||e.srcElement;
             var pos=getPosXY(showDiv,[-50,-220]);     
             LeaveMessageObj.style.left=pos[0]+'px';
		     LeaveMessageObj.style.top=pos[1]+'px';
             break;
          case "close":
             LeaveMessageObj.style.display="none";
             break;
          
       }
       
       
    }
  }
  
  function getPosXY(a,offset)
  {
    var tn=null;
	var p=offset?offset.slice(0):[0,0];
	while(a)
	{
		tn=a.tagName.toUpperCase();
		
		p[0]+=a.offsetLeft-(tn=="DIV"&&a.scrollLeft?a.scrollLeft:0);
		p[1]+=a.offsetTop-(tn=="DIV"&&a.scrollTop?a.scrollTop:0);
		if(tn=="BODY")
		   break;
		a=a.offsetParent;
	}
	
	return p;
  }


