function addUnits(F)
{		
				F.average_current.value+=F.c_ave.options[F.c_ave.selectedIndex].text;
				F.peak_current.value+=F.c_peak.options[F.c_peak.selectedIndex].text;		
				F.minimum_current.value+=F.c_min.options[F.c_min.selectedIndex].text;				
				F.cell_capacity.value+=F.capacity.options[F.capacity.selectedIndex].text;				
				F.charging_rate.value+=F.charge_rate.options[F.charge_rate.selectedIndex].text;				
				F.time_between_charges.value+=F.charge_time.options[F.charge_time.selectedIndex].text;			
				F.lifetime.value+=F.life.options[F.life.selectedIndex].text;				
				F.weight.value+=F.weight_units.options[F.weight_units.selectedIndex].text;				
				F.volume.value+=F.volume_units.options[F.volume_units.selectedIndex].text;			
				F.battery_price.value=F.battery_currency.options[F.battery_currency.selectedIndex].text + F.battery_price.value;				
				F.charger_price.value=F.charger_currency.options[F.charger_currency.selectedIndex].text + F.charger_price.value;				
				F.system_price.value=F.system_currency.options[F.system_currency.selectedIndex].text + F.system_price.value;								
}

function validate(F)
{
			
			if ((F.needSender.value=="true")&&(F.sender.value==''))
				{
				alert('   We need your name to be\n able to complete this request')
				return
				}	
			if ((F.needCompany.value=="true")&&(F.company.value==''))
				{
				alert(' We need your company name to be\n able to complete this request')
				return
				}	
			if ((F.needDest.value=="true")&&(F.dest.value==''))
				{
				alert('We need the name of the recipient \n   to be able to complete this request')
				return
				}	
			if (((F.needPhone.value=="true")&&(F.phone.value.length>18))||((F.needPhone.value=="true")&&(F.phone.value.length<9)))
				{
				alert('We need a valid telephone number \n       to be able to contact you')
				return			
				}
			if (F.needPhone.value=="true")
				{
				for (var k=0; k<F.phone.value.length; k++)	
				{
				digit=false
				var c=F.phone.value.substring(k,k+1);
				if (c=="0"||c=="1"||c=="2"||c=="3"||c=="4"||c=="5"||c=="6"||c=="7"||c=="8"||c=="9"||c==" "||c=="-"||c=="+"||c=="("||c==")")
					{	
					digit=true 
					}	
					else if (digit==false)
						{
						alert('We need a valid telephone number \n       to be able to contact you')
						return
						}
				}
				}
			if((F.needMailfrom.value=="true")&&(F.email.value==''))
				{
				alert('We need your e-mail address \n     to complete this request')
				return
				}
				if((F.needMailto.value=="true")&&(F.mailto.value==''))
				{
				alert("We need the recipient's e-mail address\n        to complete this request")
				return
				}
			else if((F.needMailfrom.value=="true")&&((F.email.value!='')&&((F.email.value.indexOf('@')<1)||(F.email.value.indexOf('.',F.email.value.indexOf('@'))<F.email.value.indexOf('@')+2)||(F.email.value.indexOf(' ')!=-1)||(F.email.value.charAt(6)==''))))
			    {
 	            alert("The sender's e-mail address is invalid\n       Please check it and try again")
	            return
				}
			else if((F.needMailto.value=="true")&&((F.mailto.value!='')&&((F.mailto.value.indexOf('@')<1)||(F.mailto.value.indexOf('.',F.mailto.value.indexOf('@'))<F.mailto.value.indexOf('@')+2)||(F.mailto.value.indexOf(' ')!=-1)||(F.mailto.value.charAt(6)==''))))
			    {
 	            alert("The recipient's e-mail address is invalid\n         Please check it and try again")
	            return
				}
				if (F.needModify.value=="true")		
				{
				addUnits(F)
				}
				if (F.formType.value=="charger")		
				{
				F.cell_capacity.value+=F.capacity.options[F.capacity.selectedIndex].text;
				F.maximum_current.value+=F.c_ave.options[F.c_ave.selectedIndex].text;
				F.inrush_current.value+=F.c_peak.options[F.c_peak.selectedIndex].text;	
				F.charging_time.value+=F.time.options[F.time.selectedIndex].text;
				}
				F.submit()
}

