if (typeof(counteripaddressjs) == "undefined")
{
alert("1150\n" + "counteripaddress.js is missing");
}
*/
function nowyyyymmdd()
{
var now = new Date();
var yearnow = now.getFullYear(); //webdata2009.js
var monthnow = now.getMonth() + 1; //1 - 12
var datenow = now.getDate();
var yyyymmdd = yearnow*10000 + monthnow*100 + datenow;
return yyyymmdd;
}
function nowhhmm() //with leading zero
{
var now = new Date();
var hournow = now.getHours(); //webdata2009.js
var minutenow = now.getMinutes();
var hhmm = hournow*100 + minutenow;
hhmm = ("0" + hhmm).slice(-4); //last 4 chars for leading zero
return hhmm;
}
function getstarttime()
{
var now = new Date();
return now.getTime();
}
function getipaddress()
{
var httpget = new XMLHttpRequest();
var getn = 7;
httpget.onreadystatechange = function()
{
//Call a function when the state changes.
if(httpget.readyState == 4 && httpget.status == 200)
{
var xx = httpget.responseText;
//alert("1195\n" + "H" + xx + "H");
//alert("1196\n" + xx);
//afterwaitingforresponse(xx);
globalisp = getispfromipaddress(xx);
//alert("1199\n" + globalisp);
}
}
//httpget.open("GET", "counter2016.php?getnum="+getn, true); //loop
httpget.open("GET", "iyeeget.php?getnum="+getn, true); //loop
httpget.send();
}
function beforeleavepage() //post
{
//alert("1209\n" + globalisp);
//alert("1210\n" + globaltest);
var now = new Date();
//alert(now.getTime() );
var milliseconds = now.getTime() - starttime;
var minutes = (milliseconds/60000).toFixed(1); //7.3
//alert(minutes);
var documentreferrer = document.referrer;
if (document.referrer == "")
{
documentreferrer = "self";
}
var windowlocation = window.location + "";
var navigatoruserAgent = navigator.userAgent + "";
var httppost = new XMLHttpRequest();
httppost.open("POST", "iyeepost.php", true);
var postdata = "yyyymmdd2="+startyyyymmdd;
postdata += "&"+"hhmm2="+starthhmm;
postdata += "&"+"minutes2="+minutes; //duration
postdata += "&"+"documentreferrer="+documentreferrer;
postdata += "&"+"windowlocation="+windowlocation;
postdata += "&"+"navigatoruserAgent="+navigatoruserAgent;
postdata += "&"+"globalisp="+globalisp;
//alert("1237\n" + postdata);
//Send the proper header information along with the request
httppost.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); //loop
httppost.setRequestHeader("Content-length", postdata.length);
httppost.send(postdata);
httppost.onreadystatechange = function()
{
//Call a function when the state changes.
if( (httppost.readyState == 4) && (httppost.status == 200) )
{
//alert(httppost.responseText);
}
}
}
////keep after functions
var startyyyymmdd = nowyyyymmdd()
var starthhmm = nowhhmm()
var starttime = getstarttime(); //milliseconds
var globalisp;
//if ( (window.location + "").substring(0, 8) != "file:///") //for C: local drive, simulate online in E:
//{
getipaddress(); //js stops local
//}
//stop hiding-->