
	var cat1on = "/muttImages/nav/muttNavO_01.gif";
	var cat2on = "/muttImages/nav/muttNavO_03.gif";
	var cat3on = "/muttImages/nav/muttNavO_04.gif";
	var cat4on = "/muttImages/nav/muttNavO_05.gif";
	var cat5on = "/muttImages/nav/muttNavO_06.gif";
	var cat6on = "/muttImages/nav/muttNavO_07.gif";
	var cat7on = "/muttImages/nav/muttNavO_08.gif";
	var cat8on = "/muttImages/nav/muttNavO_09.gif";
	var cat9on = "/muttImages/nav/muttNavO_10.gif";
	var cat10on = "/muttImages/nav/muttNavO_02.gif";





// General, site-wide JS code
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

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_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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

// Search Box Clear
function clearSearch() {
	if (searchform.words.value == 'keyword or catalog quick shop') {
		searchform.words.value = '';
	}
}

// Primary Nav

function WS_hideall() {
	MM_showHideLayers('catlayer1','','hide');
	MM_showHideLayers('catlayer2','','hide');
	MM_showHideLayers('catlayer3','','hide');
	MM_showHideLayers('catlayer4','','hide');
	MM_showHideLayers('catlayer5','','hide');
	MM_showHideLayers('catlayer6','','hide');
	MM_showHideLayers('catlayer7','','hide');
	MM_showHideLayers('catlayer8','','hide');
	MM_showHideLayers('catlayer9','','hide');
	MM_showHideLayers('catlayer10','','hide');

	  
	MM_showHideLayers('regcatlayer1','','hide');
	MM_showHideLayers('regcatlayer2','','hide');
	MM_showHideLayers('regcatlayer3','','hide');
	MM_showHideLayers('regcatlayer4','','hide');
	MM_showHideLayers('regcatlayer5','','hide');
	MM_showHideLayers('regcatlayer6','','hide');
	MM_showHideLayers('regcatlayer7','','hide');
	MM_showHideLayers('regcatlayer8','','hide');
	MM_showHideLayers('regcatlayer9','','hide');
	
	hideTheSortBySelect ('');
}
	
function WS_initialize() {
	WS_hideall();		
	MM_swapImgRestore();
}

function WS_showCurrent () {
	WS_hideall();
	MM_showHideLayers('catlayer1','','show');
	MM_showHideLayers('regcatlayer1','','show');
}

var WS_menu=null;

function WS_doinTopCat(num,switchOn) {
	MM_swapImgRestore();
	MM_swapImage('cat' + num,'',switchOn,1);
	MM_showHideLayers('catlayer' + num,'','show');
	if (WS_menu != null) {window.clearTimeout(WS_menu);}
}

function WS_doinRegCat(num,switchOn) {
	MM_swapImgRestore();
	MM_swapImage('regcat' + num,'',switchOn,1);
	MM_showHideLayers('regcatlayer' + num,'','show');
	if (WS_menu != null) {window.clearTimeout(WS_menu);}
}

function WS_dooutTopCat(num) {
	if (WS_menu != null) {window.clearTimeout(WS_menu);}
	WS_menu=window.setTimeout('WS_initialize()',500);
}

// can remove the next two functions WS_doinCat and WS_dooutCat
function WS_doinCat(num) {
	MM_swapImgRestore();
	MM_swapImage('cat' + num,'',eval('cat' + num + 'on'),1);
	MM_showHideLayers('catlayer' + num,'','show');
	MM_swapImage('regcat' + num,'',eval('regcat' + num + 'on'),1);
	MM_showHideLayers('regcatlayer' + num,'','show');
	if (WS_menu != null) {window.clearTimeout(WS_menu);}
}

function WS_dooutCat(num) {
	if (WS_menu != null) {window.clearTimeout(WS_menu);}
	WS_menu=window.setTimeout('WS_initialize()',500);
}

function cartRollOn () {
	document.getElementById ('cartCount').className = 'pricetextOn';
}

function cartRollOff () {
	document.getElementById ('cartCount').className = 'pricetext';
}

// General popup code
function createPopUp (url, name, optionString) {
	if (url.length == 0) { var url = "#"; }
	if (name.length == 0) { var name = "newwnd"; }
	if (optionString.length == 0) { var optionString = "toolbar=no,location=no,directories=no,scrollbars=yes,resizable=yes,height=600,width=590,screenX=4,screenY=4,top=4,left=4"; }
	win = window.open (url, name, optionString);
	win.focus ();
}

// for cart popups
function createCartPopUp(url, name, optionString) {
	if (!name){
		name = "newwnd";
	}
	if (!optionString){
		optionString = "toolbar=no,location=no,directories=no,scrollbars=1,resizable=0,height=390,width=470,screenX=4,screenY=4,top=4,left=4";
	}		
	win = window.open(url, name, optionString);
	win.focus();
}

