var timerTime = 1000; // Detect if the browser is IE or not. If it is not IE, we assume that the browser is NS. var IE = document.all?true:false // If NS -- that is, !IE -- then set up for mouse capture if (!IE) document.captureEvents(Event.MOUSEMOVE) // Set-up to use getMouseXY function onMouseMove document.onmousemove = getMouseXY; document.onclick = mouseClicked; var tempX = 0; var tempY = 0; var winW = 0; var winH = 0; var lastW = 0; var lastH = 0; var timerID = 0; var counter = 0; var maxCounter = 11; var info = new Array(); var saveImage = new Image(); //var actualPageUID = "4c85916ac3ef8"; //var BesucherID = ""; var bseitenID = "3152306"; var lastInfo = new Object(); var unload=false; var globalItemsCounter = 0; var globalItemsCounterMax = 160; var mousePositionDifference = 50; var tmpGlobalCounter=0; var timeOnLastUpdate = new Date(); function getMouseXY(e) { if (IE) { tempX = event.clientX + document.body.scrollLeft tempY = event.clientY + document.body.scrollTop } else { tempX = e.pageX tempY = e.pageY } // catch possible negative values in NS4 if (tempX < 0){tempX = 0} if (tempY < 0){tempY = 0} if ( (tempX-xBefore)>=mousePositionDifference || (tempY-yBefore) >= mousePositionDifference || (xBefore-tempX)>=mousePositionDifference || (yBefore-tempY) >= mousePositionDifference) { UpdateInfo(false); } //window.status = tempX + "/" + tempY; //ausgabe.posX.value = tempX; //ausgabe.posY.value = tempY; return true; } function getWindowSize(){ //in Netscape Navigator: subtract 16 from the width and height //in Microsoft Internet Explorer: subtract 20 from the width and height if (parseInt(navigator.appVersion)>3) { lastW = winW; lastH = winH; if (navigator.appName=="Netscape") { winW = window.innerWidth-16; winH = window.innerHeight-16; } if (navigator.appName.indexOf("Microsoft")!=-1) { winW = document.body.offsetWidth-20; winH = document.body.offsetHeight-20; } } } var xBefore=0; var yBefore=0; function UpdateInfo(setTimer){ //debugText('updateInfo'); tmpGlobalCounter++; timeNow = new Date(); if (info.length==0 || xBefore != tempX || yBefore != tempY){ info[counter] = new Object(); info[counter]["MouseX"] = tempX; info[counter]["MouseY"] = tempY; // save the Time Difference: info[counter]["time"] = timeNow - timeOnLastUpdate; getWindowSize(); if (lastW != winW || lastH != winH){ info[counter]["winW"] = winW; info[counter]["winH"] = winH; //info[counter]["bName"] = navigator.appName; //info[counter]["bVers"] = navigator.userAgent; //alert(navigator.appName); //alert(navigator.userAgent); debugText('Window size changed: '+ winW+'/'+winH); } counter++; } else { // if mouse is on the same position, rise the time from the last position info[counter-1]["time"] += timeNow - timeOnLastUpdate; } timeOnLastUpdate = timeNow; if (counter >= maxCounter){ SaveInfo(); } //if (setTimer || true){ clearTimeout(timerID); timerID = setTimeout("UpdateInfo(true)", timerTime); //} xBefore = tempX; yBefore = tempY; } function SaveInfo(){ //alert('daten senden'); debugText('saving the Track...'); //tmpSrc = "/include/saveinfo.php?BesucherID=" + BesucherID + "&bseitenID=" + bseitenID; //"&actualPageUID=" + actualPageUID; //+ "&counter=" + counter; tmpSrc = "/include/saveinfo.php?bseitenID=" + bseitenID; //letztes info wird immer da gelassen: lastInfo = new Object(); lastInfo = info[counter-1]; maxi = info.length-1; if (unload) maxi = info.length; for (i=0; i