﻿// JScript File

var sCN="cookieTest";
var dt=new Date();
dt.setSeconds(dt.getSeconds()+2);document.cookie=sCN+"=1; expires="+dt.toGMTString();
var cookiesEnabled=document.cookie.indexOf(sCN+"=")!=-1;
if(cookiesEnabled==false)
{
   document.location.href = "CookieError.htm";
}


function ShowCenterObject(id)
{
        var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        var clientWidth;
        if (window.innerWidth) {
            clientWidth = ((Sys.Browser.agent === Sys.Browser.Safari) ? window.innerWidth : Math.min(window.innerWidth, 

document.documentElement.clientWidth));
        } else {
            clientWidth = document.documentElement.clientWidth;
        }
        var clientHeight;
        if (window.innerHeight) {
            clientHeight = ((Sys.Browser.agent === Sys.Browser.Safari) ? window.innerHeight : Math.min(window.innerHeight, 

document.documentElement.clientHeight));
        } else {
            clientHeight = document.documentElement.clientHeight;
        }
        var ShowObject=document.getElementById(id);
        ShowObject.style.position = 'absolute';
        ShowObject.style.zIndex=9999;
        ShowObject.style.display='block';
	
        ShowObject.style.left = scrollLeft+((clientWidth-ShowObject.offsetWidth)/2)+'px';
        ShowObject.style.top = scrollTop+((clientHeight-ShowObject.offsetHeight)/2)+'px';
        DivSetVisible(ShowObject);
        
}






function DivSetVisible(DivRef)
{
var IfrRef = document.getElementById('DivShim');
if(IfrRef==null)
{
    return;
}
IfrRef.style.width = DivRef.offsetWidth;
IfrRef.style.height = DivRef.offsetHeight;
DivRef.style.zIndex=999;
IfrRef.style.zIndex = DivRef.style.zIndex - 1;
IfrRef.style.display = DivRef.style.display;
IfrRef.style.top = DivRef.offsetTop;
IfrRef.style.left = DivRef.offsetLeft;
}

function HiddenDivShim()
{
    var IfrRef = document.getElementById('DivShim');
    if(IfrRef==null)
    {
        return;
    }
    IfrRef.style.display='none';
}


//Category List JS Createy Jack 
//Category List begin
//**********************************************************//

function menuFix() {
if(document.getElementById("nav")==null)
{
	return;
}
var uls = document.getElementById("nav").getElementsByTagName("ul");
for (var i=0; i<uls.length; i++) {
	uls[i].className="HiddenUL";
}


var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
	var objul=this.getElementsByTagName("ul");
	for (var ii=0; ii<objul.length; ii++) {

	objul[ii].className="ShowMenu";
	//alert(objul[ii].className);
	objul[ii].onmouseover=function()
	{
		this.className="ShowMenu";
	}
	
	}
}

sfEls[i].onmouseout=function() {
	var objul=this.getElementsByTagName("ul");
	for (var ii=0; ii<objul.length; ii++) {
	objul[ii].className="HiddenUL";
	objul[ii].onmouseout=function()
	{
		this.className="HiddenUL";
	}
	}
}
}
}
//if (window.attachEvent) window.attachEvent("onload", menuFix);




