function validate()

{

	//var msg="You should fill all fields";

	//var flag=0;

	var msg="";

	if(document.getElementById('comNameTxt').value=="")

	{

		msg="Please enter the company name";

	}

	else if(document.getElementById('conDtailTxt').value=="")

	{

		msg="Please enter the contact details";

	}

	else if(document.getElementById('prodDtailTxt').value=="")

	{

		msg="Please enter the product details";

	}

	else if(document.getElementById('majClientTxt').value=="")

	{

		msg="Please enter the major clients";

	}

	else if(document.getElementById('commTxt').value=="")

	{

		msg="Please enter the comments";

	}

	if(msg!="")

	{

		alert(msg);

		return false;

	}

	

	var ajaxRequest;  // The variable that makes Ajax possible!

	

	try{

		// Opera 8.0+, Firefox, Safari

		ajaxRequest = new XMLHttpRequest();

	} catch (e){

		// Internet Explorer Browsers

		try{

			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");

		} catch (e) {

			try{

				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");

			} catch (e){

				// Something went wrong

				alert("Your browser broke!");

				return false;

			}

		}

	}

	// Create a function that will receive data sent from the server

	ajaxRequest.onreadystatechange = function(){

		if(ajaxRequest.readyState == 4){

			alert(ajaxRequest.responseText);

			document.getElementById('comNameTxt').value="";

			document.getElementById('conDtailTxt').value="";

			document.getElementById('prodDtailTxt').value="";

			document.getElementById('majClientTxt').value="";

			document.getElementById('commTxt').value="";

			//document.write(ajaxRequest.responseText);

		}

	}

	//to get the values of textfield control

	var val1 = document.getElementById('comNameTxt').value;

	var val2 = document.getElementById('conDtailTxt').value;

	var val3 = document.getElementById('prodDtailTxt').value;

	var val4 = document.getElementById('majClientTxt').value;

	var val5 = document.getElementById('commTxt').value;

	

	var dyes1= document.getElementById('dyes1Chk').checked;

	var dyes2= document.getElementById('dyes2Chk').checked;

	var dyes3= document.getElementById('dyes3Chk').checked;

	var dyes4= document.getElementById('dyes4Chk').checked;

	

	var chem1= document.getElementById('chem1Chk').checked;

	var chem2 = document.getElementById('chem2Chk').checked;

	var chem3 = document.getElementById('chem3Chk').checked;		



	var queryString = "?val1=" + val1 + "&val2=" + val2 + "&val3=" + val3 + "&val4=" + val4 + "&val5=" + val5 + "&dyes1=" + dyes1 + "&dyes2=" + dyes2 + "&dyes3=" + dyes3 + "&dyes4=" + dyes4 + "&chem1=" + chem1 + "&chem2=" + chem2 + "&chem3=" + chem3;

	

	//open & send request to server(contactMail.php)

	ajaxRequest.open("GET", "supplier_dyschemProc.php" + queryString, true);

	ajaxRequest.send(null); 



}


