// JavaScript Document

function times(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_1.value.split('|');

 if(window.document.checkprint.bullname_1.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total1.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_1.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_1.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_1.value = 0;
  }
  
 if(window.document.checkprint.num_straws_1.value == '') window.document.checkprint.num_straws_1.value = 0;
}

function times2(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_2.value.split('|');

 if(window.document.checkprint.bullname_2.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total2.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_2.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_2.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_2.value = 0;
  }
  
 if(window.document.checkprint.num_straws_2.value == '') window.document.checkprint.num_straws_2.value = 0;
}

function times3(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_3.value.split('|');

 if(window.document.checkprint.bullname_3.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total3.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_3.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_3.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_3.value = 0;
  }
  
 if(window.document.checkprint.num_straws_3.value == '') window.document.checkprint.num_straws_3.value = 0;
}

function times4(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_4.value.split('|');

 if(window.document.checkprint.bullname_4.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total4.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_4.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_4.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_4.value = 0;
  }
  
 if(window.document.checkprint.num_straws_4.value == '') window.document.checkprint.num_straws_4.value = 0;
}

function times5(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_5.value.split('|');

 if(window.document.checkprint.bullname_5.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total5.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_5.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_5.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_5.value = 0;
  }
  
 if(window.document.checkprint.num_straws_5.value == '') window.document.checkprint.num_straws_5.value = 0;
}

function times6(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_6.value.split('|');

 if(window.document.checkprint.bullname_6.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total6.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_6.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_6.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_6.value = 0;
  }
  
 if(window.document.checkprint.num_straws_6.value == '') window.document.checkprint.num_straws_6.value = 0;
}

function times7(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_7.value.split('|');

 if(window.document.checkprint.bullname_7.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total7.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_7.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_7.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_7.value = 0;
  }
  
 if(window.document.checkprint.num_straws_7.value == '') window.document.checkprint.num_straws_7.value = 0;
}

function times8(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_8.value.split('|');

 if(window.document.checkprint.bullname_8.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total8.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_8.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_8.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_8.value = 0;
  }
  
 if(window.document.checkprint.num_straws_8.value == '') window.document.checkprint.num_straws_8.value = 0;
}

function times9(straw)
{
 var count;
 var brokeme = window.document.checkprint.strawprice_9.value.split('|');

 if(window.document.checkprint.bullname_9.value != "None|0") 
 {
	 if(straw == parseFloat(straw))
	   { 
		 count = parseFloat(straw) * parseFloat(brokeme[1]);
		 window.document.checkprint.total9.value = count;
		 total();
	   }
	   
	 if(straw != parseFloat(straw)) 
	   {
		 alert('please enter a numeric value.');
		 window.document.checkprint.num_straws_9.value = 0;
	   }
 }
 
 if(window.document.checkprint.bullname_9.value == "None|0") 
 {
	 alert('please enter an item name first.');
	 window.document.checkprint.num_straws_9.value = 0;
  }
  
 if(window.document.checkprint.num_straws_9.value == '') window.document.checkprint.num_straws_9.value = 0;
}


//***					-----					***//

function total()
{
	window.document.checkprint.subtotal.value = parseFloat(window.document.checkprint.total1.value) +  parseFloat(window.document.checkprint.total2.value) +  parseFloat(window.document.checkprint.total3.value) +  parseFloat(window.document.checkprint.total4.value) +  parseFloat(window.document.checkprint.total5.value) + parseFloat(window.document.checkprint.total6.value) +  parseFloat(window.document.checkprint.total7.value) +  parseFloat(window.document.checkprint.total8.value) + parseFloat(window.document.checkprint.total9.value)
	
	check_shipping();
	total_enclosed();
}

function total_enclosed()
{
	check_shipping();
	window.document.checkprint.totalenclosed.value = parseFloat(window.document.checkprint.subtotal.value) + parseFloat(window.document.checkprint.shipping.value);
}

