
function LoadAjax()
{
	var xmlHttp;
	try
  	{
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp = new XMLHttpRequest();
  	}
	catch (e)
  	{
  		// Internet Explorer
	  	try
	    {
	    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  	catch (e)
	    {
		    try
		    {
		      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		    }
		    catch (e)
		    {
		    	alert("Your browser does not support AJAX!");
		    	return false;
		    }
	    }
  	}
  	
  	return xmlHttp;
	
 }
 function getAjax(url,idtarget,loadtarget,useload)
 {
 
 	var loadXmlHttp;
 	
 	loadXmlHttp = LoadAjax();
 	
 	loadXmlHttp.onreadystatechange=function()
	{
		if(loadXmlHttp.readyState==3 || loadXmlHttp.readyState==0 || loadXmlHttp.readyState==2 || loadXmlHttp.readyState==1) 
		{
			if(useload=="true")
			{	
				document.getElementById(loadtarget).style.display = "block";
			}
		}
		if(loadXmlHttp.readyState==4)
	  {
	  		//document.myForm.time.value=xmlHttp.responseText;
	  	if(useload=="true")
			{
				document.getElementById(loadtarget).style.display = "none";
			}
	  		document.getElementById(idtarget).innerHTML = loadXmlHttp.responseText;
	  		//alert(loadXmlHttp.responseText);
	  }
	}
	
 	loadXmlHttp.open("GET",url,true);
 	loadXmlHttp.send(null);
 }
 
 function postAjax(idform,idtarget,loadtarget,useload,jumplocation)
 {
 		var form = document.getElementById(idform);
 		var url = form.action;
		var a=0;
		var getValue;
		var loadXmlHttp;
		
		getValue = "jumpHeader="+jumplocation+"&";
		for(a;a<form.length;a++)
		{
			getValue = form.elements[a].id+"="+encodeURI(form.elements[a].value)+"&"+getValue;
		}
		
		loadXmlHttp = LoadAjax();
 	
	 	loadXmlHttp.onreadystatechange=function()
		{
			
			if(loadXmlHttp.readyState==3)
			{
				if(useload=="true")
				{
					document.getElementById(loadtarget).style.display = "block";
				}
			}
			if(loadXmlHttp.readyState==4)
		  {
		  		//document.myForm.time.value=xmlHttp.responseText;
		  	if(useload=="true")
				{
					document.getElementById(loadtarget).style.display = "none";
				}
				document.getElementById(idtarget).innerHTML = "";
		  		document.getElementById(idtarget).innerHTML = loadXmlHttp.responseText;
		  }
		}
		//alert(getValue);
		
		loadXmlHttp.open('POST', url, true);
	 	loadXmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    loadXmlHttp.setRequestHeader("Content-length", getValue.length);
    loadXmlHttp.setRequestHeader("Connection", "close");
    loadXmlHttp.send(getValue);		
 }
 
 function sendDataAjax(url){
	 var loadXmlHttp;
	 	
	 	loadXmlHttp = LoadAjax();
	 	
	 	loadXmlHttp.open("GET",url,true);
	 	loadXmlHttp.send(null);
	}