function logClick(x,y,z,cl)
{
    // Set up the request
    var xmlhttp =  new XMLHttpRequest();
    xmlhttp.open('POST', '/admin/innTraffic/clickAJAX.php', true);
    // The callback function
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4) {
            if (xmlhttp.status == 200) {
                var result = xmlhttp.responseXML.documentElement.getElementsByTagName("result");
                if(typeof cl == 'undefined' && z != 'ChkAvailability'){sendLink(x);}
            }
        }
    }
    // Send the POST request
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send('linkPage='+x+'&innId='+y+'&clickType='+z);
    xmlhttp.close;
    if(typeof cl != 'undefined'){
        xmlhttp =  new XMLHttpRequest();
        xmlhttp.open('POST', '/admin/innTraffic/clickAJAX.php', true);
        // The callback function
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    var result = xmlhttp.responseXML.documentElement.getElementsByTagName("result");
                    sendLink(x);
                }
            }
        }
        // Send the POST request
        xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlhttp.send('linkPage='+x+'&innId='+y+'&clickType='+cl+'&secondClick=yes');
        xmlhttp.close;
    }
    return false;
}
function sendLink(x)
{
    //window.location = x;
    if (navigator.appName.indexOf('Microsoft') != -1)
          browser = 'IE'
    else if (navigator.appName.indexOf('Netscape') != -1)
         browser = 'Netscape'
    else browser = 'IE';
    if(browser=='IE')
    {
        //var targetWndName = 'NewWindow';
        //var wnd = window.open("",targetWndName);
        var link = document.createElement('A');
        //link.target = targetWndName;
        link.href = x;
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
    }else{
        window.location = x;
        //setTimeout("window.open('"+x+"')",100);
    }
}


