function WelcomeFlash(){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="760" height="450" id="BisazzaStore" align="middle">');
	document.write('<param name="movie" value="/swfs/home.swf">');
	document.write('<param name="allowScriptAccess" value="sameDomain">');
	document.write('<param name="quality" value="best">');
	document.write('<param name="menu" value="false">');
	document.write('<param name="scale" value="noscale">');
	document.write('<param name="bgcolor" value="#000000">');
	document.write('<param name="WMode" value="Opaque">');
	document.write('<embed  src="/swfs/home.swf" quality="best" menu="false" allowScriptAccess="sameDomain" scale="noscale" bgcolor="#000000" wmode="Opaque" width="760" height="450" name="BisazzaStore" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>');
}
function PicStr(){
	document.write('<div id="PicLoading" onclick="javascript:HidePic();"></div><div id="PicBg" onclick="javascript:HidePic();"></div><div id="PicCon" onclick="javascript:HidePic();"><span style="float:right; margin:10px;padding:1px;"><a rel="nofollow" href="javascript:HidePic();"><img src="/images/bt_close.gif" border="0" width="50" height="20" alt=""></a></span></div>');
}

function src_validator(theForm) {
	if (theForm.q.value.length < 3 || theForm.q.value=='' || theForm.q.value=='SKU# / Keyword' || theForm.q.value=='SKU#/Keyword'){
//		alert('Please enter your\n\nCredit Card Number.\n\n(Use only numbers)');
//		theForm.q.focus();
		return (false);
	}
	return (true);
}

function WriteSrcFrm(qry){
	document.write('<form action="/search.asp" method="get" name="mysearch" onsubmit="return src_validator(this);"><table border="0" cellpadding="0" cellspacing="0"><tr>');
	document.write('<td><input type="Text" name="q" size="16" maxlength="30" value="'+ qry +'" onfocus="javascript:document.mysearch.q.value=\'\';" style="color:#888888; border:1px solid #888888; background-color:#FFFFFF;padding-left:15px;padding-right:3px; background-image:url(\'/images/bg_src.gif\');background-repeat:no-repeat;"></td>');
	document.write('<td>&nbsp;</td><td valign="bottom"><button type="submit" class="fbuttonmini">search &rsaquo;</button></td>');
	document.write('</tr></table></form>');
}

function pop(prm){
	window.open('/pop_page.asp?id='+ escape(prm), escape(prm),'width=500, height=500, top=100, left=100, status=1, toolbar=0, directories=0, menubar=0, location=0, resizable=0, scrollbars=1');
}

function CalcSqFt(form){
	if (! allValidChars(form.fQuantity.value)) { 
		alert('Please use only numbers!');
		form.fQuantity.focus();
	} else {
		a0=eval(replace(form.MinArea.value, ',', ''));
		b0=eval(replace(form.fQuantity.value, ',', ''));
		c0=eval(replace(form.PricePerSQF.value, ',', ''));
		d0=a0*b0;
		e0=form.fSquareFt.value = replace(formatCurrency(d0.toFixed(2)), ',', '');
		f0=e0*c0;
		document.getElementById('cost').innerHTML = '$'+ formatCurrency(f0.toFixed(2));
	}
}

function CalcQty(form){
	if (! allValidChars(form.fSquareFt.value)) { 
		alert('Please use only numbers!');
		form.fSquareFt.focus();
	} else {
		a1=eval(replace(form.MinArea.value, ',', ''));
		b1=eval(replace(form.fSquareFt.value, ',', ''));
		c1=b1/a1;
		form.fQuantity.value = Math.round(c1.toFixed(2));
	}
}

function checkQty(form){
	if (! allValidChars(form.fQty.value)) { 
		alert('Please use only numbers!');
		form.fQty.focus();
		return (false);
	}
	return (true);
}

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num*100+0.50000000001);
		cents = num%100;
		num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
			num = num.substring(0,num.length-(4*i+3))+','+
			num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + '.' + cents);
}

