// TurnPages functions
// (c) 2006, Forward Thinking BV
// www.turnpages.com
//
function getQueryVariable(variable) {
  		var query = window.location.search.substring(1);
  		var vars = query.split("&");
  		for (var i=0;i<vars.length;i++) {
    		var pair = vars[i].split("=");
    		if (pair[0] == variable) {
      			return pair[1];
    		}
  		} 
	}
//
//////////// MAKE SESSION ////////////////
function makeSessionID(){
	var mySession = "pl_";
	for (var i = 0; i<32; i++) {
		//mySession = mySession+chr(Math.round(25*Math.random()+65);
		mySession = mySession+chr(Math.round(25*Math.random()+65));
	}
	return mySession;
}
//
function chr(CHARACTER_CODE){
	return String.fromCharCode(CHARACTER_CODE);
}
//
function loadPreloader(){
/////////////////////  DEFINITIONS
	  movieName = "preloader";
      flName = "preloader.swf";
      flColor = "#FFFFFF";
	  flWidth = "970";
      flHeight = "570";
	  flId = "turnpages";
	  FlRequestString = "?gPage=" + getQueryVariable("openPage");		
	  FlRequestString = FlRequestString + "&gSession=" + gSession;	 	    
	  FlRequestString = FlRequestString + "&gCall=" + getQueryVariable("call");	 
/////////////////////  HTML
	  FlObject = '<OBJECT '
	   +  'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'	  
      + ' WIDTH="' + flWidth + '"'
      + ' HEIGHT="' + flHeight + '"'
	  + ' id="' + flId + '">'
      + '<PARAM NAME="movie" VALUE="' + flName + FlRequestString + '">'
      + '<PARAM NAME="quality" VALUE="high">'
      + '<PARAM NAME="bgcolor" VALUE="' + flColor + '">'
	  // Embed
      + '<EMBED src="' + flName + FlRequestString + '"'
      + ' name="' +  flId + '"'
      + ' quality="high" bgcolor="' + flColor + '"'
      + ' WIDTH="' + flWidth + '"'
      + ' HEIGHT="' + flHeight + '"'
      + '>'
      + '</EMBED></OBJECT>'
	document.write(FlObject);
}
//
//
function make_log(){	
	$logURL = "http://flavourites.turnpages.nl/services/php_log/log_browser.php?";
	$browserName = navigator.appName; 
	$browserVersion = navigator.appVersion; 
	$browserOS = navigator.platform;
	$referrer = document.referrer;  
	
	$width = screen.width; 
	$height = screen.height; 
	$color = screen.colorDepth; 

	$t0 = "tSession="+gSession;
	$t1 = "&tBrowserName="+$browserName;
	$t2 = "&tBrowserVersion="+$browserVersion;
	$t3 = "&tBrowserOS="+$browserOS;
	$t4 = "&tReferrer="+$referrer;
	
	$t5 = "&tWidth="+$width;
	$t6 = "&tHeight="+$height;
	$t7 = "&tColorDepth="+$color;
	$t8 = "&tCall="+getQueryVariable("call");
	
	$myVars = $t0 + $t1 + $t2 + $t3 + $t4 + $t5 + $t6 + $t7 + $t8;
/*	document.write($myVars); */
	document.write("<img src='" + $logURL + $myVars+" ' width=0 height=0 ");
}
//
