function addShipping(txt) {
var x=document.forms[txt]
		mItems = x.quantity.value*2-2
	if (x.shipping1.value >= 0) {
		if (x.quantity.value > 1) {
			shiptotal = (x.shipping1.value * 1) + mItems
			total = (x.quantity.value * x.amount.value) + (x.shipping1.value * 1) + mItems
		}
		else {
			shiptotal = (x.shipping1.value)
			total = (x.quantity.value * x.amount.value) + (x.shipping1.value * 1)
		}
//	total = (x.shipping1.value*x.quantity.value+2)
	x.shipping.value = shiptotal
	x.shtotal.value = shiptotal + ".00"
	x.total.value = total + ".00"
	}
	else {
	x.shipping.value = ".00"
	x.shtotal.value = ".00"
	x.total.value = ".00"
	}
	//else {
	//return false
	//}
}

		

function SetShip (obj1) {  // record selected shipping option
	obj = document.tshirtForm.shipping1; // refer to shipping select
  //obj = document.tshirtForm.shipping1; // refer to shipping select
  pos = obj.selectedIndex; // get selection
  if (pos == 0) {          // force a selection
    alert ("Make a shipping selection!");
    return false
  }
}

function validateArtwork(obj1,txt){ // Validates all fields
x=document.forms[txt]
quantity=x.quantity.value

	if (quantity.length<1) {
	alert("Please enter a quantity")
	x.quantity.focus();
	return false
	}
//if (txt == '0') {

obj = document.forms[txt].shipping1;     // refer to shipping select
pos = obj.selectedIndex; // get selection
var item_name = false;
  
if (pos == 0) {          // force a selection
 alert ("Make a shipping selection!");
	 document.forms[txt].shipping1.focus();
 return false
}
 
if (txt == 'designsForm') {
os0=x.os0.value
os1=x.os1.value

	for (counter = 0; counter < x.item_name.length; counter++){
		// If a radio button has been selected it will return true
		// (If not it will return false)
		if (x.item_name[counter].checked) {
		item_name = true; 
		}
	}
	if (!item_name) {
	// If there were no selections made display an alert box 
	alert("Please choose pants or shorts")
	//x.item_name.focus();
//	location = "#pp";
	return (false);
	}

	if (os0.length<1) {
	 alert("Please enter a waist size")
	 x.os0.focus();
	 return false
	 }
 
	if (os1.length<1) {
	 alert("Please enter a length size")
	 x.os1.focus();
	 return false
	 }
	 
	if (x.item_name[0].checked) {
		if (os1.length<1) {
		 alert("Please enter your length")
		 x.os1.focus();
		 return false
		}
	 }
}
}

function validateTshirt(obj1,txt)
{
x=document.forms[txt]

//CD Validation
quantity=x.quantity.value 

if (quantity.length<1) {
 alert("Please enter a quantity")
 x.quantity.focus();
 return false
 }
 obj = x.os0;     // refer to shipping select
  pos = obj.selectedIndex; // get selection
  if (pos == 0) {          // force a selection
    alert ("Please choose a style!");
	 x.os0.focus();
    return false
  }
obj = x.os1;     // refer to shipping select
  pos = obj.selectedIndex; // get selection
  if (pos == 0) {          // force a selection
    alert ("Please choose a size!");
	 x.os1.focus();
    return false
  }
   /*obj = x.os2;     // refer to shipping select
  pos = obj.selectedIndex; // get selection
  if (pos == 0) {          // force a selection
    alert ("Please choose a color!");
	 x.os2.focus();
    return false
  }*/
obj = x.shipping1;     // refer to shipping select
  pos = obj.selectedIndex; // get selection
  if (pos == 0) {          // force a selection
    alert ("Make a shipping selection!");
	 x.shipping1.focus();
    return false
  }
}

function validatePhoto(obj1,txt)
{
x=document.forms[txt]

//CD Validation
quantity=x.quantity.value 

if (quantity.length<1) {
 alert("Please enter a quantity")
 x.quantity.focus();
 return false
 }
 obj = x.os0;     // refer to shipping select
  pos = obj.selectedIndex; // get selection
if (pos == 0) {          // force a selection
  alert ("Please choose a photo!");
	x.os0.focus();
  return false
  }
}