// JavaScript Document 
		
function get(obj) {
	
	if (document.getElementById("iemail").value=="")
	{
		var poststr ="name=" + encodeURI( document.getElementById("rname").value ) +
                    "&email=" + encodeURI( document.getElementById("remail").value ) +
					"&phone=" + encodeURI( document.getElementById("rphone").value );
	}
		
else{
      var poststr = "name=" + encodeURI( document.getElementById("iname").value ) +
                    "&email=" + encodeURI( document.getElementById("iemail").value ) +
					"&phone=" + encodeURI( document.getElementById("iphone").value );
					
	}
      contaxRequest('contax.php?' + poststr,'popUp','POST',poststr);
   } 
   
   
function contaxRequest(Url,DivId,Method,params)
{
 var CONTAX;
 try
 {  
  CONTAX = new XMLHttpRequest(); 
 }
 catch(e)
 {  
  try
  {    
   CONTAX = new ActiveXObject("Msxml2.XMLHTTP");    
  }
  catch(e)
  {    
   try
   {
    CONTAX = new ActiveXObject("Microsoft.XMLHTTP");      
   }
   catch(e)
   {      
    alert("Your browser does not support CONTAX.");      
    return false;      
   }    
  }  
 }
 CONTAX.onreadystatechange = function()
 {
  if(CONTAX.readyState == 4)
  {
   if(CONTAX.status == 200)
   {
	contaxMsg(CONTAX.responseText,DivId);
    //document.getElementById(DivId).innerHTML = CONTAX.responseText;  
   }
   else
   {
    alert("Error: "+ CONTAX.statusText +" "+ CONTAX.status);
   }
  }  
 }
 CONTAX.open(Method, Url, true);
 //Send the proper header information along with the request
	CONTAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	CONTAX.setRequestHeader("Content-length", params.length);
	CONTAX.setRequestHeader("Connection", "close");
 	CONTAX.send(params);
}




//create popup msg box that fades in and 3 seconds later fades out.
function contaxMsg(msg,DivId)
{
	document.getElementById(DivId).innerHTML=(msg);
	$('#'+DivId).fadeIn('fast');
	$('#'+DivId).click(function(){
			$('#'+DivId).fadeOut('fast');  
		});
											  
	setTimeout("closeMsg('"+DivId+"')",3000);
				   
}
	
function closeMsg(DivId)
{
	$('#'+DivId).fadeOut('slow');
}