var doc = null;


function ajax() {
	// Make a new XMLHttp object
    if (window.XMLHttpRequest) {
        try {
            doc = new XMLHttpRequest();
        } catch(e)  {}
    } else if (window.ActiveXObject) {
        try {
            doc = new ActiveXObject('Msxml2.XMLHTTP');
        } catch(e)  {
          try {
              doc = new ActiveXObject('Microsoft.XMLHTTP');
          } catch(e)  {}
        }
    }
}

function Valid_Captcha(id_captcha)
{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
		   doc.open("GET","./location.php?section=isvalidvalue&id_captcha="+id_captcha, false); 
	       doc.send(null);
	      return  doc.responseText;
		
	    }
}


function show_image(div_id,image_path)
{
	
	
	var doc=null;
	
	if (window.XMLHttpRequest) {
    	try {
            doc = new XMLHttpRequest();
    	    } catch(e)  {}
	    } else if (window.ActiveXObject) {
    	    try {
        	    doc = new ActiveXObject('Msxml2.XMLHTTP');
		        } catch(e)  {
        	try {
              doc = new ActiveXObject('Microsoft.XMLHTTP');
		        } catch(e)  {}
	        }
  		}
	doc.open("GET","./location.php?section=show_image&image_path="+image_path, true); 	
	doc.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
	
	doc.onreadystatechange = function()
	   	{ 
		if(doc.readyState == 4)
			{
			if(doc.status == 200)
				{
						document.getElementById(div_id).innerHTML = doc.responseText;
				}
			}  
	  }; 
		doc.send(null); 
}

function set_image(div_id,image_path)
{
	
	
	var doc=null;
	
	if (window.XMLHttpRequest) {
    	try {
            doc = new XMLHttpRequest();
    	    } catch(e)  {}
	    } else if (window.ActiveXObject) {
    	    try {
        	    doc = new ActiveXObject('Msxml2.XMLHTTP');
		        } catch(e)  {
        	try {
              doc = new ActiveXObject('Microsoft.XMLHTTP');
		        } catch(e)  {}
	        }
  		}
	doc.open("GET","./location.php?section=set_image&image_path="+image_path, true); 	
	doc.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
	
	doc.onreadystatechange = function()
	   	{ 
		if(doc.readyState == 4)
			{
			if(doc.status == 200)
				{
						document.getElementById(div_id).innerHTML = doc.responseText;
				}
			}  
	  }; 
		doc.send(null); 
}




