// JavaScript Document

var testresults
function checkemail(){
	var str=document.NLSignUp.Email.value
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(str))
    	testresults=true
    else{
       alert("The email entered appears to have a mistake in it. Please check and re-enter your email address.")
       testresults=false
	   document.NLSignUp.Email.focus()
    }
    return (testresults)
}

function checkbae(){
	if (document.layers||document.getElementById||document.all)
       return checkemail()
    else
       return true
    }
	
function checkform(){
	var str=document._ctl1.txtEmail.value
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(str))
    	testresults=true
    else{
       alert("The email entered appears to have a mistake in it. Please check and re-enter your email address.")
       testresults=false
	   document._ctl1.txtEmail.focus()
    }
    return (testresults)
}

function checkcontactform(){
	if (document.layers||document.getElementById||document.all)
       return checkform()
    else
       return true
    }
	
function dEstimatePopUp(){
	window.open('deliveryestimate.aspx','DeliveryEstimatePopUp','refresh=no,height=475,width=475,top=50,left=50,status=no,toolbar=no,menubar=no,scrollbars=yes,location=no');
	return (true);
}

	   
function popuptopicwh(title,topic,w,h,scrollbars){
	window.open('popup.aspx?title=' + title + '&topic=' + topic,'Popup30093','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=no,copyhistory=no,width=' + w + ',height=' + h + ',left=50,top=50');
	return (true);
}

function UpdateItem(sku) {
	if (!document.getElementById("CartForm")) return false;
	var btn = document.getElementById('ImgBtnApply');
	btn.click();
}

function RemoveItem(sku) {
	if (!document.getElementById("CartForm")) return false;
	var field = "Quantity_"+ sku;
	document.getElementById(field).value=0;
	var btn = document.getElementById('ImgBtnApply');
	btn.click();
}

sfHover = function() {
	if (!document.getElementById("cart")) return false;
	var sfEls = document.getElementById("cart").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);

mcHover = function() {
	if (!document.getElementById("mcImg")) return false;
	var sfEls = document.getElementById("mcImg").getElementsByTagName("img");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" mcHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" mcHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", mcHover);

searchHover = function() {
	if (!document.getElementById("NavBar1")) return false;
	var sfEls = document.getElementById("NavBar1").getElementsByTagName("input");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" searchHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" searchHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", searchHover);

cpnHover = function() {
	if (!document.getElementById("newsletter")) return false;
	var sfEls = document.getElementById("newsletter").getElementsByTagName("input");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" cpnHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" cpnHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", cpnHover);

contactHover = function() {
	if (!document.getElementById("contact_form")) return false;
	var sfEls = document.getElementById("contact_form").getElementsByTagName("input");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" contactHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" contactHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", contactHover);

addtocartHover = function() {
	if (!document.getElementById("product_page")) return false;
	var sfEls = document.getElementById("product_page").getElementsByTagName("input");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" addtocartHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" addtocartHover\\b"), "");
		}		
	}
}
if (window.attachEvent) window.attachEvent("onload", addtocartHover);

popupHover = function() {
	if (!document.getElementById("pRow1")) return false;
	var sfEls = document.getElementById("pRow1").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" popupHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" popupHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", popupHover);

dDateHover = function() {
	if (!document.getElementById("sEstimate")) return false;
	var sfEls = document.getElementById("sEstimate").getElementsByTagName("img");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" dDateHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" dDateHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", dDateHover);

dDatesHover = function() {
	if (!document.getElementById("ShippingEstimate")) return false;
	var sfEls = document.getElementById("ShippingEstimate").getElementsByTagName("img");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" dDatesHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" dDatesHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", dDatesHover);

applyHover = function() {
	if (!document.getElementById("pnlCoupon")) return false;
	var sfEls = document.getElementById("pnlCoupon").getElementsByTagName("input");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" applyHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" applyHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", applyHover);

pcHover = function() {
	if (!document.getElementById("ImgCheckoutRow")) return false;
	var sfEls = document.getElementById("ImgCheckoutRow").getElementsByTagName("input");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" pcHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" pcHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", pcHover);

csHover = function() {
	if (!document.getElementById("ContinueShop")) return false;
	var sfEls = document.getElementById("ContinueShop").getElementsByTagName("input");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" csHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" csHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", csHover);

ccHover = function() {
	if (!document.getElementById("btnContinueCheckout")) return false;
	var sfEls = document.getElementById("btnContinueCheckout");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" ccHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" ccHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", ccHover);

soHover = function() {
	if (!document.getElementById("ImgbtnContinueCheckout")) return false;
	var sfEls = document.getElementById("ImgbtnContinueCheckout");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" soHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" soHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", soHover);

