
function dinit(){
//setTimeout('switchSrc()',6000);
//
	
setInterval('hb()',30000);
hb();
}

	
function switchSrc() {
   document.getElementById("hop").src = "http://www.google.com";
   //document.getElementById("faplog1").src = "http://www.google.com";
}


function hb(){
try{
	var pos = f_scroll();
	var width = f_width();
	var height = f_height();
 (new Image()).src = 'http://world-vr.com/hb/hb.py?hb_loc=' + self.location + '&hb=' +  (((new Date()).getTime() - window.began_loading2) / 1000) + '&hc=' + count + '&pos=' + pos + '&width='+ width + '&height=' + height;
  count = count + 1;
  
}
catch(e){
//nothing
}
}

function aboutunload(event) {
try{
	
	var pos = f_scroll();
	var width = f_width();
	var height = f_height();

	(new Image()).src = 'http://steppingoutsecret.com/sos.py?unloadLoc='  + self.location+ '&unloadTime=' +
	  (((new Date()).getTime() - window.began_loading2) / 1000) +  "&event=" + event + '&pos=' + pos + '&width='+ width + '&height=' + height;

}
catch(e){
}
}


function videoactive(event) {
	/* TODO: Envoye le event quand le  point of view window reste sur le video box/div (passively detect the playing.) 
	 * 
	 * 
	 */
try{
(new Image()).src = 'http://steppingoutsecret.com/sos.py?videoloc=' +
self.location + '&videoTime=' +
  (((new Date()).getTime() - window.began_loading2) / 1000) + "&event="+ event;
}
catch(e){
}
}

function CreateBookmarkLink()

{
   title = "How to Become the Sexy, Confident Woman You've Always Wanted to Be";
   url = "http://steppingoutsecret.com/index.html";
   if (window.sidebar) { // Mozilla Firefox Bookmark
            window.sidebar.addPanel(title, url,"");
   }
   else if( window.external ){ // IE Favorite
            window.external.AddFavorite( url, title);
   }
   else if(window.opera && window.print) { // Opera Hotlist
          return true;
  }

}
function bookmarkbtn(){
/*	(new Image()).src = 'http://steppingoutsecret.com/sos.py?unloadLoc='  + self.location+ '&unloadTime=' +
	  (((new Date()).getTime() - window.began_loading2) / 1000) +  "&event=pointofview" + '&pos=' + pos + '&width='+ width + '&height=' + height;
	*/
	//with positions for future
    //(new Image()).src = 'http://steppingoutsecret.com/sos.py?Loc=' + self.location + '&Time=' + (((new Date()).getTime() - window.began_loading2) / 1000) + '&bookmark=True' + '&pos=' + pos + '&width='+ width + '&height=' + height;
	(new Image()).src = 'http://steppingoutsecret.com/sos.py?Loc=' + self.location + '&Time=' + (((new Date()).getTime() - window.began_loading2) / 1000) + '&bookmark=True';
	CreateBookmarkLink()
    
	try{

		}
	catch(e){
		//nothing
	}



}

min="5";
sec="0";

//display time
function display() 
{
	if (sec<=0){
	min-=1
	sec+=59
	}
	
	sec-=1
	
	if (sec<=9) { sec="0"+sec; }
	
	if (min==-1)
		{
		time = "<font color=#ff0000>0:00</font>";
		//document.location = "/cgi-bin/site-data.pl?buyfapnp&cname=Dave";
		
		} 
	else 
		{
		time = min + ":" + sec;
		}
	if (document.getElementById) { 
		document.getElementById("theTime").innerHTML = time;
		document.getElementById("theTimea").innerHTML = time;
		}
	else if (document.layers) {
		document.layers.theTime.document.write(time);
		document.layers.theTimea.document.write(time);
		document.layers.theTime.document.close();
		}
	//document.layers.theTimea.document.close(); }
}
//start the time and display
//setInterval("display()", 1000);


var stime = 0;
var data = 0;

function f_width() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ?
document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_height() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ?
document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
//function f_scrollLeft() {
//	return f_filterResults (
//		window.pageXOffset ? window.pageXOffset : 0,
//		document.documentElement ?
//document.documentElement.scrollLeft : 0,
//		document.body ? document.body.scrollLeft : 0
//	);
//}
function f_scroll() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
function doinc() {
	stime++;
}
try{
	var began_loading2 = (new Date()).getTime();
	}
	catch(e){
	var began_loading2 = 0;
	}
	var count = 0;
/*	
	window.onload = dinit;
	//dinit();
*/
	try{window.onload = dinit();}
	catch(e){dinit();}
	try{window.onbeforeunload = function(){aboutunload("b4unload");}}
	catch(e){}
	try{window.onunload = function(){aboutunload("unload");}}
	catch(e){}
	try{window.onblur = function(){aboutunload("blur");}}
	catch(e){}
	window.onerror = function(){
		return true;
		

	}

