﻿
//Drop Downs
function CheckDropDown()
{
	if(document.form.p1.selectedIndex==0)
	{
	alert("Please select an option from the drop-down list");
	document.form.p1.focus();
	return(false);
	}
	{
	return(true);
}
}
//**************************************************************************************************

// bags
function CheckCheckBox(frm)
  {
      if (!frm.p1.checked){
      frm.p1.focus();
      alert("Please select the Embroidery Service check box first.");
      }
       
  }


function clearembroidery(frm)
	{
	if (!frm.p1.unchecked)
		frm.p2.value="";
		frm.p2.focus();		
	}	
	
function ValidateFrm(frm)
	{
	if (frm.p1.checked)
	{
		if (frm.p2.value.length <= 0)
		{
		alert("Please enter a name to be embroidered!");
		return(false);
		
		} 
		else {frm.submit() }
	} else {frm.submit()}
}			
// end bags
//*************************************************************************************

function popup(url){
  cuteLittleWindow = window.open(url, "littleWindow", "location=no,width=320,height=330",scrollbars=1); 
}
//*************************************************************************************
//armbands
function CheckArmband()
{ 
 var armyn;
 if (document.form.Qty.value < 2)
{ 
armyn=confirm("Armbands are sold individually - NOT IN PAIRS.  You have attempted to order 1 single armband.  \n\t To add the 1 armband to the shopping cart, please click 'OK' below.  \n\t To add 2 armbands to the cart please select 'Cancel'.");
if (armyn == true)
		{ 
		return true;
		}
	else
		{
		document.form.Qty.value=2;
		return true;
		}
}
 
 }
 //***********************************************************************
//Packages
function makepn()
{
var partnumber = null;
var tempPart = "-";
var tempPart1 = null;
var tempPart2 = null;
{
	switch(document.form.p1.value)
	{
		case '44':tempPart1 = "44";break;
		case '46':tempPart1 = "46";break;
		case '48':tempPart1 = "48";break;
		case '50':tempPart1 = "50";break;
		case '52':tempPart1 = "52";break;
		case '54':tempPart1 = "54";break;
		case '56':tempPart1 = "56";break;
		case 'X-Small':tempPart1 = "XS";break;
		case 'Small':tempPart1 = "S";break;
		case 'Medium':tempPart1 = "M";break;
		case 'Large':tempPart1 = "L";break;
		case 'X-Large':tempPart1 = "XL";break;
		case 'XX-Large':tempPart1 = "XXL";break;
		default:tempPart = "";break;
	}
}
	
switch(document.form.p2.value)
{
	case 'Small':tempPart2 = "S";break;
	case 'Medium':tempPart2 = "M";break;
	case 'Large':tempPart2 = "L";break;
	case 'X-Large':tempPart2 = "XL";break;
	case 'XX-Large':tempPart2 = "XXL";break;
}
partnumber = tempPart + tempPart1 + "-" + tempPart2;	
document.form.PartNo.value += partnumber;
return true

}

