//------------------------------------------
function process() {
  http.open("POST", "../includes/register_sql.php", true);
  http.onreadystatechange=getHttpRes;
  
  var params="do=form";
	for(i=0; i<document.form_form.elements.length; i++){
			if((document.form_form.elements[i].type!='checkbox' && document.form_form.elements[i].type!='radio') || document.form_form.elements[i].checked)
				params+="&"+encodeURI(document.form_form.elements[i].name)+"="+encodeURI(document.form_form.elements[i].value);
	}
		
  //alert(params);
  document.getElementById('status').innerHTML="wait..."; 
//  document.getElementById('submit').style.display="none"; 
//  document.getElementById('submitted').style.display=""; 
  
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  http.send(params);
}
function getHttpRes( ) {
  if (http.readyState== 4 && http.status== 200) {
  	var res=http.responseText;
  	var next=res.split(':::');
    document.getElementById('status').innerHTML=next[0];
	if (next[0]=='Submitting...') window.location=next[1];   
    //if (next[1]==2) document.getElementById('floors').style.display='none'; 
    //if (next[1]==2) document.getElementById('add_area').style.display=''; 
    //if (next[1]==2) document.getElementById('items').innerHTML='Drag areas here!'; 
    //if (next[1]==3) document.getElementById('add_area').style.display='none'; 
    //if (next[1]==3) document.getElementById('rename').style.display=''; 
    //if (next[1]==3) document.getElementById('rename').innerHTML=next[2]; 
    //if (next[1]==4) setTimeout('window.location="index.php"', 2000); 
  }
}
function getXHTTP( ) {
  var xhttp;
   try {
      xhttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xhttp=new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e2) {
	    try {
	      xhttp=new XMLHttpRequest();
	    } catch (e3) {
	      xhttp=false;
	    }
      }
    }
  return xhttp;
}
var http=getXHTTP();

//------------------------------------------
