function foc()
{
document.myform.txtName.focus();
}

// JScript source code

function valid_data()
{
	 /*if ( document.myform.checkbuy.checked == false && document.myform.checksell.checked == false )
	{
		alert("Please Check At Least One Option.");
		return false;
	}
	*/
         
	var valu2 = document.myform.txtName.value;
	var flag2;			
	
	if(valu2 == "")
	{
		flag2 = false;
	}
	instr = valu2.toString()
	
	for(var i=0; i<instr.length; i++)
	{
		var char1 = instr.charAt(i);
		
		value = char1.charCodeAt()
	
		if(value == 32)
		{
			flag2 = false;
		}
		else
		{
			flag2 = true;
			break;
		}
	}

	if (flag2 == false)
	{
		alert("Please Enter Your Name.");
		document.myform.txtName.focus();
		return false;
	}
	
	txt=document.myform.txtEmail.value;
	
	if(document.myform.txtEmail.value == "")
	{
		alert("Please Specify Your Email.");
		document.myform.txtEmail.focus();
		return false;
	}
	
	if(txt.indexOf("@") < 1)
	{
		alert("Please Enter Valid Email.");
		document.myform.txtEmail.focus();
		return false;
	}
	
	if( txt.indexOf('@',0) == 0 || txt.indexOf('.',0) < 1)
	{
		alert("Please Enter Valid Email.");
		document.myform.txtEmail.focus();
		return false;
	}
		
	if ( !ValidateNo( document.myform.txtEmail.value, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_@.-" )){
		alert("Invalid Email: " + document.myform.txtEmail.value );
		document.myform.txtEmail.focus();
		return false;
	}

	if (txt.indexOf("/") > 1 || txt.indexOf(",") > 1)
	{
		alert("Please Enter Valid Email.");
		document.myform.txtEmail.focus();
		return false;
	}
	
	cnt = 0;
	instr = txt.toString()
	
	for(var i=0; i<instr.length; i++)
	{
		var char1 = instr.charAt(i)
	
		if (char1 == "@")
		{
			cnt = cnt+1;
		}
	}					
	
	if(cnt > 1)
	{
		alert("Please Enter Valid Email.");
		document.myform.txtEmail.focus();
		return false;
	}
	
	var country_ph1, area_ph1, phno1;
	
	country_ph1	= document.myform.txtcphone.value;
	area_ph1	= document.myform.txtaphone.value;
	phno1		= document.myform.txtpphone.value;

	if (country_ph1 == "")
	{
		alert("Please Fill The Country Code In The Phone Number.");
		document.myform.txtcphone.focus();
		return false;
	}
	
	if ( !ValidateNo( document.myform.txtcphone.value, "0123456789" )){
		alert("Invalid Phone: " + document.myform.txtcphone.value );
		document.myform.txtcphone.focus();
		return false;
	}
	
	if (area_ph1 == "")
	{
		alert("Please Fill The Area Code In The Phone Number.");
		document.myform.txtaphone.focus();
		return false;
	}
	
	if ( !ValidateNo( document.myform.txtaphone.value, "0123456789" )){
		alert("Invalid Phone: " + document.myform.txtaphone.value );
		document.myform.txtaphone.focus();
		return false;
	}
	
	if (phno1 == "")
	{
		alert("Please Fill The Phone Number Properly.");
		document.myform.txtpphone.focus();
		return false;
	}
	
	if ( !ValidateNo( document.myform.txtpphone.value, "0123456789" )){
		alert("Invalid Phone: " + document.myform.txtpphone.value );
		document.myform.txtpphone.focus();
		return false;
	}
	
/*	if(document.myform.ddlbudget.value == "0")
	{
		alert("Please Select Your Budget.");
		document.myform.ddlbudget.focus();
		return false;
	}
	
	if(document.myform.city.value == "0")
	{
		alert("Please Select Your City.");
		document.myform.city.focus();
		return false;
	} */
         
         
	inserterfidetail();
	return true;
}

function ValidateNo(NumStr, String)
{				
	for(var Idx=0; Idx<NumStr.length; Idx++)
	{
		var Char = NumStr.charAt(Idx);
		var Match = false;

		for(var Idx1=0; Idx1<String.length; Idx1++)
		{
			if(Char == String.charAt (Idx1))
				 Match = true;
		}

		if (!Match) 
			return false;
	}
	return true;
}

function inserterfidetail()
	{
	  
 	 var xmlHttp = null 	
	if (typeof window.ActiveXObject != 'undefined' ) 
	{ 
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
	} 
	else 
	{ 
		xmlHttp = new XMLHttpRequest(); 
	}
	
/*	var txtfullname=document.myform.txtName.value;
	var txtEmail=document.myform.txtEmail.value;
	var txtphoneno1=document.myform.txtcphone.value;
	var txtphoneno2=document.myform.txtaphone.value;
	var txtphoneno3=document.myform.txtpphone.value;
	var txtDesignation=document.myform.txtDesignation.value;
	var txtCompany=document.myform.txtCompany.value;
        var txtPersonalNote=document.myform.txtpernote.value;
        var txtInterest=document.myform.selectinterest.value;
	  var chkbuy = ""
		if(document.myform.checkbuy.checked == true)
			chkbuy = 'Y';
		else
			chkbuy = 'N';
        var chksell = ""
var chksell = ""
		if(document.myform.checksell.checked == true)
			chksell = 'Y';
		else
			chksell = 'N'; */
        //var chksell = document.myform.txtcomments.value 
	//var txtcall = document.myform.txtcall.value 
	//vchkmodecomm = ""
	//txtphoneno = txtphoneno1 + '-' + txtphoneno2 + '-' + txtphoneno3;
	
	

	/*var url="./inquiry.php?txtfullname="+txtfullname+"&txtEmail="+txtEmail+"&txtphoneno="+txtphoneno+"&txtCompany="+txtCompany+"&txtDesignation="+txtDesignation+"&txtPersonalNote="+txtPersonalNote+"&txtInterest="+txtInterest+"";
	xmlHttp.open("GET", url, false);	
    xmlHttp.send(null);
   if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
    {
		document.getElementById("division").innerHTML=xmlHttp.responseText
		//document.getElementById("division").style.visibility="visible";
	} 		
	 */
}