var getTransferObject = function(){    return null;    };
if(window.ActiveXObject){
    // Check if the browser has support for ActiveXObject (IE Usually) 
    try{ 
        // Check for the new version of XMLHttp compoment 
        var x= new ActiveXObject("MSXML2.XMLHTTP"); 
        getTransferObject = function(){ return new ActiveXObject("MSXML2.XMLHTTP"); }
        delete x;
    }catch(_ex){ 
        try{ // Check for late version of XMLHTTP compoment 
            var x = new ActiveXObject("Microsoft.XMLHTTP"); 
            getTransferObject = function(){ return new ActiveXObject("Microsoft.XMLHTTP"); }
            delete x;
        }catch(ex){
            // Otherwise the version of IE is too old 
        } 
    } 
}else if(window.XMLHttpRequest){
    // XMLHttpRequest object supported by Opera, Firefox and Safari - may too in IE 7. 
    getTransferObject = function(){ return new XMLHttpRequest(); }
}
 
function increment_link_count( link_id ){
      // get transfer object
    var xmlhttp = getTransferObject();
    if(!xmlhttp){
        // Check for XMLHttpRequest
        throw "Download the newer Firefox or upgrade your browser please.";
        return false;
    }

      TheUrl='http://' + document.domain + '/IncrementLinkCount.php?link_id=' + link_id;
	  
	  xmlhttp.open("POST",TheUrl ,true);

	  xmlhttp.onreadystatechange=function() {
          if (xmlhttp.readyState==4) {

				answer = xmlhttp.responseText;		
        
				if( answer != 'error' ){
				 document.getElementById( 'ClicksCount' ).innerHTML=answer; 
				} 
		}


		}
  xmlhttp.send(null)

}