sfHover = function() {
    if(document.getElementById("nav")==null)
    {
        return;
    }
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//**********************************************************//
//Category List End



//**********************************************************//
//MianMeau JS Begin

// JavaScript Document
if (typeof Scl == "undefined")
{
    var Scl = {};
}

(function()
{
    Scl.MenuItem = function(text, link, cssClass)
    {
        this.text = text;
        this.link = link;
        this.cssClass = cssClass;
    };

    Scl.Menu = function(menuWidth)
    {
        var instance = this;
        var menuDiv;
        var menuItems = new Array();
        var dockElement;
        var left = 0;
        var top = 0;
        var width = menuWidth ? menuWidth : 200;
        var height = 0;
        var hideThread;
        var fullVisible = false;
        var animationThread;
        var animationStart = 0;
        var animationEnd = 0;
        var ANIMATION_NONE = 0;
        var ANIMATION_VERTICAL = 1;
        this.animationType = ANIMATION_VERTICAL;
        this.animationSpeed = 10;
        this.animationStep = 15;
        this.margin = 10;
        this.menuCssClass = 'menu';
        this.menuItemCssClass = 'menuItem';
        this.rightToLeft = false;
        this.bottomToTop = false;
        this.hideTimeOut = 120;

        this.addItem = function(text, link, cssClass)
        {
            menuItems.push(new Scl.MenuItem(text, link, cssClass));
        };

        this.dockTo = function(element)
        {
		
            addEvent(window, 'load', function(){ dockToElement(element); }, false);
        };

        this.showAt = function(element)
        {
            initialize();

            var position = getPosition(element);
            position.y += (instance.bottomToTop) ? (height + instance.margin) * -1 : instance.margin + element.offsetHeight;

            show(position.x, position.y);
        };

        this.showAtPosition = function(x, y)
        {
            initialize();
            show(x, y);
        };

        this.hide = function()
        {
            hideThread = setTimeout(hideMenu, instance.hideTimeOut);
        };

        function dockToElement(element)
        {
            if(typeof(element) == 'string')
            {
                element = document.getElementById(element);
            }

	    if(element == null)
            {
		return;
	    }
            dockElement = element;
            addEvent(element, 'mouseover', showAtDockElement, false);
            addEvent(element, 'mouseout', instance.hide, false);
        };

        function showAtDockElement()
        {
            instance.showAt(dockElement);
        };

        function initialize()
        {
            if(menuDiv == null)
            {
                createMenu();
            }
        };

        function show(x, y)
        {
            cancelHide();

            menuDiv.style.left = x + 'px';
            menuDiv.style.top = y + 'px';

            // Asignar para la animacion
            left = x;
            top = y;

            switch(instance.animationType)
            {
                case ANIMATION_NONE:
                    menuDiv.style.display = 'block';
                    break;

                default:
                    startAnimation(0, height);
                    break;
            }
        };

        function createMenu()
        {
            menuDiv = document.createElement('div');
            menuDiv.style.position = 'absolute';

            var innerDiv = document.createElement('div');
            menuDiv.appendChild(innerDiv);

            innerDiv.className = instance.menuCssClass;
            innerDiv.style.width = width + 'px';

            addEvent(menuDiv, 'mouseover', cancelHide, false);
            addEvent(menuDiv, 'mouseout', instance.hide, false);

            // Add items
            for(var i=0; i< menuItems.length; i++)
            {
                var menuItemDiv = createMenuItem(menuItems[i]);
                innerDiv.appendChild(menuItemDiv);
            }

            // Add to the document
            document.body.appendChild(menuDiv);

            height = menuDiv.offsetHeight;
        };

        function createMenuItem(menuItem)
        {
            var menuItemDiv = document.createElement('div');
            menuItemDiv.className = menuItem.cssClass != null ? menuItem.cssClass : instance.menuItemCssClass;

            if(menuItem.link != null)
            {
                menuItemDiv.link = menuItem.link; // Crear la propiedad con el link para cada elemento
                menuItemDiv.onclick = function(){ window.location = menuItem.link; };
                var link = document.createElement('a');
                link.setAttribute('href', menuItem.link);
                link.appendChild(document.createTextNode(menuItem.text));
                menuItemDiv.appendChild(link);
            }

            return menuItemDiv;
        };

        function cancelHide()
        {
            clearTimeout(hideThread);
            hideThread = null;
        };

        function hideMenu()
        {
            switch(instance.animationType)
            {
                case ANIMATION_NONE:
                    menuDiv.style.display = 'none';
                    break;

                default:
                    startAnimation(parseStyle(menuDiv.style.height), 0);
                    break;
            }
        };

        function parseStyle(value)
        {
            return parseInt(value.substring(0, value.length-2));
        };

        function getPosition(element)
        {
            var posx = 0;
            var posy = 0;

            if (element.offsetParent)
            {
                do
                {
                    posx += element.offsetLeft;
                    posy += element.offsetTop;

                    if (!element.offsetParent)
                    {
                         break;
                    }
                }
                while (element = element.offsetParent)
            }
            else if (element.x)
            {
                posx += element.x;
                posy += element.y;
            }

            return {x:posx, y:posy};
        };

        function addEvent(element, evType, functionName, useCapture)
        {
            if(element.addEventListener)
            {
                element.addEventListener(evType, functionName, useCapture);
            }
            else if(element.attachEvent)
            {
                element.attachEvent('on' + evType , functionName);
            }
            else
            {
                element['on' + evType] = functionName;
            }
        };

        function startAnimation(start, end)
        {
            var showing = end > start;

            if(showing & fullVisible)
            {
                return;
            }

            menuDiv.style.zIndex = showing ? 20 : 1;

            animationStart = start;
            animationEnd = end;
            menuDiv.style.overflow = 'hidden';
            menuDiv.style.display = 'block';
            menuDiv.style.height = animationStart + 'px';

            fullVisible = false;

            clearInterval(animationThread);

            switch(instance.animationType)
            {
                case ANIMATION_VERTICAL:
                    if(instance.bottomToTop)
                    {
                        menuDiv.style.top = (top + height - menuDiv.offsetHeight) + 'px';
                    }
                    animationThread = setInterval(animateVertical, instance.animationSpeed);
                    break;
            }
        };

        function animateVertical()
        {
            var showing = animationEnd > animationStart;

            var strHeight = menuDiv.style.height;
            var animationHeight = parseInt(strHeight.substring(0, strHeight.length-2));

            if((showing & animationHeight >= animationEnd) || (!showing & animationHeight <= animationEnd))
            {
                clearInterval(animationThread);

                if(showing)
                {
                    fullVisible = true;
                }
                else
                {
                    menuDiv.style.display = 'none';
                }
            }
            else
            {
                animationHeight += showing ? instance.animationStep : -instance.animationStep;

                if((showing & animationHeight > animationEnd) || (!showing & animationHeight < animationEnd))
                {
                    animationHeight = animationEnd;
                }

                menuDiv.style.height = animationHeight + 'px';

                if(instance.bottomToTop)
                {
                    menuDiv.style.top = (top + height - animationHeight) + 'px';
                }
            }
        };
    };
})();




//**********************************************************//
//MianMeau JS End
//Lee
function CorrectQty(obj)
{
    var value=obj.value;
    for(var i=0;i<value.length;i++)
    {
        var charValue = value.charAt(i);
        if(charValue >=0 && charValue <=9)
        {}
        else
        {
            value=value.replace(charValue,'');
            obj.value=value;
            i=-1;
        }
    }
}

function CheckQty(obj,id)
{ 
    CorrectQty(obj);
   document.getElementById(id).checked = (obj.value.length > 0);
}

var cuID='';
function DisPlayDiv(id)
{
    if(cuID!='')
    {
        document.getElementById(cuID).style.display='none';
    }
    ShowCenterObject(id);
  
    cuID=id;
    
  //  ShowBackGroundDiv();
    if (window.attachEvent) window.attachEvent("onload", ShowBackGroundDiv);
}
var focusTXT='';
function SetfocusTXT(id)
{
    if(document.getElementById(id) != null)
    {
        if(focusTXT=='miss')
        {
            focusTXT=id;
            document.getElementById(focusTXT).focus();
        }
        else
        {
            focusTXT=id;
        }
    }
}
function DisPlayDivAndLocation(id,position)
{
    if(cuID!='')
    {
        document.getElementById(cuID).style.display='none';
    }
    ShowDivInRight(id);
    
    cuID=id;
    if(focusTXT!='')
    {
    window.location=position;
    }
    if(focusTXT!='' && focusTXT != 'miss')
    {
        document.getElementById(focusTXT).focus();
    }
    else
    {
        focusTXT='miss';
    }
}

function ShowDivInRight(id)
{
        var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        var clientWidth;
        if (window.innerWidth) {
            clientWidth = ((Sys.Browser.agent === Sys.Browser.Safari) ? window.innerWidth : Math.min(window.innerWidth, 

document.documentElement.clientWidth));
        } else {
            clientWidth = document.documentElement.clientWidth;
        }
        var clientHeight;
        if (window.innerHeight) {
            clientHeight = ((Sys.Browser.agent === Sys.Browser.Safari) ? window.innerHeight : Math.min(window.innerHeight, 

document.documentElement.clientHeight));
        } else {
            clientHeight = document.documentElement.clientHeight;
        }
        var ShowObject=document.getElementById(id);
        ShowObject.style.position = 'absolute';
        ShowObject.style.zIndex=9999;
        ShowObject.style.display='block';
	
        ShowObject.style.left = scrollLeft+((clientWidth-ShowObject.offsetWidth)/1.3)+'px';
       // ShowObject.style.top = scrollTop+((clientHeight-ShowObject.offsetHeight))+'px';
        
        DivSetVisible(ShowObject);
}


function CloseDiv(id)
{
    document.getElementById(id).style.display='none';
    HiddenDivShim();
    HiddenBackGroundDiv();
    

} 
//add by bob   if close div ,so clear dropdownlist value
function closedivcleardrp()
{
    
    var v=document.getElementById("hid_drp").value;
    //document.getElementById(v).selectedIndex = 0;
    document.getElementById(v).value='';

} 

function CheckSelected(value,id)
{    
    if(value==true)    
    {
        if(document.getElementById(id).value=='')
        {
            document.getElementById(id).value ='1';
        }
    }
    else    
    {     
        document.getElementById(id).value ='';    
    }
}
function openWin(Path)
{    
    var formatPath = Path.replace('\\','/'); 
    var winOptions = "location=no, width=520, height=500, toolbars=no, status=no,resizable=yes,menubar=no, scrollbars=yes";    
    var winName = "newWindow";    	    
    window.open('./'+formatPath, winName, winOptions);    return false;
}
function openMyWin(Path,myWidth,MyHeight)
{    
    var formatPath = Path.replace('\\','/'); 
    var winOptions = "location=no, width="+myWidth+", height="+MyHeight+", toolbars=no, status=no,resizable=yes,menubar=no, scrollbars=yes";    
    var winName = "newWindow";    	    
    window.open('./'+formatPath, winName, winOptions);    return false;
}

function setRadioButtonSelect(obj,tempControl)
{   
  var theBox = tempControl;   
  var elem = document.getElementById(obj).getElementsByTagName("input");
  for(i = 0;i< elem.length; i++)     
  {         
       if(theBox.checked)         
       {             
            if(elem[i].type=="checkbox")             
            {                  
                    elem[i].checked = true;             
             }         
        }
        else
        {            
            elem[i].checked = false;         
        }     
   }
}

function setRadioButtonSelectandAlert(obj,tempControl,alertmessage)
{   
  var theBox = tempControl;   
  var elem = document.getElementById(obj).getElementsByTagName("input");
                       
  for(i = 0;i< elem.length; i++)     
  {         
       if(theBox.checked)         
       {             
            if(elem[i].type=="checkbox")             
            {                  
                  elem[i].checked = true; 
            }         
        }
        else
        {            
            elem[i].checked = false;         
        }     
   }
   
  if(theBox.checked)         
  {    
     alert(alertmessage);            
  } 
}
/* add Eric*/
function MaxLenCheck(tbxobj)   
{        
   var maxLength = 1000;         
   var length = tbxobj.value.length;          
   for(var i=0;i<length;i++)         
   {             
        if (/^[\u4E00-\u9FA5]+$/g.test(tbxobj.value.charAt(i)))             
        {                 
            maxLength=maxLength-2; 
        }  
        else  
        {
             maxLength--;
        }
        if (maxLength<0)
        {
             alert("The content size limit is 1000 characters, please modify and submit your comments in the field below.");                 tbxobj.value=tbxobj.value.slice(0,i);
              return;    
         }    
     }
     return;
 }



/* Control ssl image only show production*/
/* add Jack Song 20090413*/

SSLImageControl=function (){
	var url=document.location.href.toLowerCase();

	if(url.indexOf("www.celebratinghome.com") == -1)
	{
		var sslImage=document.getElementById("SSLIMG");
		if(sslImage!=null)
		{
			sslImage.style.display='block';
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", SSLImageControl);
if (window.addEventListener) window.addEventListener("load", SSLImageControl,false);

function EnterEventMoveFouce(fouceControl)
{
    if(SearchEvent().keyCode == 13)
    {
        document.getElementById(fouceControl).focus();
    }
}


/*add by Jack Song 20090420*/

function SearchEvent()
{	
    if(document.all)	  
    return window.event;	
    func=SearchEvent.caller;	
    while(func!=null)	
    {		
        var arg0=func.arguments[0];		
        if (arg0)		
        {			
            if (arg0.constructor==Event ||(typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation))			
                return arg0;		
         }		
        func=func.caller;	
     }	
    return null;
}


/*add by Jack Song 20090618*/
function creatediv(id)
  {
	   var obj_div = document.getElementById(id);
	   if(obj_div!=null)
	   {
			return obj_div;
	   }
	   var newNode = document.createElement("div");
	   newNode.setAttribute("id", id);
	 //  newNode.setAttribute("class", cssclass);
	   document.body.appendChild(newNode);
	   obj_div = document.getElementById(id);
	   obj_div.innerHTML=" <iframe style=\"FILTER: alpha(opacity=0); WIDTH: 100%; HEIGHT: 100%\" frameborder=\"0\" scrolling=\"no\" marginwidth=\"0\" src=\"SSLBlank.ashx\" marginheight=\"0\"></iframe>";
	   return obj_div;
  }
  
  /*add by Jack Song 20090618*/
  function ShowBackGroundDiv()
  {
  	var obj_div=creatediv("BackGround");
	if(obj_div!=null)
	{
	    var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        var clientWidth;
        if (window.innerWidth) {
            clientWidth = ((Sys.Browser.agent === Sys.Browser.Safari) ? window.innerWidth : Math.min(window.innerWidth,document.documentElement.clientWidth));
        } else {
            clientWidth = document.documentElement.clientWidth;
        }
        var clientHeight;
        if (window.innerHeight) {
            clientHeight = ((Sys.Browser.agent === Sys.Browser.Safari) ? window.innerHeight : Math.min(window.innerHeight,document.documentElement.clientHeight));
        } else {
            clientHeight = document.documentElement.clientHeight;
        }
		obj_div.style.left = scrollLeft+'px';
		obj_div.style.top = scrollTop+'px';
		obj_div.style.width = clientWidth+'px';
		obj_div.style.height = clientHeight+'px';
		obj_div.style.display = 'block';
		obj_div.style.display='block';
		obj_div.style.index=998;
		obj_div.style.backgroundcolor='Gray';
		obj_div.style.position='absolute';
	}
	
	
	window.onscroll=ShowBackGroundDiv;
    window.onresize=ShowBackGroundDiv;
  }
  
  function HiddenBackGroundDiv()
  {
  	var obj_div=creatediv("BackGround");
	if(obj_div!=null)
	{
		obj_div.style.display='none';
		window.onscroll=function(){};
        window.onresize=function(){};
	}
  }
  
  //sunny 
  function doKeypress(control)
{
    maxLength = control.attributes["maxLength"].value;
    value = control.value;
    if(maxLength && value.length > maxLength-1)
    {
        event.returnValue = false;
        maxLength = parseInt(maxLength);
    }
}

function doBeforePaste(control)
{
    maxLength = control.attributes["maxLength"].value;
     if(maxLength)
     {
          event.returnValue = false;
     }
}

function doPaste(control)
{
    maxLength = control.attributes["maxLength"].value;
    value = control.value;
    if(maxLength)
    {
        event.returnValue = false;
        maxLength = parseInt(maxLength);
        var oTR = control.document.selection.createRange();
        var iInsertLength = maxLength - value.length + oTR.text.length;
        var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
        oTR.text = sData;
    }
}




function swapImage(imgTarget, imgUrl)
{
	imgTarget.src = imgUrl;	
}

/*
  author:skysing
  create date:2009-08-13 
*/
function selectGridViewAllCheckBox(gvID,columnIndex)
{
    var _this=document.getElementById(gvID);

    for(var i=1;i<_this.rows.length;i++)
    {
       if(typeof(_this.rows[i].cells[columnIndex])=="object")
       {
         for(var j=0;j<_this.rows[i].cells[columnIndex].childNodes.length;j++)
         {
           var oj=_this.rows[i].cells[columnIndex].childNodes[j];
            findChildCheckBox(oj);
         }
       }
    }
}
/*
  author:skysing
  create date:2009-08-13 
*/
function findChildCheckBox(oj)
{
    var result=false;
    for(attr in oj)
    {
      if(attr=="type")
      {
        if(oj.getAttribute(attr)=="checkbox")
        {
         result=true;
         try{
               if(oj.checked==true)
               {
                  oj.checked=false;
               }
               else
               {
                 oj.checked=true;
                 
               }
            }catch(e){}
        }
      }
    }
    if(!result)
    {
      for(var c=0;c<oj.childNodes.length;c++)
      {
        findChildCheckBox(oj.childNodes[c]);
      }
    }
}
/*
  author:skysing
  create date:2009-08-20
  desc:input uint 
*/
function  inputUINT(ev) 
{
    var key=ev.keyCode;

    if((key>=48 && key<=57)||key==8||(key>=96&&key<=105)||key==46)
    {
        return true;
    }
    else
    {
        return false;
    }
}


/*
  author:jack song
  create date:2009-10-12
  desc:createInput
*/
function createInput(inputType,inputName,inputValue)
{
	var input =document.createElement("<input style='text-align:right' type='"+inputType+"' name='"+inputName+"' value='"+inputValue+"' >");
	return input;
}
/*
  author:jack song
  create date:2009-10-12
  desc:createForm
*/
function createForm(formname,actionurl,method)
{
	var form = document.createElement("form");
	form.setAttribute("name",formname);
	form.setAttribute("action",actionurl);
	form.setAttribute("method",method);
	return form;
}

function fPopUpCalendarDlg(obj)
{
	showx = event.screenX - event.offsetX - 4 - 110 ;
	showy = event.screenY - event.offsetY + 18;
	newWINwidth = 210 + 4 + 18;
	retval = window.open("calendar/CalendarDlg.htm?name="+obj, "", "status=no,scrollbars=no,width=235,height=210, top=" + showy + "px,left=" +showx+"px" );
}

var increment = 0;
	function openTipWin(winName)
	{
		increment++;
		
		var location = "./"+winName;
		var options = "location=no, width=800, height=600, toolbars=no, status=no,resizable=yes,menubar=no, scrollbars=yes";
		var name = "secTip" + increment;
		
		window.open(location, name, options);
		//window.open(location, name);
	}
	
	
	  function fPopUpSummary(recId,actType)
{
		showx = (screen.Width-553)/2;
	    showy = (screen.height-600)/2;
		newWINwidth = 210 + 4 + 18;
		retval = window.open("OrderSummayPopWin.ashx?recId="+recId+"&actType="+actType, "", "status=no,scrollbars=no,width=465,height=250, top=" + showy + "px,left=" +showx+"px" );
	}
	
	function getMouseoverEvent(e,obj,instr,lbobj){
	            if(!e)
		e=window.event;
		
	             var div = document.getElementById(obj);
	             var lbl = document.getElementById(lbobj);
	             
	             div.innerHTML="<table class=\"markover\"><tr><td>"+instr+"</td></tr></table>";
	             
	             //alert(getPositionX(lbl));
	             //alert(getPositionY(lbl));
	             
			     div.style.left=getPositionX(lbl)+   "px"; 
			     div.style.top=getPositionY(lbl)+15 +   "px"; 
			   
			    div.style.display='';
			    
			}
			function getMouseoutEvent(e,obj)
			{ 
				if(!e)
		        e=window.event;	
		        	
		        var div = document.getElementById(obj);
			    div.style.display='none';
			}
			function getPositionX(t)
  {
    var obj = eval(t)
    var x = obj.offsetLeft
    while(obj = obj.offsetParent)
    {
      x += obj.offsetLeft
    }
    return x
  }
  function getPositionY(t)
  {
    var obj = eval(t)
    var y = obj.offsetTop
    while(obj = obj.offsetParent)
    {
      y += obj.offsetTop
    }
    return y
  }
  
  function CheckoutConfirm(a,b) 
    {
        var totalAmount =document.getElementById(a).innerText ;
        var ccNumber = document.getElementById(b).value;
        
        if(ccNumber.length==0)
        {
          return confirm("You did not enter a credit card, no future autoships will be created.") ;

        }
        else {
            return confirm("You have entered a credit card, future autoships will be billed to this card at the original order price.");
            
        }

    }
    function EnrollCheckoutConfirm(a,b,pid,cid,sid) 
    {
        var totalAmount =document.getElementById(a).innerText ;
        var ccNumber = document.getElementById(b).value;
        
       
        if(ccNumber.length==0)
        {
          if(confirm("You did not enter a credit card for PWP renewals.  No renewals will be processed and this PWP will expire")) 
          {
                document.getElementById(pid).style.display='none';
                document.getElementById(cid).style.display='none';
                document.getElementById(sid).style.display='none';
          
            return true;
          }
          else
          {
          
            return false;
          }

        }
        else {
            if(confirm("You have entered a credit card, future pwp renewals will be billed to this card."))
            {
               document.getElementById(pid).style.display='none';
                document.getElementById(cid).style.display='none';
                document.getElementById(sid).style.display='none';
                return true;
            }
            else
            {
             
                return false;
            }

            
        }

    }
