﻿function myfunction(channelid, videoid) {
    var RightNow = new Date();
    var time = RightNow.getFullYear() + RightNow.getMonth() + "-" + RightNow.getDate() + "-" + RightNow.getHours() + "-" + RightNow.getMinutes() + RightNow.getSeconds();
    var url = 'CheckIn.aspx?' + time + '&ChannelID=' + channelid + '&VIDEOID=' + videoid;
    var xmlHttp = null;
    try {  // Firefox, Opera 8.0+, Safari  
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        var arr_t = new Array
		                (
			                "Msxml2.XMLHTTP.4.0",
			                "Msxml2.XMLHTTP.3.0",
			                "Msxml2.XMLHTTP.2.6",
			                "Microsoft.XMLHTTP",
			                "MSXML.XMLHTTP"
		                );
        for (var i = 0; i < arr_t.length; i++) {
            try {
                xmlHttp = new ActiveXObject(arr_t[i]);
                break;
            }
            catch (e) {

            }
        }
    }
    xmlHttp.onreadystatechange = function() {
        try {
            if (xmlHttp.readyState == 4) {
                if (xmlHttp.status == 200) {
                    var xmlDoc = xmlHttp.responseText;
                    var temp = new Array();
                    temp = xmlDoc.split('|');
                    document.getElementById('visitor').innerHTML = temp[0];

                    xmlHttp = null;
                }
            }
        }
        catch (e)
           { }
    }
    xmlHttp.open("GET", url, true);
    xmlHttp.send(null);
}