var supported = navigator.userAgent.indexOf("Mozilla") == 0 && navigator.userAgent.substring(8,9) >= 3;
function shiptoPopUp(filename, windowname, width, height) {
	if(supported) {
		popup = window.open(filename,windowname,"resizable=yes,scrollbars=yes,status=no,width="+width+",height="+height);
		popup.focus();
		return false;
	} else {
		return true;
	}
}
// This function is used to target a link to the parent window and close the popup. This is used in SVC check balance popup
function ParentWindow(URL) {
        window.close();
        window.opener.top.location =URL;
}
// Force a location to load (or re-load) a URL
function forceLoad(loc, url) {
    if ((loc.href != url) && (loc.href != url + loc.hash)
        && (loc.href != url + '#')) {
        loc.href = url;
    } else {
        loc.reload(true);
    }
}
function removeCartItem(item) {
    document.cartForm[item].value = "remove";
    //document.cartForm.submit();
}
function editMonogramming(item) {
    alert(item);
    document.cartForm[item].value = "edit";
    document.cartForm.submit();
}


function removeErrors() {
		var matchEl = document.getElementById('PipGenError');
		
		matchEl.style.visibility ='hidden';
}

function showError(message,remove) {
		if(remove){
			this.removeErrors();
		}
		var prodObjGEn = document.getElementById('PipGenError');
		var icon = document.createElement("div");
		prodObjGEn.style.visibility = 'visible';
		prodObjGEn.innerHTML ='';
		icon.className = "errorMsg";
		icon.innerHTML= icon.innerHTML  +message;
		
		prodObjGEn.appendChild(icon);
}

// controls max character length for text Areas
function maxLen(objTextArea, iMaxCount){
	var content 	= objTextArea.value;
	var contentLen	= content.length;
	if(contentLen > iMaxCount){
		newContent=content.substring(0,iMaxCount);
		objTextArea.value=newContent;
	}
};

// This implementation based on quirksmode.org/js/cookies.html
function readCookie(name) {
        var cookieKey = name + "=";
        var cookieList = document.cookie.split(";");
    var result = null;

        for (var i = 0; i < cookieList.length; i++) {
                var thisCookie = cookieList[i];
        //var len = thisCookie.length;
        // Trim leading whitespace - probably a for loop would be better here
        while (thisCookie.charAt(0) == " ") {
            thisCookie = thisCookie.substring(1, thisCookie.length);
        }
                if (thisCookie.toUpperCase().indexOf(cookieKey.toUpperCase()) == 0) {
            result = thisCookie.substring(cookieKey.length, thisCookie.length);
            break;
        }
        }
        return result;
}

//This function is to validate the textarea, the text limit. 
function textLimit(_2a5,_2a6,_2a7){
	if(_2a5.value.length>_2a6){
		_2a5.value=_2a5.value.substring(0,_2a6);
		if(_2a7!=null&&_2a7.length!=0){
			alert(_2a7);
		}
	}
}
/*
This function attach an event handler to any event in the dhtml
*/
function RegisterWindowLoadEvent(fnHandler)
{
	var evt = "onload";
	var source = window;
	if (arguments.length > 1) evt = arguments[1];
	if (arguments.length > 2) source = arguments[2];
	if ( typeof window.addEventListener != "undefined" )
	{
		source.addEventListener( evt.replace("on", ""), fnHandler, false );
	}
	else
	{
		if ( typeof source.attachEvent != "undefined" )
		{
			source.attachEvent( evt, fnHandler );
			//alert(evt);
		}
		else
		{
			if ( source.onload != null )
			{
				var oldOnload = source.onload;
				source.onload = function ( e )
						{
							oldOnload( e );
							fnHandler();
						}
			}
			else
			{
				source.onload = fnHandler;
			}
		}
	}
}

function floatCart (state) {
	var elem = document.getElementById ('cart-count');
	
	if( elem ) {
		if( state ) {
			elem.className = 'cart-count-on';
		} else {
			elem.className = 'cart-count-off';
		}
	}
}

function driveParent (destination) {
	if (window.opener) {
		window.opener.location.href = destination;
		window.opener.focus ();
	} else {
		// If the user closed the parent window, create a new one
		var newWin = window.open (destination, '', '');
		newWin.focus ();
	}
}

/* -------------------------------------------------------------------- */
/* Determines if the browser is an Internet Explorer of
 * versions 1 through 6.
 *
 * @return true if is IE 1-6, false otherwise
 */
function isIE_1_6() {

        // if not IE...
        if (navigator.userAgent.indexOf("MSIE") == -1) {
                return false;
        }
        var majorNumber = navigator.userAgent.charAt(navigator.userAgent.indexOf("MSIE") + 5);
        // if is IE, but is IE 7 or newer...
        if (parseFloat(majorNumber) >= 7) {
                return false;
        }
        return true;
}

