var x = 5;
function startClock() {
	x=x-1
	setTimeout("startClock()", 1000);
	if(x==0) {
		document.getElementById('newsFlash').style.visibility='hidden';
	}
}
    
function toggle( targetId ){
	if (document.getElementById){
		target = document.getElementById( targetId );
		if (target.style.display == "none"){
			target.style.display = "";
		} else {
			target.style.display = "none";
		}
	}
}

function validateZip(){
	if (document.getElementById('zipCode').value == "" ) {
		alert("Please enter your zip code so we may find a store in your area.");
		document.getElementById('zipCode').focus();
		return false;
	} else if (document.getElementById('zipCode').value == "Zip Code") {
		alert("Please enter your zip code so we may find a store in your area.");
		document.getElementById('zipCode').focus();
		return false;
	} else if (document.getElementById('zipCode').value.length < 5) {
		alert("Please enter your complete zip code");
		document.getElementById('zipCode').focus();
		return false;
	} else {
		return true;
	}
}
    
    
function freshenZip(){
	if( document.getElementById('zipCode').value=='Zip Code' ) {
		document.getElementById('zipCode').value='';
		document.getElementById('zipCode').maxLength=11;
	}
}

function swapColor(detail, img, color){
	document.images[detail].src = img;
	document.forms['stf'].elements['img'].value = img;
	document.forms['stf'].elements['strColor'].value = color;
}

function PopWin(styleNo) {
	var newWin;
	newWin = window.open("zoom.asp?sNo="+styleNo,"style","height=500,width=440,status=no,toolbar=no,menubar=no,location=no,resizable=no,titlebar=no,scrollbars=no,fullscreen=no,top="+(screen.availHeight-500)/2+",left="+(screen.availWidth-440)/2);
	newWin.focus();
}

function CheckNumeric(){
var key = window.event.keyCode;
if ( key > 47 && key < 58 )
	return;
else
	window.event.returnValue = null;
}
    
function allowNumbers(e){
	var key;
	var keychar;
	var re = /[\d\x08\x0D\-.]/;

	if(window.event) {
			key = e.keyCode;
	} else if(e.which) {
			key = e.which;
	} else {
			return true;
	}

	keychar = String.fromCharCode(key);
	return re.test(keychar);
}

function popFab(where,width,height) {
	var popWin = null;
	var xPos = 0;
	var yPos = 0;
	if (screen) {
		xPos = Math.floor((screen.width-635)/2);
		yPos = Math.floor((screen.height-430)/2);
	}
	popprodWindow = window.open(where, 'productWin', 'width='+width+',height='+height+',toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,left='+xPos+',top='+yPos);
	popprodWindow.focus();
}

window.onload = function () {
	if (navigator.appName == "Microsoft Internet Explorer") {
		var arrElements = new Array(2);
		arrElements[0] = "object";
		arrElements[1] = "embed";
		for (n = 0; n < arrElements.length; n++) {
			replaceObj = document.getElementsByTagName(arrElements[n]);
			for (i = 0; i < replaceObj.length; i++ ) {
				parentObj = replaceObj[i].parentNode;
				newHTML = parentObj.innerHTML;
				parentObj.removeChild(replaceObj[i]);
				parentObj.innerHTML = newHTML;
			}
		}
	}
}