<!--

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 6;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------


// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}



function MM_findObj(n, d) { // v4.01  
  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 && d.getElementById) x=d.getElementById(n); return x;  
}


function flvFSL1(){//v2.3
// Copyright 2002-2004, Marja Ribbers-de Vroed, FlevOOware (www.flevooware.nl/dreamweaver/)
var v1=arguments,v2=v1[0],v3=MM_findObj(v2),v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18,v19,v20=window,v21=navigator;if (v3){v4=parseInt(v1[1]);v5=parseInt(v1[2]);v6=parseInt(v1[3]);v7=(v1.length>4)?parseInt(v1[4]):0;v8=(v1.length>5)?parseInt(v1[5]):0;v9=10;v10=document.layers?v3:v3.style;if (v3.SL1!=null){clearTimeout(v3.SL1);}v11=isNaN(parseInt(v10.left))?v3.offsetLeft:parseInt(v10.left);v12=isNaN(parseInt(v10.top))?v3.offsetTop:parseInt(v10.top);if (v8!=0){if (v8==1){v4=v11-v4;v5=v12;}else if (v8==2){v4=v11+v4;v5=v12;}else if (v8==3){v5=v12-v5;v4=v11;}else {v5=v12+v5;v4=v11;}}v13=v4;v14=v5;if ((v11!=v4)||(v12!=v5)){if (v7>0){v9=v6;v15=v7;v16=v7,v17=Math.abs(v11-v4),v18=Math.abs(v12-v5);if (v17<v18){v16=(v17!=0)?((v18/v17)*v7):v7;}else {v15=(v18!=0)?((v17/v18)*v7):v7;}if (v15>=v17){v15=Math.min(Math.ceil(v15),v7);}if (v16>=v18){v16=Math.min(Math.ceil(v16),v7);}if ((v11<v4)&&(v11+v15<v4)){v4=v11+v15;}if ((v11>v4)&&(v11-v15>v4)){v4=v11-v15;}if ((v12<v5)&&(v12+v16<v5)){v5=v12+v16;}if ((v12>v5)&&(v12-v16>v5)){v5=v12-v16;}}else {v17=((v4-v11)/v6);v18=((v5-v12)/v6);v17=(v17>0)?Math.ceil(v17):Math.floor(v17);v4=v11+v17;v18=(v18>0)?Math.ceil(v18):Math.floor(v18);v5=v12+v18;}v19=((parseInt(v21.appVersion)>4||v21.userAgent.indexOf("MSIE")>-1)&&(!v20.opera))?"px":"";if (v17!=0){v10.left=v4+v19;}if (v18!=0){v10.top=v5+v19;}var v22="flvFSL1('"+v2+"',"+v13+","+v14+","+v6+","+v7+",0)";v3.SL1=setTimeout(v22,v9);}else {if (v20.onSlideEnd){onSlideEnd(v2);}}}}


		
function loadMenu()
{
setTimeout("flvFSL1('nav_home',120,500,10)",500);	
//flvFSL1('nav_home',120,500,10);
}

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_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 doFocus(element)
{
	if(document.getElementById(element).value > '') { document.getElementById(element).value='';}
	else { document.getElementById(element).value='1'; }	
document.getElementById(element).focus();	
}

function fixActivate(object)
{
	 theObjects = document.getElementsByTagName(object);
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}

}



function hideLayer(layername)
{
document.getElementById(layername).style.display = "none";	
}

function showLayer(layername)
{
document.getElementById(layername).style.display = "block";			
}


function copyToShip()
{
document.forms.shipform.ship_name_first.value = document.forms.shipform.order_name_first.value;	
document.forms.shipform.ship_name_last.value = document.forms.shipform.order_name_last.value;	
document.forms.shipform.ship_email.value = document.forms.shipform.order_email.value;	
document.forms.shipform.ship_phone.value = document.forms.shipform.order_phone.value;	
document.forms.shipform.ship_add1.value = document.forms.shipform.order_add1.value;
document.forms.shipform.ship_add2.value = document.forms.shipform.order_add2.value;
document.forms.shipform.ship_city.value = document.forms.shipform.order_city.value;
document.forms.shipform.ship_zip.value = document.forms.shipform.order_zip.value;
document.forms.shipform.ship_state.selectedIndex = document.forms.shipform.order_state.selectedIndex;
document.forms.shipform.ship_country.selectedIndex = document.forms.shipform.order_country.selectedIndex;

}




function validateShipping(theForm) {
    var why = "";
    //ups method
    why += checkDropdown(theForm.ups_service.selectedIndex,"You must choose a UPS shipping method.\n");
    //billing info
    why += isEmpty(theForm.order_name_first.value,"You must enter a billing first name.\n");
    why += isEmpty(theForm.order_name_last.value,"You must enter a billing last name.\n");
    why += checkEmail(theForm.order_email.value);
    why += isEmpty(theForm.order_add1.value,"You must enter a billing street address.\n");
    why += isEmpty(theForm.order_city.value,"You must enter a billing city.\n");
    
    //if country == US check state
    if(checkDropdown(theForm.order_country.selectedIndex,"United States"))
    {
    why += checkDropdown(theForm.order_state.selectedIndex,"You must choose a billing state.\n");
    }
    why += isEmpty(theForm.order_zip.value,"You must enter a billing postal (zip) code.\n");
   // why += checkDropdown(theForm.order_country.selectedIndex,"You must choose a billing country.\n");
    /*shipping info
    why += isEmpty(theForm.ship_name_first.value,"You must enter a shipping first name.\n");
    why += isEmpty(theForm.ship_name_last.value,"You must enter a shipping last name.\n");
    why += checkEmail(theForm.ship_email.value);
    why += isEmpty(theForm.ship_add1.value,"You must enter a shipping street address.\n");
    why += isEmpty(theForm.ship_city.value,"You must enter a shipping city.\n");
    why += checkDropdown(theForm.ship_state.selectedIndex,"You must choose a shipping state.\n");
    why += isEmpty(theForm.ship_zip.value,"You must enter a shipping zip code.\n");
    why += checkLength(theForm.ship_zip.value,5,10,"Shipping zip code must be 5 digits or zip+4 format.\n");
    why += checkDropdown(theForm.ship_country.selectedIndex,"You must choose a shipping country.\n");
    */
    why += checkUPS(theForm.ups_service.options[theForm.ups_service.selectedIndex].value,theForm.ship_country.options[theForm.ship_country.selectedIndex].value,"You must choose a domestic UPS service if shipping within the US.\n");
		
		if (why != "") {
	       alert(why);
	       return false;
		}
	return true;
}



function continueShopping(link)
{	
this.location=link;	
}


function validateCart(qstr)
{
qar = new Array();
qar=qstr.split(",");
x = qar.length;

result = false;

for (x in qar)
{
	if(document.getElementById(qar[x]).value > '') { result=true; }
}

if(result == false){ alert('You must click the button by the product and choose a quantity to add it to your order.'); }

return result;
}


function validatePayment()
{
result = true;
	
cc = document.getElementById("cardnum").value;
r = cardval(cc);


if (r == false) {
alert('Credit Card Number is invalid or was not entered.'); 
document.getElementById("cardnum").focus();
//document.getElementById("cardnum").style="border:solid 3px red;";
return false;}


if(document.getElementById("CVV2").value == ''){
alert('Security Code from the back of the card must be entered.'); 
//document.getElementById("CVV2").style="border:solid 3px red;";
document.getElementById("CVV2").focus();
return false;}

return result;

}

//-->

