/* AJAX functions 0.1v
/* The following function creates an XMLHttpRequest object... */
/*Created by Raz Mark (markraz@gmail.com*/

function createRequestObject()
{
    try{request_o = new ActiveXObject("Microsoft.XMLHTTP");
    }catch(ex){//either this is not IE, or it is a version of IE which does not support XMLHTTP
        var notIECompatibleXMLHTTP=true;}
    if(notIECompatibleXMLHTTP==true){
        try{request_o = new XMLHttpRequest();
        }catch(ex){//we can't use AJAX because this browser is not compatible.
            request_o = false;}
    }
    return request_o;
}

function sendRequestGET(XMLHTTP_inarray,element,URL){
    //sends a request using createRequestObject output stored in XMLHTTP[XMLHTTP_inarray] 
    XMLHTTP[XMLHTTP_inarray].open('get', URL); 
    XMLHTTP[XMLHTTP_inarray].onreadystatechange = function(){
            if(XMLHTTP[XMLHTTP_inarray].readyState == 4){
                    var response = XMLHTTP[XMLHTTP_inarray].responseText;
                    document.getElementById(element).innerHTML = response;
            }
    }
    //defines the function, to be activated when change had been made 
    XMLHTTP[XMLHTTP_inarray].send(null);//to be changed if a POST is set
}


  
var XMLHTTP=new Array()
if (XMLHTTP['image']=createRequestObject())
{
    //'AJAX is AVAILABLE';
    //alert(XMLHTTP['image']);
}
else
{
    alert('AJAX is not compatible.');
}

