﻿window.onload=function(){
    try{
        //--
        var sWidth=screen.width;
        var sHeight=screen.height;
        //--
        var url=new String(parent.window.location.href);
        var rurl=new String(parent.document.referrer);
        rurl=rurl.replace(/\?/g,"_QRY_");
        rurl=rurl.replace(/&/g,"_AND_");
        rurl=rurl.replace(/=/g,"_EQL_");
        rurl=rurl.replace(/%/g,"_PER_");
        url=url.replace(/\?/g,"_QRY_");
		url=url.replace(/#/g,"%23");
		//--
		if(url.indexOf("/aspx/")>0){
            url="../func/visit.aspx?t=0&u="+url;
        }else{
            url="func/visit.aspx?t=0&u="+url;
        }
        url+="&r="+rurl;
        url+="&w="+sWidth;
        url+="&h="+sHeight;
        url+="&dt="+fnGetDateTime();
        url+="&rnd"+Math.random();
        //--
        document.getElementById("jsv").src=url;
        //window.open(url);
     }catch(e){
        alert(e.description);
    }
}

function fnGetDateTime(){
    var date=new Date();
    var str=date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
    //alert(str);
    return str;
}
