// RV 11/3/09 this script will count clicks for the banner ads */

function countClick(id) {

    var xhr = false;
    if (window.XMLHttpRequest) {
        xhr = new XMLHttpRequest();
        if (xhr.overrideMimeType) {
            xhr.overrideMimeType('text/html');
        }
    } else if (window.ActiveXObject) {
        try {
            xhr = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) { }
        }
    }

    if (xhr) {
        var dDate = new Date();
        var stamp = dDate.getMilliseconds();

        var qs = "/banner_count.aspx?bid=" + id + "&alone=yes&dstamp=" + stamp;

        //alert("qs=" + qs + "\ndivID=" + divID);
        xhr.open("GET", qs, true);
        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xhr.onreadystatechange = function() {
            if (xhr.readyState == 4 && xhr.status == 200) {
                var status = xhr.responseText;
                if (status != "OK") {
                    //error logging the click thru counts
                }

            }
        }
        xhr.send(null);
    }


}

function countClickSponsors(id) {

    var xhr = false;
    if (window.XMLHttpRequest) {
        xhr = new XMLHttpRequest();
        if (xhr.overrideMimeType) {
            xhr.overrideMimeType('text/html');
        }
    } else if (window.ActiveXObject) {
        try {
            xhr = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) { }
        }
    }

    if (xhr) {
        var dDate = new Date();
        var stamp = dDate.getMilliseconds();

        var qs = "/banner_count.aspx?sid=" + id + "&alone=yes&dstamp=" + stamp;

        //alert("qs=" + qs + "\ndivID=" + divID);
        xhr.open("GET", qs, true);
        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xhr.onreadystatechange = function() {
            if (xhr.readyState == 4 && xhr.status == 200) {
                var status = xhr.responseText;
                if (status != "OK") {
                    //error logging the click thru counts
                }

            }
        }
        xhr.send(null);
    }


}
