function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/*function for reseting the drop down indexs to a zero value */
function ReSetIndex()
{
	var ddlHealth = document.getElementById("ddlHealth");
	var	ddlType = document.getElementById("ddlType");
	var	ddlPart = document.getElementById("ddlPart");
	
	
	if(ddlHealth !=null)
	{
		ddlHealth.value = 0;	
	}	

	if(ddlType !=null)
	{
		ddlType.value = 0;
	}

	if(ddlPart !=null)
	{
		ddlPart.value = 0;
	}	

}  //end resetindex function
			
/*Set the hidden field with a value of one when the customer mouse in on the 
  search entry field */ 			
function setFocusSearch()
{
	var txtfocus = document.getElementById('txtfocus');
	
	if (txtfocus !=null)
	{
		txtfocus.value = "0";
	} 
}
  
/*Set the hidden field with a value of one when the customer mouse in on the 
  email entry field */ 
function setEmailFocus()
{
	var txtfocus = document.getElementById('txtfocus');
	
	if (txtfocus !=null)
	{
		txtfocus.value = "1";
	} 
}
  
/*Set the hidden field with a value of one when the customer mouse in on the 
  email entry field */ 
function setPromoFocus()
{
	var txtfocus = document.getElementById('txtfocus');
	
	if (txtfocus !=null)
	{
		txtfocus.value = "2";
	} 
}

function setFocusSearchLeft()
{
	var txtfocus = document.getElementById('txtfocus');
	
	if (txtfocus !=null)
	{
		txtfocus.value = "3";
	} 
}

/*Set the hidden field with a value of one when the customer mouse in on the 
  email entry field */ 
function setCouponFocus()
{
	var txtfocus = document.getElementById('txtfocus');
	
	if (txtfocus !=null)
	{
		txtfocus.value = "4";
	} 
}
  
/*Set the hidden field with a value of one when the customer mouse in on the 
  email entry field */ 
function setZipCodeFocus()
{
	var txtfocus = document.getElementById('txtfocus');
	
	if (txtfocus !=null)
	{
		txtfocus.value = "5";
	}
}

function setFocusCheck() {
    var txtfocus = document.getElementById('txtfocus');

    if (txtfocus != null) {
        txtfocus.value = "9";
    }
}
  
/*Determines the course action to take when the enter key is pressed
  if the value of the hidden field is zero then the search has focus
  if the value is one then the email entry field has focus. */
function EnterKey()
{
    var txtfocus = document.getElementById('txtfocus');
	
	if (txtfocus != null)
	{
		if(txtfocus.value =="0")
		{
			document.getElementById('StandardHeader1_PCLSearch1_lnkSearchA').click();
			event.keyCode = 0;
		}
	 
		if(txtfocus.value =="1")
		{
			document.getElementById('SpecialOffers1_lnkEmail').click();
			event.keyCode = 0;
		}
	  
		if(txtfocus.value =="2")
		{
			document.getElementById('ShoppingCartGrid1_PromoCode1_lnkGo').click();
			event.keyCode = 0;
		}
		
		if(txtfocus.value =="3")
		{
			document.getElementById('PCLSearchLeft1_lnkSearchB').click();
			event.keyCode = 0;
		}
		
		if(txtfocus.value =="4")
		{

			document.getElementById('imgCoupon').click();
			event.keyCode = 0;
		}
		
		if(txtfocus.value =="5")
		{

            document.getElementById('imgGo').click();
            event.keyCode = 0;
        }

        if (txtfocus.value == "6") {

            document.getElementById('lnkCatg').click();
            event.keyCode = 0;
        }

        if (txtfocus.value == "7") {

            document.getElementById('AddressEntry_imgSave').click();
            event.keyCode = 0;
        }

        if (txtfocus.value == "8") {

            document.getElementById('CardEntry_btnSaveCreditCard').click();
            event.keyCode = 0;
        }

        if (txtfocus.value == "9") {

            document.getElementById('lnkCompare').click();
            event.keyCode = 0;
        }
	} 
}
			
function OpenPopUpWindow(url) 
{ 
    new_window = OpenSizedPopUpWindow(url, 350, 560);
}

function OpenSizedPopUpWindow(url, height, width) 
{ 
    new_window = window.open(url,'window_name','toolbar=0,menubar=0,resizable=0,dependent=0,status=0,scrollbars=1,width=' + width + ',height=' + height + ',left=50,top=50');
}

function OpenPopUpWindowNewsletter(url) 
{ 
    new_window = OpenSizedPopUpWindow(url, 600, 927);
}