/* -------------------------------------------------------------------- */
/* Hides any <select> with the class. Intended for "Registry List" page.
 * Only runs on Internet Explorer 6 or earlier because old IEs won't let
 * their <select> elements display behind other elements.
 *
 * It doesn't work quite right. The <select> will flash on and then off quicky when you scroll down the drop-down menu.
 *
 * valid values for visibility: "visible" or "hidden"
 */
var sortTimer = null;

function hideSortBy () {
	if ( document.getElementById ('s0') )
		document.getElementById ('s0').style.visibility = 'hidden';
	
	if ( document.getElementById ('u0') )
		document.getElementById ('u0').style.visibility = 'hidden';
	
	if ( document.getElementById ('sortdropdown') )
		document.getElementById ('sortdropdown').style.visibility = 'hidden';
	
	if ( document.getElementById ('regeventtype') )
		document.getElementById ('regeventtype').style.visibility = 'hidden';
	
	if ( document.getElementById ('regmonth') )
		document.getElementById ('regmonth').style.visibility = 'hidden';
	
	if ( document.getElementById ('regday') )
		document.getElementById ('regday').style.visibility = 'hidden';
	
	if ( document.getElementById ('regyear') )
		document.getElementById ('regyear').style.visibility = 'hidden';
	
	if ( document.getElementById ('month') )
		document.getElementById ('month').style.visibility = 'hidden';
	
	if ( document.getElementById ('Year') )
		document.getElementById ('Year').style.visibility = 'hidden';
	
	if ( document.getElementById ('state') )
		document.getElementById ('state').style.visibility = 'hidden';
}

function showSortBy () {
	if ( document.getElementById ('s0') )
		document.getElementById ('s0').style.visibility = 'visible';
	
	if ( document.getElementById ('u0') )
		document.getElementById ('u0').style.visibility = 'visible';
	
	if ( document.getElementById ('sortdropdown') )
		document.getElementById ('sortdropdown').style.visibility = 'visible';
	
	if ( document.getElementById ('regeventtype') )
		document.getElementById ('regeventtype').style.visibility = 'visible';
	
	if ( document.getElementById ('regmonth') )
		document.getElementById ('regmonth').style.visibility = 'visible';
	
	if ( document.getElementById ('regday') )
		document.getElementById ('regday').style.visibility = 'visible';
	
	if ( document.getElementById ('regyear') )
		document.getElementById ('regyear').style.visibility = 'visible';
	
	if ( document.getElementById ('month') )
		document.getElementById ('month').style.visibility = 'visible';
	
	if ( document.getElementById ('Year') )
		document.getElementById ('Year').style.visibility = 'visible';
	
	if ( document.getElementById ('state') )
		document.getElementById ('state').style.visibility = 'visible';
}

function hideTheSortBySelect (visibility) {
	// if is NOT an older IE...
    if (!isIE_1_6()) {
		// don't need this function
		return;
	}
	
	if ( (document.getElementById ('s0')) || (document.getElementById ('u0')) || (document.getElementById ('sortdropdown')) ||
	     (document.getElementById ('month')) || (document.getElementById ('Year')) || (document.getElementById ('state')) ||
	     (document.getElementById ('regeventtype')) || (document.getElementById ('regmonth')) || (document.getElementById ('regday')) || (document.getElementById ('regyear')) ) {
		if (visibility == 'hidden') {
			hideSortBy ();
		} else {
			if (sortTimer != null) {window.clearTimeout (sortTimer);}
			sortTimer = window.setTimeout ('showSortBy ();', 1500);
		}
	}
}
//Catalog Address Update code
function changeHeader(vl){
	if(vl == "mmplan"){
		document.getElementById('addressHeader').innerHTML = "New Address";
		document.getElementById('old_addressHeader').innerHTML = "Current Address";
		document.getElementById('MD_month').disabled=false;
		document.getElementById('MD_day').disabled=false;
		document.getElementById('MD_year').disabled=false;
		document.getElementById('addrheader').value = "New Address";
		document.getElementById('old_addrheader').value = "Current Address";
		document.getElementById('varForCM').value ="Future Move";
	} else if(vl== "mmmoved") {
		document.getElementById('addressHeader').innerHTML = "New Address";
		document.getElementById('old_addressHeader').innerHTML = "Previous Address";
		document.getElementById('MD_month').disabled=true;
		document.getElementById('MD_day').disabled=true;
		document.getElementById('MD_year').disabled=true;
		
		document.getElementById('addrheader').value = "New Address";
		document.getElementById('old_addrheader').value = "Previous Address";
		document.getElementById('varForCM').value ="Past Move"
	} else {
		document.getElementById('addressHeader').innerHTML = "Correct Information";
		document.getElementById('old_addressHeader').innerHTML = "Existing Information";
		document.getElementById('MD_month').disabled=true;
		document.getElementById('MD_day').disabled=true;
		document.getElementById('MD_year').disabled=true;
		document.getElementById('addrheader').value = "Correct Information";
		document.getElementById('old_addrheader').value = "Existing Information";
		document.getElementById('varForCM').value ="Information Correction"
	}
	
}