function getPage(page){

iframeObj = document.frames['iframOb']; 
iframeObj.src=page;
iframeObj.location=page;	

}
//****************************************************/

function selectThisPage(title,height){	
 window.frames['iframeName'].location=title;
 document.getElementById("iframeName").height=600; 
}
//88888888888888888888888888888888888888888888/
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

//***************************************************/

function addCustomer(){

var url = "addCustomer.php";

cust_fname= document.getElementById("cust_fname").value;
cust_lname= document.getElementById("cust_lname").value;
cust_passport= document.getElementById("cust_passport").value;
cust_brith_date= document.getElementById("cust_brith_date").value;
cust_arrival= document.getElementById("cust_arrival").value;
cust_leaving= document.getElementById("cust_leaving").value;


var params = "cust_fname= "+cust_fname+"&cust_lname= "+cust_lname+" &cust_passport="+cust_passport+"&cust_brith_date="+cust_brith_date+"&cust_arrival="+cust_arrival+"&cust_leaving="+cust_leaving;

      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
	 
http_request.open("POST", url, true);

//Send the proper header information along with the request
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", params.length);
http_request.setRequestHeader("Connection", "close");

/*http_request.onreadystatechange = function() {//Call a function when the state changes.
	//if(http_request.readyState == 4 && http_request.status == 200) {
		
		if(IsNumeric(http_request.responseText)){
		
alert("تمت الاضافة بنجاح");
		}else
			alert('???I I?? ?? ‘IIC? C?E?C?CE');
		
	  // }
     }*/
   http_request.send(params);
}