function replace(s, t, u) {
	i = s.indexOf(t);
	r = "";
	if (i == -1) return s;
	r += s.substring(0,i) + u;
	if ( i + t.length < s.length) {
		r += replace(s.substring(i + t.length, s.length), t, u);
	}
	return r;
}

function allValidChars(myinfo) {
	var parsed = true;
	var validchars = "0123456789.";
	for (var i=0; i < myinfo.length; i++) {
		var letter = myinfo.charAt(i).toLowerCase();
		if (validchars.indexOf(letter) != -1)
		continue;
		parsed = false;
		break;
	}
	return parsed;
}

function ShowPic(ShownPic){
	if (document.getElementById) { // DOM3 = IE5, NS6 
		document.getElementById('PicLoading').style.display = 'block';
		document.getElementById('PicLoading').style.visibility = 'visible';
	} else {
		if (document.layers) { // Netscape 4 
			document.PicLoading.display = 'block';
			document.PicLoading.visibility = 'visible';
		} else { // IE 4 
			document.all.PicLoading.style.display = 'block';
			document.all.PicLoading.style.visibility = 'visible';
		}
	}
	var myWidth = 0, myHeight = 0, myImgWidth = 0, myImgHeight = 0;
	if ( typeof( window.innerWidth ) == 'number' ) {
	   //Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	   //IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	   //IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	myimage = new Image();
	myimage.src = '/images/p/i.aspx?s='+ ShownPic +'&w=750&h='+ (myHeight-50) +'&random=' + Math.random();
	myimage.onload = function() {
		myImgWidth = myimage.width;
		myImgHeight = myimage.height;
		if (document.getElementById) { // DOM3 = IE5, NS6 
			document.getElementById('PicLoading').style.display = 'none';
			document.getElementById('PicLoading').style.visibility = 'hidden';
			document.getElementById('PicBg').style.display = 'block';
			document.getElementById('PicBg').style.visibility = 'visible';
			document.getElementById('PicBg').style.left = ((myWidth-(myImgWidth+20))/2);
			document.getElementById('PicBg').style.width = (myImgWidth+20);
			document.getElementById('PicBg').style.height = (myImgHeight+20);
			document.getElementById('PicCon').style.display = 'block';
			document.getElementById('PicCon').style.visibility = 'visible';
			document.getElementById('PicCon').style.left = ((myWidth-(myImgWidth+24))/2);
			document.getElementById('PicCon').style.width = (myImgWidth+24);
			document.getElementById('PicCon').style.height = (myImgHeight+24);
			document.getElementById('PicCon').style.backgroundImage='url("'+ myimage.src +'")';
		} else { 
			if (document.layers) { // Netscape 4 
				document.PicLoading.display = 'none';
				document.PicLoading.visibility = 'hidden';
				document.PicBg.display = 'block';
				document.PicBg.visibility = 'visible';
				document.PicBg.left = ((myWidth-(myImgWidth+20))/2);
				document.PicBg.width = (myImgWidth+20);
				document.PicBg.height = (myImgHeight+20);
				document.PicCon.display = 'block';
				document.PicCon.visibility = 'visible';
				document.PicCon.left = ((myWidth-(myImgWidth+24))/2);
				document.PicCon.width = (myImgWidth+24);
				document.PicCon.height = (myImgHeight+24);
				document.PicCon.backgroundImage='url("'+ myimage.src +'")';
			} else { // IE 4 
				document.all.PicLoading.style.display = 'none';
				document.all.PicLoading.style.visibility = 'hidden';
				document.all.PicBg.style.display = 'block';
				document.all.PicBg.style.visibility = 'visible';
				document.all.PicBg.style.left = ((myWidth-(myImgWidth+20))/2);
				document.all.PicBg.style.width = (myImgWidth+20);
				document.all.PicBg.style.height = (myImgHeight+20);
				document.all.PicCon.style.display = 'block';
				document.all.PicCon.style.visibility = 'visible';
				document.all.PicCon.style.left = ((myWidth-(myImgWidth+24))/2);
				document.all.PicCon.style.width = (myImgWidth+24);
				document.all.PicCon.style.height = (myImgHeight+24);
				document.all.PicCon.style.backgroundImage='url("'+ myimage.src +'")';
			}
		} 
	}
}

function HidePic(){
	if (document.getElementById) { // DOM3 = IE5, NS6 
		document.getElementById('PicBg').style.display = 'none';
		document.getElementById('PicBg').style.visibility = 'hidden';
		document.getElementById('PicCon').style.display = 'block';
		document.getElementById('PicCon').style.visibility = 'hidden';
	} else {
		if (document.layers) { // Netscape 4 
			document.PicBg.display = 'none';
			document.PicBg.visibility = 'hidden';
			document.PicCon.display = 'none';
			document.PicCon.visibility = 'hidden';
		} else { // IE 4 
			document.all.PicBg.style.display = 'none';
			document.all.PicBg.style.visibility = 'hidden';
			document.all.PicCon.style.display = 'none';
			document.all.PicCon.style.visibility = 'hidden';
		}
	}
}

function Calculator(action){
	if (action='show') {
		if (document.getElementById) { // DOM3 = IE5, NS6 
			document.getElementById('calcBG').style.display = 'block';
			document.getElementById('calcBG').style.visibility = 'visible';
			document.getElementById('calc').style.display = 'block';
			document.getElementById('calc').style.visibility = 'visible';
		} else {
			if (document.layers) { // Netscape 4 
				document.calcBG.display = 'block';
				document.calcBG.visibility = 'visible';
				document.calc.display = 'block';
				document.calc.visibility = 'visible';
			} else { // IE 4 
				document.all.calcBG.style.display = 'block';
				document.all.calcBG.style.visibility = 'visible';
				document.all.calc.style.display = 'block';
				document.all.calc.style.visibility = 'visible';
			}
		}
	} else {
		if (document.getElementById) { // DOM3 = IE5, NS6 
			document.getElementById('calcBG').style.display = 'block';
			document.getElementById('calcBG').style.visibility = 'visible';
			document.getElementById('calc').style.display = 'block';
			document.getElementById('calc').style.visibility = 'visible';
		} else {
			if (document.layers) { // Netscape 4 
				document.calcBG.display = 'block';
				document.calcBG.visibility = 'visible';
				document.calc.display = 'block';
				document.calc.visibility = 'visible';
			} else { // IE 4 
				document.all.calcBG.style.display = 'block';
				document.all.calcBG.style.visibility = 'visible';
				document.all.calc.style.display = 'block';
				document.all.calc.style.visibility = 'visible';
			}
		}
	}
}

function showmeasure(show1,hide1) {
	document.getElementById('specs-'+ hide1).style.display = 'none';
	document.getElementById('specs-'+ hide1).style.visibility = 'hidden';
	document.getElementById('specs-'+ show1).style.display = 'block';
	document.getElementById('specs-'+ show1).style.visibility = 'visible';
}

function authorizenet() {
	document.write('<!-- (c) 2005, 2008. Authorize.Net is a registered trademark of CyberSource Corporation --><a href="https://verify.authorize.net/anetseal/?pid=b3c2ce1b-46c2-4bf2-a32e-0db189a4e982" target="_blank"><img src="/images/bt_seal_authorizenet.gif" border="0" width="70" height="50" alt="Authorize.Net Merchant - Click to Verify"></a>');
}
function ssl() {
	document.write('<scr' + 'ipt type="text/javascript" src="https://sealserver.trustwave.com/seal.js?style=normal"></sc' + 'ript>');
}

function RedirectToHomePage() { 
	window.location = "/"; 
}
