// JavaScript Document
var submitBtn = 0;
var Price = 0;

var Qty = 0;
var Total = 0;
var shipping =0;
var SalesTax = 0;
var rush  =0;
var OverSize = 0;
var PCDisc = 0;
var Discount = 0;
var DiscountCode = '';
var CouponCode = '';
var CouponDeal = '';
var CouponPCDisc = '';
var Coupon=0;
var Gift=0;
var Deal = "";
var Shp = "";

var Extra = new Array();
Extra["Monogram"]=0;
Extra["LessShirt"]=0;
Extra["WhiteCollarCuffs"]=0;
Extra["WhiteCollar"]=0;
Extra["WhiteCuffs"]=0;
Extra["TuxedoFront"]=0;
Extra["PleatedPocket"]=0;
Extra["PocketFlap"]=0;
Extra["TieDiscount"]=0;
Extra["SpecialDiscount"]=0;
Extra["Discount"]=0;
Extra["Coupon"]=0;
Extra["Gift"]=0;
Extra["Shipping"]=0;
Extra["ShirtOverSize"]=0;


var ProductsDeal =  "";
var ProductsDiscount =  0;
var ProductsPCDisc =  0;
var GCPCDisc = 0;
var ProductsShp =  0;
var ProductsFree =  0;
var ProductsPrice =  0;
var ProductsQty =  0;

var PantDetailDeal = "";
var PantDetailDiscount =  0;
var PantDetailPCDisc =  0;
var PantDetailShp =  0;
var PantDetailFree =  0;
var PantDetailPrice =  0;
var PantDetailQty =  0;
var PantDetailOverSize = 0;

var ShirtDeal =  "";
var ShirtDiscount =  0;
var ShirtPCDisc =  0;
var ShirtShp =  0;
var ShirtFree =  0;
var ShirtPrice =  0;
var ShirtQty =  0;
var ShirtOverSize = 0;

var HWSwatchesDeal =  "";
var HWSwatchesDiscount =  0;
var HWSwatchesPCDisc =  0;
var HWSwatchesShp =  0;
var HWSwatchesFree =  0;
var HWSwatchesPrice =  0;
var HWSwatchesQty =  0;
	ProductsQty = 0;
	ProductPrice = 0;

//----------------- Shipment Items ---------------
function CO(x){
	CountryL = "";
	for (U=0; U < document.frm.CountryL.length;U++){
		if (document.frm.CountryL[U].checked){
			CountryL = document.frm.CountryL[U].value ;
			if (CountryL=="Other") {
				$("#selCountry").show();
				$("#selState").hide();
				
				document.frm.Country.value = document.frm.cntry.value;
			} else {
				document.frm.Country.value = CountryL;
				document.frm.cntry.value = CountryL;
				$("#selCountry").hide();
			}
			break;
		}
	}
	
	if (document.frm.Country.value=="US") {
		$("#selState").show();
		x=0;
	} else {
		$("#selState").hide();
		x=1;
		document.frm.ShipMethod.value = "International Global Priority";
	}
	group = new Array();
	group[0] = new Array();
	group[1] = new Array();
	group[0][0]=new Option(" -- Please select --","");
	group[0][1]=new Option("USPS Priority","USPS Priority");
	group[0][2]=new Option("USPS Next Day","USPS Next Day");
	
	group[1][0]=new Option(" -- Please select --","");
	group[1][1]=new Option("International Global Priority","International Global Priority");
	//group[1][2]=new Option("FedEx 2-3 days","FedEx 2-3 days");
	for (m=document.frm.ShipMethod.options.length-1;m>0;m--) document.frm.ShipMethod.options[m]=null;
	for (i=0;i<group[x].length;i++)	document.frm.ShipMethod.options[i]=new Option(group[x][i].text,group[x][i].value);
//	document.frm.ShipMethod.options[0].selected=true;
}

//--------------------------------- Get Shipping Rates------------------------------------------

