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_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 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 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 nameCheck()
{
    var q1 = document.join.name.value;
    var q2 = document.join.email.value;

	if ( q1 == null || q1 == "" )
    {
        alert("Please enter - Name");
		return;
    }
	if ( q2 == null || q2 == "" )
    {
        alert("Please enter - Email");
		return;
    }

	document.join.submit();
}

function nameCheck2()
{
    var q1 = document.order.name.value;
    var q2 = document.order.email.value;
    var q3 = document.order.phone.value;
	
	getTotal();

    if ( q1 == null || q1 == "" )
    {
        alert("Please enter - Name");
		return;
    }
    else if ( q2 == null || q2 == "" )
    {
        alert("Please enter - Email");
		return;
    }
    else if ( q3 == null || q3 == "" )
    {
        alert("Please enter - Phone");
		return;
    }
	else if (isInteger(qty))
	{
        alert("All orders must be in multiples of 12 for shipping.");
		return;
	}
	
	document.order.submit();
}

function isInteger(s)
{
      var i;
	  s = "" + s;
      if (isEmpty(s))
      if (isInteger.arguments.length == 1) return 0;
      else return (isInteger.arguments[1] == true);

      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);

         if (!isDigit(c)) return true;
      }

      return false;
}

function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}

function isDigit (c)
{
	return ((c >= "0") && (c <= "9"))
}


var qty = 0;
function getTotal()
{
	var total = 0;
	var deposit = 0;
	var deposit_price = 0.1;
	var grand_total = 0;
	
	var qty1 = document.order.qty1.value;
	if ( qty1 == null || qty1 == "" )
    {
        qty1 = 0;
    }
	var price1 = 19.90;
	
	document.order.total1.value = Math.round(qty1*price1*100)/100;
	
	var qty2 = document.order.qty2.value;
	if ( qty2 == null || qty2 == "" )
    {
        qty2 = 0;
    }
	var price2 = 19.90;
	
	document.order.total2.value = Math.round(qty2*price2*100)/100;
	
	var qty3 = document.order.qty3.value;
	if ( qty3 == null || qty3 == "" )
    {
        qty3 = 0;
    }
	var price3 = 31.90;
	
	document.order.total3.value = Math.round(qty3*price3*100)/100;
	
	var qty4 = document.order.qty4.value;
	if ( qty4 == null || qty4 == "" )
    {
        qty4 = 0;
    }
	var price4 = 24.90;
	
	document.order.total4.value = Math.round(qty4*price4*100)/100;
	
	var qty5 = document.order.qty5.value;
	if ( qty5 == null || qty5 == "" )
    {
        qty5 = 0;
    }
	var price5 = 34.00;
	
	document.order.total5.value = Math.round(qty5*price5*100)/100;
	
	var qty6 = document.order.qty6.value;
	if ( qty6 == null || qty6 == "" )
    {
        qty6 = 0;
    }
	var price6 = 75.00;
	
	document.order.total6.value = Math.round(qty6*price6*100)/100;

	var qty7 = document.order.qty7.value;
	if ( qty7 == null || qty7 == "" )
    {
        qty7 = 0;
    }
	var price7 = 22.90;
	
	document.order.total7.value = Math.round(qty7*price7*100)/100;
	
	var qty8 = document.order.qty8.value;
	if ( qty8 == null || qty8 == "" )
    {
        qty8 = 0;
    }
	var price8 = 24.90;
	
	document.order.total8.value = Math.round(qty8*price8*100)/100;	
	
	var qty9 = document.order.qty9.value;
	if ( qty9 == null || qty9 == "" )
    {
        qty9 = 0;
    }
	var price9 = 21.90;
	
	document.order.total9.value = Math.round(qty9*price9*100)/100;	

	var qty10 = document.order.qty10.value;
	if ( qty10 == null || qty10 == "" )
    {
        qty10 = 0;
    }
	var price10 = 28.90;
	
	document.order.total10.value = Math.round(qty10*price10*100)/100;	

	var qty11 = document.order.qty11.value;
	if ( qty11 == null || qty11 == "" )
    {
        qty11 = 0;
    }
	var price11 = 28.90;
	
	document.order.total11.value = Math.round(qty11*price11*100)/100;	

	total = 0 + qty1*price1 + qty2*price2 + qty3*price3 + qty4*price4 + qty5*price5 + qty6*price6 + qty7*price7 + qty8*price8 + qty9*price9 + qty10*price10 + qty11*price11;
	
	deposit = 0 + qty1*deposit_price + qty2*deposit_price + qty3*deposit_price + qty4*deposit_price + qty5*deposit_price + qty6*deposit_price + qty7*deposit_price + qty8*deposit_price + qty9*deposit_price + qty10*deposit_price + qty11*deposit_price;
	
	qty = 0 + parseInt(qty1) + parseInt(qty2) + parseInt(qty3) + parseInt(qty4) + parseInt(qty5) + parseInt(qty6) + parseInt(qty7) + parseInt(qty8) + parseInt(qty9) + parseInt(qty10) + parseInt(qty11);
	
	qty = qty/12;
	grand_total = total + deposit;
				
	document.order.total.value = Math.round(total*100)/100;
	document.order.deposit.value = Math.round(deposit*100)/100;
	document.order.grand_total.value = Math.round(grand_total*100)/100;
}

