// JavaScript Document
 //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');
}

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);
	    
   }
   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);
}






function get(obj) {
      var poststr = "name=" + encodeURI( document.getElementById("name").value ) +
                    "&email=" + encodeURI( document.getElementById("email").value ) +
					"&msg=" + encodeURI( document.getElementById("msg").value );
      contaxRequest('contax.php?' + poststr,'popUp','POST',poststr);
   } 