
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
function isNumberKey(evt)
{	
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
	{
		alert('Please enter only numbers.');
		return false;
	}
	return true;
}
function isAlphaKey(evt)
{	
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 32 && (charCode < 65 || charCode > 122 ))
	{
		alert('Please enter only letters.');
		return false;
	}
	return true;
}
function emailcheck()
{
var x=document.getElementById("email").value
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Please enter valid e-mail address.");

  return false;
  }
}


function getwhois(domain)
	{
		var url="domaincheck/whois.php";
		url=url+"?domain="+domain;
//alert(url);

		if (domain.length==0)
		{ 
			document.getElementById("whois").innerHTML="";
			return;
		}		
		if (window.XMLHttpRequest)
		{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange=function()
		{
				if(xmlhttp.readyState == 3)  // Loading Request
				  {
	document.getElementById("whois").innerHTML = '<img src="img/load.gif" align="center" />';
				  }
 
			
			
			if (xmlhttp.readyState==4 && xmlhttp.status==200)
		    {
    			document.getElementById("whois").innerHTML=xmlhttp.responseText;
	    	}
	  	}
		xmlhttp.open("GET",url,true);
		
		xmlhttp.send();
	}


function domaincheck(domain,ext,option)
	{
		var url="domaincheck/domainwhois.php";
		url=url+"?domain="+domain;
		url=url+"&ext="+ext;
		url=url+"&option="+option;
//alert(url);

		if (domain.length==0)
		{ 
			document.getElementById("domaincheckwhois").innerHTML="";
			return;
		}		
		if (window.XMLHttpRequest)
		{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange=function()
		{
				if(xmlhttp.readyState == 3)  // Loading Request
				  {
	document.getElementById("domaincheckwhois").innerHTML = '<img src="img/load.gif" align="center" />';
				  }
 			
			if (xmlhttp.readyState==4 && xmlhttp.status==200)
		    {
    			document.getElementById("domaincheckwhois").innerHTML=xmlhttp.responseText;
	    	}
	  	}
		xmlhttp.open("GET",url,true);
		
		xmlhttp.send();
	}


function getcontent(title)
	{
		var url="content.php";
		url=url+"?title="+title;
//alert(url);

		if (title.length==0)
		{ 
			document.getElementById("content").innerHTML="";
			return;
		}		
		if (window.XMLHttpRequest)
		{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange=function()
		{
				if(xmlhttp.readyState == 3)  // Loading Request
				  {
	document.getElementById("content").innerHTML = '<img src="img/load.gif" align="center" />';
				  }
 			
			if (xmlhttp.readyState==4 && xmlhttp.status==200)
		    {
    			document.getElementById("content").innerHTML=xmlhttp.responseText;
	    	}
	  	}
		xmlhttp.open("GET",url,true);
		
		xmlhttp.send();
	}


function showaddress()
{    document.getElementById('inquirysendmsg').style.disply ="";
	 document.getElementById('forminq').style.display = "none";
     document.getElementById('address').style.display = "";  
	 document.getElementById('payment').style.display = "none"; 
}
function showinq()
{
	 document.getElementById('forminq').style.display = "";
     document.getElementById('address').style.display = "none";  
 	 document.getElementById('payment').style.display = "none"; 
}

function showpay()
{
	 document.getElementById('forminq').style.display = "none";
     document.getElementById('address').style.display = "none"; 
	 document.getElementById('payment').style.display = ""; 
	  
}
 
 
	function check_fields2(inquiryform,name,addressv,contact,email,city,country,inquiryfor,inquirydetails)
    { 
        var returnval=false;
        var msg2="";		   
		   if(inquiryform.fullname.value=="" || inquiryform.fullname.value=="Name"|| inquiryform.fullname.value.length < "4")
           		{	msg2+="You must fill full name!\n"; 
		  			document.getElementById('fullname').style.background='#fdcbe3';
				 }
		   else
		  		{
					document.getElementById('fullname').style.backgroundImage='url(img/inputboxbg.png)';
				}
				if(inquiryform.addressinpute.value=="" || inquiryform.addressinpute.value=="Address")
           		{	msg2+="You must fill full Address!\n"; 
		  			document.getElementById('addressinpute').style.background='#fdcbe3';
				 }
		   else
		  		{
					document.getElementById('addressinpute').style.backgroundImage='url(img/inputboxbg.png)';
				}
	
		   if(inquiryform.contactno.value=="" || inquiryform.contactno.value=="Contact No" ||inquiryform.contactno.value.length < "7")
         		{	 msg2+="You must Fill your Contact no!\n";
		  			 document.getElementById('contactno').style.background='#fdcbe3';
				}
		   else
		  		{
					document.getElementById('contactno').style.backgroundImage='url(img/inputboxbg.png)';
				}				
		   if(inquiryform.email.value=="" || inquiryform.email.value=="Email")
           		{	msg2+="You must Fill your Email id!\n";
		 			document.getElementById('email').style.background='#fdcbe3';
				}
		   else
		  		{ 
					document.getElementById('email').style.backgroundImage='url(img/inputboxbg.png)';
				}		

		    if(inquiryform.city.value=="" || inquiryform.city.value == "City")
          		{ 	msg2+="You must Fill City!\n";
		  			document.getElementById('city').style.background='#fdcbe3';
				
		   		}
		   else
		  		{
					document.getElementById('city').style.backgroundImage='url(img/inputboxbg.png)';
				}
				
				
		    if(inquiryform.country.value=="" || inquiryform.country.value == "Country")
          		{ 	msg2+="You must Fill Country!\n";
		  			document.getElementById('country').style.background='#fdcbe3';
				
		   		}
		   else
		  		{
					document.getElementById('country').style.backgroundImage='url(img/inputboxbg.png)';
				}
				
		    if(inquiryform.inquirydetails.value=="" || inquiryform.inquirydetails.value == "Inquiry Details")
          		{ 	msg2+="You must Fill Your Inquiry Details!\n";
		  			document.getElementById('inquirydetails').style.background='#fdcbe3';
				
		   		}
		   else
		  		{
					document.getElementById('inquirydetails').style.backgroundImage='url(img/inputboxbg.png)';
				}
			
      	if(msg2=="")
		{
			returnval=true;
			return returnval;
		}
		else
		{
			alert(msg2);
			return returnval;
		}
	}
	function submit_form2(inquiryform,name,addressv,contact,email,city,country,inquiryfor,inquirydetails)
	{ 
		if(check_fields2(inquiryform,name,addressv,contact,email,city,country,inquiryfor,inquirydetails))
		{ 
			 sendinquiry(inquiryform,name,addressv,contact,email,city,country,inquiryfor,inquirydetails)
			return true;
		}		
	}
 
function sendinquiry(inquiryform,name,addressv,contact,email,city,country,inquiryfor,inquirydetails)
	{ 
		var url="maile.php";
		url=url+"?name="+name;
		url=url+"&addressv="+addressv;
		url=url+"&contact="+contact;
		url=url+"&email="+email;
		url=url+"&city="+city;
		url=url+"&country="+country;
		url=url+"&inquiryfor="+inquiryfor;
		url=url+"&inquirydetails="+inquirydetails;
		
//alert(url);
showaddress()
		if (name.length=='Name')
		{ 
			document.getElementById("inquirysendmsg").innerHTML="";
			alert ("fill data");
			return;
		}		
		if (window.XMLHttpRequest)
		{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange=function()
		{
				if(xmlhttp.readyState == 3)  // Loading Request
				  {
	document.getElementById("inquirysendmsg").innerHTML = '<img src="img/load.gif" align="center" />';
				  }
 			
			if (xmlhttp.readyState==4 && xmlhttp.status==200)
		    {
    			document.getElementById("inquirysendmsg").innerHTML=xmlhttp.responseText;
	    	}
	  	}
		xmlhttp.open("GET",url,true);
		
		xmlhttp.send();
	}
	


