/* niche Customer account/cart info */
function sizeCart() {
	if(document.getElementById)
		elem = document.getElementById('cartText');	
	else if (document.all)
		elem = document.all['cartText'];
	
	elem.style.display = "";			
	var middle = getW('cartLinks');	
	newsize = middle -11 ;	
	elem.style.width = middle + "px";
 
}
 
function getW(elem) {
        if(document.getElementById) {
                       var elem = document.getElementById(elem);
        } else if (document.all) {
                       var elem = document.all[elem];
        }
        
        if(elem) {     
               xH = elem.offsetWidth;
               
        } else {
               xH = 0;
        }
        
        return xH;
}
/* OLD FLUID */
function sizePage() {		
        var rightcol =  getH('secondaryContentWrapper');
        var leftcol = getH('secondaryNavWrapper');
        var middle = getH('mainContent');
		//var righttop = getH('secondaryContentWrapperTop');
		//
		//var lefttop = getH('secondaryNavWrapperTop');
		var maxh = rightcol;
		if (leftcol > maxh)
			{maxh = leftcol;}
		if (middle > maxh)
			{maxh = middle;}
		
		dump_left_nav_height = leftcol;
		
		  newsize = maxh ;
		  newsizeleft = maxh - getH('secondaryNavWrapperTop') ;
		  newsizeright = maxh - getH('secondaryContentWrapperTop') ;
			
			if(document.getElementById) {
					  elem = document.getElementById('secondaryNav'); 
			} else if (document.all) {
					  elem = document.all['secondaryNav'];
			}
			if (elem != null) {
				elem.style.height = newsizeleft + "px";
				
				if(document.getElementById) {
						  elem = document.getElementById('secondaryContent');
				} else if (document.all) {
						  elem = document.all['secondaryContent'];
				}
				
				// If right nav doesn't exist, ignore
				if (elem) {
					elem.style.height = newsizeright + "px";
				}
				
				if(document.getElementById) {
						  elem = document.getElementById('mainContent');
				} else if (document.all) {
						  elem = document.all['mainContent'];
				}
	
				elem.style.height = newsize + "px";
			}

}
 
function getH(elem) {
        if(document.getElementById) {
                       var elem = document.getElementById(elem);
        } else if (document.all) {
                       var elem = document.all[elem];
        }
        
        if(elem) {     
               xH = elem.offsetHeight;
               
        } else {
               xH = 0;
        }
        
        return xH;
}

/* STYLESWITCHER*/
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}


function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  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(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}
// Do not load for NetShops.com
if (location.href.indexOf(".netshops.") == -1) {
	window.onload = function(e) {
	  var cookie = readCookie("style");
	  var title = cookie ? cookie : getPreferredStyleSheet();
	  setActiveStyleSheet(title);
	}
	
	window.onunload = function(e) {
	  var title = getActiveStyleSheet();
	  createCookie("style", title, 365);
	}

	var cookie = readCookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
}

/* 
  ------------------------------------
  PVII Menu CSS Express Drop-Down Menu
  by Project Seven Development
  www.projectseven.com

  ------------------------------------
*/
function P7_ExpMenu(){ //v1.1.0.2 by PVII-www.projectseven.com
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 var i,k,g,lg,r=/\s*p7hvr/,nn='',c,cs='p7hvr',bv='p7menubar';
 for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){
 lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){
 lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;
 this.className=cl;};lg[k].onmouseout=function(){c=this.className;
 this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}
}

<!--

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function popUp(url,width,height,scroll,winname,toolbar,location) {
if (!winname)
 winname = "win";
if (winname == '')
 winname = "win";
if (!toolbar)
 toolbar = 0;
if (!location)
 location = 0;
sealWin=window.open(url,winname,"toolbar="+toolbar+",location="+location+",directories=0,status=0,menubar=0,scrollbars="+scroll+",resizable=1,width="+width+",height="+height);
self.name = "mainWin";sealWin.focus();}
 
function confirmMe(url) {
var result = confirm("Are you sure you wish to permanently delete this item?");
if (result) {
 document.location = url;
 }
}

function confirmMe(url) {
var result = confirm("Are you sure you wish to permanently delete this item?");
if (result) {
	document.location = url;
	}
}
	
function confirmEmpty(url) {
var result = confirm("Are you sure you wish to empty the shopping cart?");
if (result) {
	document.location = url;
	}
}

function disableSubmit(form) {
    if(document.shopper.submitted)return false;
    document.shopper.submit();
    document.shopper.submitbutton.disabled = true;
    return true;
}

function quickJump(url) {
	document.location = url;
	}

function compareProducts() {
	if(!(parseInt(navigator.appVersion) < 4)) {
		if(validate(window.document.compare) != false) {
			window.document.compare.submit();
		}
	}
	else {
		window.document.compare.submit();
	}
}

function validate(myform) {
	if(!(parseInt(navigator.appVersion) < 4)) {
		var value = 0;		
		if (myform != null) {
			for (var i = 0; i < myform.elements.length; i++) {
				if (myform.elements[i].checked) {
					value++;
				}
			}
		}
		if (value < 1) {
			alert('This feature allows you to do side-by-side comparisons of products. To use this feature, please "check" the boxes of the products you would like to compare.');
			return false;
		}
		else if (value > 20) {
			alert('We are sorry but the comparison is limited to 20 products.');
			return false;	
		}
	}
}

function Rcertify() 
{
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=103013113125129482', 'Participant','location=yes,scrollbars=yes,width=450,height=300'); 
window.name = 'opener';
}

function goThere()
{
	goToPage = document.attributeForm.attributeSelect.options[document.attributeForm.attributeSelect.selectedIndex].value;
	if (goToPage == ""){
		return;
	}

	document.attributeForm.action = goToPage;
	document.attributeForm.submit();

}

// For Multi-line Tabs rollovers MSIE 
function rollover()
{
  if(!document.getElementById || !document.createTextNode){return;}
  var n=document.getElementById('nav');
  if(!n){return;}
  var lis=n.getElementsByTagName('li');
  for (var i=0;i<lis.length;i++)
  {
    lis[i].onmouseover=function()
    {
      this.className=this.className?'current':'over';
    }
    lis[i].onmouseout=function()
    {
       this.className=this.className=='current'?'current':'';
    }
  }
}
window.onload=rollover;

// End -->

// email sign up on left nav
function confirmationText() {
	 http('get',"/cart/iso.cfm?detail=emailsignup&email=" + document.email_signup.emailadd.value, completeMsg);
}
function completeMsg(obj) {
	document.getElementById("signup_title").innerHTML = "Sign-up Confirmed<br />Thanks for joining us!";
	document.getElementById("signup_subtitle").innerHTML = "";
	document.getElementById("signup_box").innerHTML = "";
}
function validateEmail() {
	if(document.email_signup.emailadd.value == ""){
		alert("You must provide an email address! Please try again.");
		return false;
	}
	else if (document.email_signup.emailadd.value.indexOf("@") + "" == "-1" || document.email_signup.emailadd.value.indexOf(".") + "" == "-1"){
		alert("The email address you entered is not valid. Please try again.");
		return false;
	}
	else { 
		confirmationText();
		return false;
	}
}

function numeric_only(string) {
    for (var i=0, output='', valid="1234567890"; i<string.length; i++)
       if (valid.indexOf(string.charAt(i)) != -1)
          output += string.charAt(i)
    return output;
}
