function validateform(str0,str1,str2,str3,str4,str5,str6,str7)
{

//alert(document.myform.hdn.value)
var a = new Array(8);
var b;
var chk;
var flag;	
for(var j=0;j<validateform.arguments.length;j++)
{
	a[j]=arguments[j];
	b=eval('document.myform.'+a[j]+'.value');

	if(a[j]=="email")
	{
		
			if(document.myform.email.value =="")
			{
				alert("Email address cannot be Blank");
				document.myform.email.focus()  
				return false ;
			} 
			
		else 
			{
				if ( !ValidateEmail( document.myform.email.value ) )
				{
					alert( "Invalid Email " + document.myform.email.value );
					myform.email.focus();
					document.myform.email.value ="" ;
					return false;
				}
			
		   	} 
	}
	
		if(a[j]=="comname" || a[j]=="country" || a[j]=="phone" || a[j]=="address" || a[j]=="person" || a[j]=="email")
		{
			
			var valu=eval('document.myform.'+a[j]+'.value');
					
			if(valu=="")
			{
			flag=false;
			}
			instr=valu.toString()
			
			for(var i=0;i<instr.length;i++)
			{
			
			var char1=instr.charAt(i)
			value=char1.charCodeAt()
			
				if(value=="32")
				{
				flag=false;
		   		}
				else
				{
				flag=true;
				break;
				}			
			}
	}

			if (flag==false)
			{
			alert("The field with * cannot be left blank!!!");
			eval('document.myform.'+a[j]+'.focus()');
			eval('document.myform.'+a[j]+'.value=""');
			return false;
			break;
			}
}
//return true;
callajax();

}
function callajax()
	
{
//alert()
	var name , company , address , country , phone , fax , email , comments;
	name = document.myform.person.value ;
	company = document.myform.comname.value ;
	email = document.myform.email.value ;
	phone = document.myform.phone.value;
	country = document.myform.country.value ;
	fax = document.myform.fax.value;
	website = document.myform.website.value;
	address = document.myform.address.value;
	inquiry= document.myform.inquiry.value;
	type = document.myform.hdn.value
	
	
	var str;
	str = "name="+name+"&company="+company+"&country="+country+"&phone="+phone+"&email="+email+"&fax="+fax+"&website="+website+"&address="+address+"&inquiry="+inquiry+"&type="+type;
	var xmlHttp = null 	
	if (typeof window.ActiveXObject != 'undefined' ) 
	{ 
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
	} 
	else 
	{ 
		xmlHttp = new XMLHttpRequest(); 
	}

	var url="/fairs/iigf/sendmail.asp?"+str+"&sid="+Math.random()

	xmlHttp.open("GET", url, false);
    xmlHttp.send(null);
	
	if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
	{	
		document.getElementById("popup").innerHTML=xmlHttp.responseText
	}
}
function ValidateEmail( email )
	{
		var atCharPresent = false;
		var dotPresent = false;

		for ( var Idx = 0; Idx < email.length; Idx++ )
		{
			if ( email.charAt ( Idx ) == '@' )
				atCharPresent = true;
			if ( email.charAt ( Idx ) == '.' )
				dotPresent = true;
		}

		if ( !atCharPresent || !dotPresent )
			return false;

		return true;
	}

function checkdata(str,str1){
if (eval("document.myform."+str1+".value"+".length") > parseInt(str)){
alert("The number of characters exceeds the limit of "+str);
eval("document.myform."+str1+".focus()"); 
}
}