function check_shipping()
{
	if(window.document.checkprint.shipping.value == '')	window.document.checkprint.shipping.value = 0;
	if(window.document.checkprint.shipping.value != parseFloat(window.document.checkprint.shipping.value))
	{
		alert("please enter a numeric value");
		window.document.checkprint.shipping.value = 0;
	}
}

//***					-----					***//

function bullchange1(bullname,bullprice)
{
	if(bullname != '')	
	{  
		window.document.checkprint.strawprice_1.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_1.value = 0;	
	}
	if(bullprice != '')	
	{	
		window.document.checkprint.bullname_1.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_1.value = 0;	
	}
	
	var brokeme = window.document.checkprint.strawprice_1.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_1.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total1.value = count;
	total();

}

function bullchange2(bullname,bullprice)
{
	if(bullname != '')
	{
		window.document.checkprint.strawprice_2.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_2.value = 0;	
	}
	if(bullprice != '')	
	{
		window.document.checkprint.bullname_2.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_2.value = 0;	
	}
	
	var brokeme = window.document.checkprint.strawprice_2.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_2.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total2.value = count;
	total();

}

function bullchange3(bullname,bullprice)
{
	if(bullname != '')	{
		window.document.checkprint.strawprice_3.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_3.value = 0;	
	}
	if(bullprice != '')	{
		window.document.checkprint.bullname_3.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_3.value = 0;	
	}
	var brokeme = window.document.checkprint.strawprice_3.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_3.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total3.value = count;
	total();

}

function bullchange4(bullname,bullprice)
{
	if(bullname != '')	{
		window.document.checkprint.strawprice_4.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_4.value = 0;	
	}
	if(bullprice != '')	{
		window.document.checkprint.bullname_4.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_4.value = 0;	
	}
	var brokeme = window.document.checkprint.strawprice_4.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_4.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total4.value = count;
	total();

}

function bullchange5(bullname,bullprice)
{
	if(bullname != ''){
		window.document.checkprint.strawprice_5.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_5.value = 0;	
	}
	if(bullprice != ''){
		window.document.checkprint.bullname_5.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_5.value = 0;	
	}	
	var brokeme = window.document.checkprint.strawprice_5.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_5.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total5.value = count;
	total();
	
}

function bullchange6(bullname,bullprice)
{
	if(bullname != ''){
		window.document.checkprint.strawprice_6.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_6.value = 0;	
	}
	if(bullprice != ''){
		window.document.checkprint.bullname_6.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_6.value = 0;	
	}
	var brokeme = window.document.checkprint.strawprice_6.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_6.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total6.value = count;
	total();

}

function bullchange7(bullname,bullprice)
{
	if(bullname != ''){
		window.document.checkprint.strawprice_7.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_7.value = 0;	
	}
	if(bullprice != ''){
		window.document.checkprint.bullname_7.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_7.value = 0;	
	}
	var brokeme = window.document.checkprint.strawprice_7.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_7.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total7.value = count;
	total();

}

function bullchange8(bullname,bullprice)
{
	if(bullname != ''){
		window.document.checkprint.strawprice_8.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_8.value = 0;	
	}
	if(bullprice != ''){
		window.document.checkprint.bullname_8.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_8.value = 0;	
	}
	var brokeme = window.document.checkprint.strawprice_8.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_8.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total8.value = count;
	total();

}

function bullchange9(bullname,bullprice)
{
	if(bullname != ''){
		window.document.checkprint.strawprice_9.value = bullname;
		if(bullname == "None|0") window.document.checkprint.num_straws_9.value = 0;	
	}
	if(bullprice != ''){
		window.document.checkprint.bullname_9.value = bullprice;
		if(bullprice == "None|0") window.document.checkprint.num_straws_9.value = 0;	
	}
	var brokeme = window.document.checkprint.strawprice_9.value.split('|'); 
	var count ;
	count = parseFloat(window.document.checkprint.num_straws_9.value) * parseFloat(brokeme[1]);
    window.document.checkprint.total9.value = count;
	total();

}