function GetShipping(Weight){
	if (Weight==0){
		return 0;	
	} else {
//		Weight = Math.ceil(Weight + 0.4);
//		if (Weight > 10) Weight = 11;
		if  (document.frm.ShipMethod.value=="USPS Next Day"){
			$("#ShippingDesc").html('<b>Shipment Method:</b> USPS Next Day (Takes 1 Days) ');
			Shps = Array(25,35,40,65,65,65,95,110,150,170,200,225,250);
		} else if (document.frm.ShipMethod.value=="International Global Priority"){
			$("#ShippingDesc").html('<b>Shipment Method:</b> (Takes 2 weeks)');
			Shps = Array(25,40,65,100,150,200,250,300,350,400,500);
		} else {
			$("#ShippingDesc").html('Shipment Method: USPS Priority (Takes 2-4 days) ');
			Shps = Array(9.5,13.5,16.5,23.5,23.5,23.5,29.5,32.5,35.5,37.5,39.5,40.5,55.5,60,65);
		}
		if (Weight > Shps.length) Weight = Shps.length;
		return Shps[Weight-1];
	}
}

function Disp(obj,val){
		if (navigator.appName == "Microsoft Internet Explorer"){
			this[obj].style.display = val;
   		}else{
			document.getElementById(obj).style.display = val;
   		}
}
// Fixing decimals to two digits
function zerozero(inp){
	inp = parseFloat(inp);
	return inp.toFixed(2);
}
//------- Calculating Totals ----------
function calctotal(){
	TaxAmt = 0;
	Qty = 0;
	ShirtQty = 0;
	Discount = 0;
	PantDetailQty = 0;
	ProductsQty = 0;
	TiesQty = 0;
	ProductPrice = 0;
	HWSwatchesQty = 0;
	Price = 0;
	PantDetailPrice = 0;
	ShirtPrice = 0;
	ProductsPrice = 0;
	TiesPrice = 0;
	HWSwatchesPrice = 0;
	shipping = 0;
	FreeShip = false;
	SalesTax = 0;
	GCPrice = 0;
	rush =0;
	Total = 0;
	OverSize = 0;
	Weight = 0;
Extra["Monogram"]=0;
Extra["LessShirt"]=0;
Extra["WhiteCollarCuffs"]=0;
Extra["WhiteCollar"]=0;
Extra["WhiteCuffs"]=0;
Extra["TuxedoFront"]=0;
Extra["PleatedPocket"]=0;
Extra["PocketFlap"]=0;
Extra["TieDiscount"]=0;
Extra["SpecialDiscount"]=0;
Extra["Discount"]=0;
Extra["Shipping"]=0;
Extra["ShirtOverSize"]=0;
Extra["Coupon"]= parseFloat(document.frm.Coupon.value);
Extra["Gift"] = parseFloat(document.frm.Gift.value);


//******************** Shirts ************************
	FromCat3 = 0;
	FromCat2 = 0;
	FreeShirts=0;
	ShirtTempDiscount = 0;
	CustomerID = document.frm.CustomerID.value;
	if (CustomerID=="") CustomerID = 0;
	var Shirts = Array();
	var Index = Array();
	Ji=0;
	OtherP = 0;
	PrevCollar = "";
	for (var Ii in Items){
	 Qty = parseInt(eval('document.frm.Qty' + Ii + '.options[document.frm.Qty' + Ii + '.selectedIndex].value')); 
	 Price =  parseFloat(eval('document.frm.UPO'+ Ii+'.value'));
	 if (Price >= 110) TaxAmt += Price * Qty;
		if (Items[Ii]['ProductTypeID']=='6'){
		 Index.push(Ii);
		 Shirts.push(Items[Ii]);
		 ShirtQty += Qty; 
		 if (Items[Ii]['Code'].substr(0,1)=='D') FromCat2 += Items[Ii]['Qty'];
		 if (Items[Ii]['Code'].substr(0,1)=='L') FromCat3 += Items[Ii]['Qty'];
		 if (Items[Ii]['Detail']['FrontStyle']!=undefined ){
	 		if (Items[Ii]['Detail']['CollarStyle']!=PrevCollar && PrevCollar!="") Extra['DiffCollar'] = 10;
			if (Items[Ii]['Detail']['MonoInitials']!="" && Items[Ii]['Detail']['Monogram']!="No Monogram") Extra['Monogram'] += Qty * 5;
			if (Items[Ii]['Detail']['WhiteCollar']!="" && Items[Ii]['Detail']['WhiteCuffs']!="") Extra['WhiteCollarCuffs'] += Qty * 7;
			if (Items[Ii]['Detail']['WhiteCollar']!="" && Items[Ii]['Detail']['WhiteCuffs']=="") Extra['WhiteCollar'] += Qty * 5;
			if (Items[Ii]['Detail']['WhiteCuffs']!="" && Items[Ii]['Detail']['WhiteCollar']=="")  Extra['WhiteCuffs'] += Qty * 5;
			if (Items[Ii]['Detail']['FrontStyle'].indexOf("pleat")!=-1)  Extra['TuxedoFront'] += Qty * 40;
			if (Items[Ii]['Detail']['PocketStyle'].indexOf("pleat")!=-1)  Extra['PleatedPocket'] += Qty * 3;
			if (Items[Ii]['Detail']['PocketStyle'].toLowerCase().indexOf("flap")!=-1) Extra['PocketFlap'] += Qty * 3;
			PrevCollar=Items[Ii]['Detail']['CollarStyle'];
		 }
		 
		Ji++;
		} else if (Items[Ii]['ProductTypeID']=='5'){
			Price =  parseFloat(eval('document.frm.UPO'+ Ii+'.value'));
			ItemDisc = 0;
			ExtraCharges = parseFloat(eval('document.frm.Extra'+Ii+'.value'));
			Amt = parseFloat((Price + ExtraCharges) * Qty);
			TiesPrice += Amt;

			TiesQty += Qty;
			wri('pri' + Ii , '$' + zerozero(Amt));
			OtherP++;			
		} else {
			Price =  parseFloat(eval('document.frm.UPO'+ Ii+'.value'));
			ItemDisc = 0;
			ExtraCharges = parseFloat(eval('document.frm.Extra'+Ii+'.value'));
			Amt = parseFloat((Price + ExtraCharges) * Qty);
			ProductPrice += Amt;
			ProductsQty += Qty;
			wri('pri' + Ii , '$' + zerozero(Amt));		
			OtherP++;
		}
	}
//	alert(Items[0].length);
	//---------- Find Deals ---------
	if (ShirtQty >= 5 && Deal=="" && ShirtDeal==""  && PCDisc==0 && ShirtPCDisc==0 && Coupon==0 && CouponPCDisc==0)  FreeShirts = parseInt(ShirtQty/5);
	if (ShirtQty >= 4 && (Deal=="Buy3" || ShirtDeal=="Buy3")  && PCDisc==0 && ShirtPCDisc==0 && Coupon==0 && CouponPCDisc==0)   FreeShirts = parseInt(ShirtQty/4);
	if (ShirtQty >= 3 && (Deal=="Buy2" || ShirtDeal=="Buy2")  && PCDisc==0 && ShirtPCDisc==0 && Coupon==0 && CouponPCDisc==0)   FreeShirts = parseInt(ShirtQty/3);
	if (ShirtQty >= 2 && (Deal=="Buy1" || ShirtDeal=="Buy1")  && PCDisc==0 && ShirtPCDisc==0 && Coupon==0 && CouponPCDisc==0)   FreeShirts = parseInt(ShirtQty/2);
	if ( (CouponDeal=="TB" || Deal=="TB") && PCDisc==0 && Coupon==0 && CouponPCDisc==0 && ShirtPCDisc==0 ) FreeShirts = 3;

	//--------- Making shirts free --------
	for (Ii=(Ji-1);Ii >= 0; Ii--){
		Qty =  parseInt(eval('document.frm.Qty'+Index[Ii]+'.options[document.frm.Qty'+Index[Ii]+'.selectedIndex].value'));
		Price =  parseFloat(eval('document.frm.UPO'+Index[Ii]+'.value'));
		ItemDisc = 0;
		ExtraCharges = parseFloat(eval('document.frm.Extra'+Index[Ii]+'.value'));
		Amt = (parseFloat(Price) + parseFloat(ExtraCharges)) * Qty;
		
//		ShirtQty += Qty;
		wri('BP' + Index[Ii],"$" + zerozero(Price));
		//--------- Discounts ------------
		if (FreeShirts > 0){
			if (Qty > FreeShirts){	//----- Make it Partially Free
				eval('ItemDisc =  parseFloat(document.frm.UPO'+Index[Ii]+'.value) * ' + FreeShirts + ' ;') ;	//----- WaveOff full shirt price
				FreeShirts = 0;
			} else {	//------ Free it
				eval('ItemDisc =  parseFloat(document.frm.UPO'+Index[Ii]+'.value) * Qty ;') ;	//----- WaveOff full shirt price
				FreeShirts -= Qty;
			}
		}
		if (CustomerID==0 && ShirtQty <=4 && Ii==(Index.length-1) && (CouponDeal=="$19" || Deal=="$19") && PCDisc==0 && Coupon==0 && CouponPCDisc==0 && ShirtPCDisc==0 ){	//----------- First time customers -----
			eval('ItemDisc =  parseFloat(document.frm.UPO'+Index[Ii]+'.value) - 19.95;') ;	//----- $19 a shirt
			wri('BP' + Index[Ii],'<span style="text-decoration:line-through;color:#f00">$' + zerozero(Price) + '</span>  &nbsp; $19.95');
		}
		eval('document.frm.Disc'+Index[Ii]+'.value = ItemDisc');	
//		alert(ItemDisc);	
		//------- Discount Done ----------
		DiscDiff = Amt - ItemDisc;
		ShirtPrice += DiscDiff;
//		wri('UP' + Index[Ii] ,(ItemDisc==0 ? '$' + zerozero(Price + Extra):'<div style=\"color:#FF0000; text-decoration:line-through\">$' + zerozero(Price + Extra) + '</div>' + (DiscDiff==0 ? '<div style=\"color:#0000FF\">FREE</div>':'<div>$' + zerozero(Price + Extra - ItemDisc) + '</div>') ));
		$("#pri"  + Index[Ii] ).html((ItemDisc==0 ? '$' + zerozero(Amt):'<div style=\"color:#FF0000; text-decoration:line-through\">$' + zerozero(Amt) + '</div>' + (DiscDiff==0 ? '<div style=\"color:#0000FF\">FREE</div>':'<div>$' + zerozero(DiscDiff) + '</div>')));
//		wri('pri' + Index[Ii] , (ItemDisc==0 ? '$' + zerozero(Amt):'<div style=\"color:#FF0000; text-decoration:line-through\">$' + zerozero(Amt) + '</div>' + (DiscDiff==0 ? '<div style=\"color:#0000FF\">FREE</div>':'<div>$' + zerozero(DiscDiff) + '</div>')));


	}	
	//------------ Shirts Over Size -----------------
	if (NeckSize!="" && ShirtPrice > 0){
		if (NeckSize!="") NeckSize = parseInt(NeckSize);
		if (Chest!="") Chest = parseInt(Chest);
		if (Sleeve!="") Sleeve = parseInt(Sleeve);
		if (SizeOption==5 ){
			if (NeckSize==19){
				Extra["ShirtOverSize"] = 15 * ShirtQty;	
			} else if (NeckSize==20){
				Extra["ShirtOverSize"] = 20 * ShirtQty;
			} else if (NeckSize==21){
				Extra["ShirtOverSize"] = 30 * ShirtQty;
			} else if (NeckSize==22){
				Extra["ShirtOverSize"] = 40 * ShirtQty;
			} else if (NeckSize==23){
				Extra["ShirtOverSize"] = 50 * ShirtQty;
			} else if (NeckSize > 23){
				Extra["ShirtOverSize"] = ShirtPrice * 0.1;
			}
		} else if (Chest!="") {
			if (Chest > 53 && Chest <= 59){
				Extra["ShirtOverSize"] = 15 * ShirtQty;		
			} else if (Chest > 59 && Chest < 65){				
				Extra["ShirtOverSize"] = 20 * ShirtQty;		
			} else if (Chest > 64){
				Extra["ShirtOverSize"] = 50 * ShirtQty;
			} else if (Sleeve  >37){
				Extra["ShirtOverSize"] = ShirtPrice * 0.1;
			}
		}		
	}
	//------------- Displaying for Fit Shirt ---
	if (ShirtQty >= 4 && CustomerID==''){
		Disp('ShirtFit','');
	} else {
		Disp('ShirtFit',"none");
	}	
	
	rush=0;
	if (document.frm.RushDescription.options[document.frm.RushDescription.options.selectedIndex].value=="2 weeks delivery" && (ShirtQty + ProductsQty) > 0){
		RQ = (ShirtQty + ProductsQty);
		if (RQ==1){
			rush += 20;	
		} else if (RQ==2){
			rush += 35;
		} else if (RQ==3 || RQ ==4){
			rush  += 40	
		} else if (RQ > 4 && RQ < 6){
			rush +=  45;
		} else {
			rush = 65 ;	
		}
	} 
Qty = ShirtQty + ProductsQty + TiesQty;
Price = ShirtPrice + ProductPrice + TiesPrice;
document.frm.OtherItem.value = (ProductPrice + TiesPrice);
	//-------------Discounts -----------------------

	if (ShirtPCDisc!=0){
		Extra['Discount'] = ShirtPrice * parseFloat(ShirtPCDisc)/100;	
		DiscountDesc = 'Custom shirts ' + ShirtPCDisc + '% discount';
	} else if (ShirtDiscount != 0){
		Extra['Discount'] = ShirtDiscount;	
		DiscountDesc = 'Custom shirts special discount';			
	}
	if (GCPCDisc!=0){
		Extra['Discount'] = ProductsPrice * parseFloat(GCPCDisc)/100;
		DiscountDesc =  'Gift Certificate ' + GCPCDisc + '% discount'			
	}
	if (PCDisc!=0){
		Extra['Discount'] = ShirtPrice * parseFloat(PCDisc)/100;	
		DiscountDesc = PCDisc + '% discount on custom shirts'
	}
	document.frm.Discount.value = 0;
	if (Extra['Discount']!=0){
		Extra['Discount'] = parseFloat(Extra['Discount']);
		if (Extra['Discount'] > 0) Extra['Discount'] = Extra['Discount'] * -1;
		$("#DiscountDesc").html(DiscountDesc);
		document.frm.Discount.value = Discount;
		document.frm.DiscountDesc.value = DiscountDesc;
	}
	
	if (TiesQty > 0 && ShirtQty > 0) Extra['TieDiscount'] = TiesPrice * 0.25 * (-1);

	//------- Shipping ------------
	Extra['Shipping'] = GetShipping(Qty);
	if (FreeShip==true){
		Extra["Shipping"] = 0;
	}
   	if (Shp=="FREE"){
		Extra["Shipping"] = 0;
	}
	//------ Calculating Extra Charges -----
	ExtraCharges = 0;
	for(J in Extra){
		if (Extra[J] != 0){
			$("#tr" + J).show();
			$("#" + J).html(zerozero(Extra[J]) );
		} else {
			$("#tr" + J).hide();
			$("#" + J).html('');
		}
		ExtraCharges += Extra[J];
		eval('document.frm.' + J + '.value = "' + Extra[J] + '"');
	}
//------------- End OverSize ---------------------------
Total = parseFloat(Price) + parseFloat(rush) + ExtraCharges	// + parseFloat(PantOverSize) 
//-------------------- ESTIMATING COUNTRY && STATE -------------------
	if (document.getElementById('Cntry0').checked){
		document.frm.Country.value = "US";
		Disp('selCountry','none');
		Disp('selState','');
	} else if (document.getElementById('Cntry3').checked==false){
		document.frm.Country.value  = (document.getElementById('Cntry1').checked ? document.getElementById('Cntry1').value : document.getElementById('Cntry2').value);
		Disp('selCountry','none');
		Disp('selState','none');
	} else if (document.getElementById('Cntry3').checked){
		Disp('selCountry','');
		document.frm.Country.value = document.frm.cntry.value;
		if (document.frm.cntry.value=="US" || document.frm.cntry.value=="United States"){
			Disp('selState','');
		} else {
			Disp('selState','none');			
		}
	}
	//-------------------- End Population -----------------------------------
	if (document.frm.State.value=="NY" && (document.frm.Country.value=="US" || document.frm.Country.value=="United States" ) && TaxAmt > 0){
		SalesTax = TaxAmt * 0.0875;
		SalesTax = SalesTax.toFixed(2);

		$("#SalesTaxDesc").html('Sales Tax (8.75%) on items which are above $110.00 &nbsp;');
		$("#SalesTax").html("&nbsp;$" + zerozero(SalesTax));
		$("#trSalesTax").show();
	} else {
		$("#trSalesTax").hide();
		$("#SalesTaxDesc").html('');
		$("#SalesTax").html('');
		SalesTax = 0;
	}

	Total += parseFloat(SalesTax);
	document.frm.ShirtOverSize.value = ShirtOverSize;
	document.frm.OverSize.value = ShirtOverSize;
	document.frm.TotalQty.value = ShirtQty + ProductsQty;
	document.frm.Rush.value = rush;
	document.frm.SalesTax.value = SalesTax;
	document.frm.Price.value = Price;
	document.frm.Amount.value = Total;
	
//	document.getElementById(obj).innerHTML = val ;
	$("#Rush").html("$"+zerozero(rush));
	$("#PriceDesc").html(" Total for "+(Qty)+" items&nbsp;");
	$("#Price").html("$" + zerozero(Price));
	$("#Amount").html("$" + zerozero(Total));
}
// ------------ Country/State work ----------	
function cv(inp,tf){
	if (tf==true){
		if (inp=="Other"){
			Disp('selCountry','');
			if (document.frm.cntry.value=="US"){
				Disp('selState','');
			} else {
				Disp('selState','none');				
			}
			document.frm.Country.value=document.frm.cntry.value;
		} else if (inp=="US" || inp=="United States"){
			Disp('selCountry','none');
			Disp('selState','');
			document.frm.Country.value="US";
		} else {
			Disp('selState','none');			
			Disp('selCountry','none');
//			CO(1);
			document.frm.Country.value=inp;
		}
	}
//	calctotal();
}
function cvc(inp){
		if (inp=="US" || inp=="United States"){
			Disp('selState','');
		} else {
			Disp('selState','none');
		}
		document.frm.Country.value = inp;
		calctotal();
}
function verifyemail(email) {
	if (email=="" || email.indexOf("@")==-1 || email.indexOf(".")==-1){
		return false;
	}
	email = email.toLowerCase();
	NotAllowed = Array("..",".@","@.","@@"," ",";" , ",");
	Allowed = Array("_","-","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",".","@");
	for (Ji=0;Ji< NotAllowed.length;Ji++){
		if (email.indexOf(NotAllowed[Ji])!=-1){	// Finds a character which is not allowed
			return false;
			break;
		}
	}	// --- Check . || @ is present either at the start || at the end
	if (email.substr(0,1)=="." || email.substr(0,1)=="@" || email.lastIndexOf(".")==(email.length-1) || email.lastIndexOf("@")==(email.length-1)){
		return false;	
	}
	TT = email.substring(email.indexOf("@")+1);
	if (TT.indexOf(".")==-1){ // Check . is not present after @
		return false;
	}
	if (TT.indexOf("@")!=-1){	// there are more than 1 @s in the email
		return false;
	}
	//-------------- Verify Allowed Characters --------------
	var found=false;
	for (Ji=0;Ji< email.length;Ji++){
		found = false;
		for (Ki=0;Ki< Allowed.length;Ki++){
			if (email.substr(Ji,1)==Allowed[Ki]){
				found=true;
				break;
			}
		}
		if (found==false){
			return false;
		}
	}
	//--------- If All tests above are OK then return true
	return true;
}

