// 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 classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" '
      + ' WIDTH="' + flWidth + '"'
      + ' HEIGHT="' + flHeight + '"'
	    + ' id="' + flId + '">'
      + '<PARAM NAME="movie" VALUE="' + flName + FlRequestString + '">'
      + '<PARAM NAME="quality" VALUE="high">'
      + '<PARAM NAME="wmode" VALUE="transparent">'	 	  
      + '<PARAM NAME="bgcolor" VALUE="' + flColor + '">'
      + '<param name="allowScriptAccess" value="sameDomain" />'
      + '<param name="allowFullScreen" value="true" />'
      
	  // Embed
      + '<EMBED src="' + flName + FlRequestString + '"'
      + ' name="' +  flId + '"'
      + ' quality="high" bgcolor="' + flColor + '"'
      + ' wmode="transparent"'	  	  
      + ' WIDTH="' + flWidth + '"'
      + ' HEIGHT="' + flHeight + '"'
      + 'allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"'
      + '>'
      + '</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 = 1032;
	var myHeight = 772;
	
	if (myWidth > myScreenWidth){
		myWidth = myScreenWidth
	}

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