function validate_contact(theForm)
{
	var errMesg = "";
	var diplayMesg = ""
	var Q = ""; // this block determines lifespan of Q
	
	if (isWhitespace(theForm.company.value))
	{
		Q += " Company Name\n";
	}
	if (isWhitespace(theForm.contactperson.value))
	{
		Q += " Contact Person\n";
	}
	if (isWhitespace(theForm.address.value))
	{
		Q += " Address\n";
	}
	if (isWhitespace(theForm.city.value))
	{
		Q += " City\n";
	}
	if (isWhitespace(theForm.zipcode.value))
	{
		Q += " Zip Code\n";
	}
	if (isWhitespace(theForm.state.value))
	{
		Q += " State\n";
	}
	if (theForm.country.value==0)
	{
		Q += " Country\n";
	}
	if (isWhitespace(theForm.email.value))
	{
		Q += " Email\n";
	}
	else if(echeck(theForm.email.value))
	{
	   errMesg += "Invalid Email Address.\n";
	}	
	else if(!isCharsInBag(theForm.email.value, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@._-"))
	{
	  errMesg += "Email Address contains Invalid Characters.\n";
	}
	if (theForm.telephone.value==0)
	{
		Q += " Telephone\n";
	}
	else if(isNaN(theForm.telephone.value))
	{
		Q += " Telephone No Should be Numeric\n";
	}
	if(isNaN(theForm.fax.value))
	{
		Q += " Fax No Should be Numeric\n";
	}
	/*if (theForm.select_benner.value==0)
	{
		Q += " Banner Size\n";
	}
	if(theForm.bannerfile.value=="")
	{
		Q+=' Upload Banner.\n';
	}
	
	else if(theForm.bannerfile.value!="")
	{
		var imagePath=theForm.bannerfile.value;
		var pathLength = imagePath.length;
		var lastDot = imagePath.lastIndexOf(".");
		var fileType = imagePath.substring(lastDot,pathLength);
		if( ((fileType==".GIF") || (fileType==".gif") )|| ((fileType==".jpg")||(fileType==".JPG"))|| ((fileType==".PNG")||(fileType==".png")))
		{
			Q+="";
			
		}
		else
		{
			errMesg+='We support .JPG, .PNG, and .GIF image formats.\n';
		}
		
			
	}
	if(theForm.link.value=="")
	{
		Q+=' Link.\n';
	}
	else if(theForm.link.value!="")
	{
		
		if (theForm.link.value.indexOf ('www', 0) == -1 || theForm.link.value.length < 10)

             {

                  if(theForm.link.value.indexOf ('.com', 0) == -1 || theForm.link.value.length < 10)

                    {

                       Q+="Enter a valid URL.\n";

                    }

             }
	}*/
	
	
	if ( Q.length > 0 )
	{
		diplayMesg = "Please provide Valid values for\n" + Q ;
		//errMesg += "Please provide Valid values for\n" + Q ;
		//return false;
	}

	if (errMesg == "" && diplayMesg == "")
	{
		if(document.form1.term.checked==false)
			{
				alert('Please accept terms & conditions.');	
				return false;	
			}
		//theForm.submit();
	}
	
	else
	{

			if(diplayMesg!="")
			{
				alert(diplayMesg);
				return false;			
			}
			else
			{
				alert(errMesg);
				return false;
			}
						
	}
}