function validate(){
	if (submitBtn==3){
		if ((document.frm.Country.value=="US" || document.frm.Country.value=="United States") && document.frm.State.value==""){
			alert('Please select state before proceeding');
			document.frm.State.focus();
			return false;
		} else if (document.frm.ShipMethod.value==""){
			alert('Please select shipment method');
			document.frm.ShipMethod.focus();
			return false;
		} else if (document.frm.Email.value=="") {
			alert('Please write your email address');
			document.frm.Email.focus();
			 return false;
		} else if (document.frm.FirstName.value=="" || document.frm.LastName.value==""){
			alert('Please write your name');
			document.frm.FirstName.focus();
			 return false;
		} else if (document.frm.HomePhone.value==""){
			alert('Please write your phone number');
			document.frm.HomePhone.focus();
			 return false;
		} else if (document.frm.BestTime.value==""){
			alert('Please write best time to call');
			document.frm.BestTime.focus();
			 return false;
		} else if (verifyemail(document.frm.Email.value)==false){
			alert('The email address is not valid. Please write correct email address');
			document.frm.Email.focus();
			 return false;
		}
		if(document.frm.FitPant != undefined && CustomerID=='' && PantDetailQty >= 3){
				 if(document.frm.FitPant[0].checked==false && document.frm.FitPant[1].checked==false){
				  alert('Please select one of the Fit Pant options');
					 document.frm.FitPant[0].focus();
					 return false;
				 }
		} 
		if(document.frm.FitShirt != undefined && CustomerID=='' && ShirtQty >= 4){
				 if(document.frm.FitShirt[0].checked==false && document.frm.FitShirt[1].checked==false){
				  alert('Please select one of the Fit Shirt options');
					 document.frm.FitShirt[0].focus();
					 return false;
				 }
		}
	}
	return true;
}

