// 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];
    		}
  		} 
	}
//
//
function loadPreloader(){
/////////////////////  DEFINITIONS
	  movieName = "preloader";
      flName = "preloader.swf";
      flColor = "#FFFFFF";
	  flWidth = "970";
      flHeight = "570";
	  flId = "turnpages";
	  FlRequestString = "?gPage=" + top.getQueryVariable("openPage");		  
	  FlRequestString = FlRequestString + "&gCall=" + top.getQueryVariable("call");	 
/////////////////////  HTML
	  FlObject = '<OBJECT '
      + ' 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);
}
//
// RESIZE AND CENTER BROWSER WINDOW
	if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if (document.layers||document.getElementById) {
		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
		top.window.outerHeight = screen.availHeight;
		top.window.outerWidth = screen.availWidth;
		}
	}

	var myScreenWidth = screen.availWidth;
	var myScreenHeight = screen.availHeight;
	var myX0 = (myScreenWidth/2) - 512;
	var myY0 = (myScreenHeight/2) - 384;
	if (myX0 < 0) {
		myX0 = 0;
	}
	if (myY0 < 0) {
		myY0 = 0;
	}	
	window.moveTo(myX0,myY0);
	
	var myWidth = 1024;
	var myHeight = 768;
	
	if (myWidth > myScreenWidth){
		myWidth = myScreenWidth
	}

	if (myHeight > myScreenHeight){
		myHeight = myScreenHeight
	}
	
	self.resizeTo(myWidth,myHeight);
	var win= null;
//// END
