
   function chkext()
   {
        var vals = [];
$("input[name^='ext']").each(function() {
if (this.checked) { vals.push(this.value); }

});
if(vals.length >0)
{
return true
}
else
{
$("#result").html("<span style=color:red>  من فضلك أدخل امتداد النطاق </span>");
return false
}
   }
  
 function checkForm(){
 
  var domain = $("#domain");
 if(domain.attr("value") )
 {
return true;
 }
			
		else {
		$("#result").html("<span style=color:red>من فضلك أدخل اسم النطاق</span>");
			return false;
			}
	}
   	//on submit event
	function abada(){
		if(checkForm() && chkext()){
		
		  var result = $("#result");
			result.html("<div align=center><img src='../style/images/loading.gif'></div>");
			
			var parameters="&"+$('#form').serialize();	
			
			 
			//we deactivate submit button while sending
			$("#send").attr({ disabled:true, value:"ابحث" });
			$("#send").blur();
			//send the post to shoutbox.php
			$.ajax({
				type: "POST", url: "../whois/main/domainprocess.php", data:parameters ,
				complete: function(data){
				
				result.html("");
					result.html(data.responseText);
					$("#send").attr({ disabled:false, value:"ابحث" });
					//reactivate the send button
					
				}
			 });
		}
		//else $("#result").html("من فضلك أدخل اسم الدومين");//alert("من فضلك أدخل اسم الدومين");
		//we prevent the refresh of the page after submitting the form
		return false;
	}
 
 
