var i;
var j;
var e;
var str;
var m_x;
var m_y;
var aaa;
var bbb;
var sURL;
var conv;
var p;
var pp;

if (window.ActiveXObject && !window.XMLHttpRequest)
{
  window.XMLHttpRequest = function()
    {
      try
      {
        return (new ActiveXObject('Msxml2.XMLHTTP'));
      }
      catch (e) {}

      try
      {
        retrurn (new ActiveXObject('Microsoft.XMLHTTP'));
      }
      catch (e) {}

      return (null);
    }
}

myDate = new Date();
theYear = myDate.getFullYear();
theMonth = myDate.getMonth()+1;
theDay = myDate.getDate();
theH = myDate.getHours();
theM = myDate.getMinutes();
theS = myDate.getSeconds();

sURL = "test";
sURL = document.URL;
conv = sURL.split("/");
sURL = "";
for ( a=2; a <= conv.length-1; a++ ) {
    if(a==2){
	    sURL = conv[a];
    }else{
	    sURL = sURL + "-" + conv[a];
	}
}

i = 0;
e = 0;
theMonth=this.preZero(theMonth);
theDay=this.preZero(theDay);
theH=this.preZero(theH);
theM=this.preZero(theM);
theS=this.preZero(theS);
fname = theYear+""+theMonth+""+theDay+"-"+theH+""+theM+""+theS+"_"+sURL;
timerID = setInterval('getdata_myname()',1000);



function getdata_myname()
{
  	aaa = document.documentElement.scrollTop;
	str = str+aaa+":";
	if(i==10){
	    if(isNaN(bbb)){
	    	bbb = document.documentElement.scrollHeight;
			if(isNaN(bbb)==false){
				str = bbb+":"+str;
			}
	    }


	    xmlhttp = new XMLHttpRequest();
		xmlhttp.open("POST", "../act/getlog.php");
    	xmlhttp.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
		xmlhttp.send("file="+fname+"&top="+str);
		str = "";
		i = 1;
		e = e+1;
		if(e==180){
			clearInterval(timerID);
		}
	}else{
		i = i+1;
	}
}

function preZero(value) {
  return (parseInt(value) < 10) ? "0" + value : value;
}


