//' function for creating popup windows:
var newWindow = null;

// hide the div in which the flipbook is displayed.
// this function is called in Flash.
function closeFlipbook()
{
	document.getElementById("flipbookDiv").style.display = 'none';
}

// Display the flipbookDIv and write tags into its HTML
// to display the localized flipbook movie.
function openFlipbook()
{
	// set the position and size variables for the Flipbook:
	var dimObj = new dimObject();

	var str = "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\"" + dimObj.w +"\" HEIGHT=\"" + dimObj.h +"\" id=\"flipbook\" ALIGN=\"\">" + 
	"<PARAM NAME=movie VALUE=\"/flipbook.swf\">" + 
	"<PARAM NAME=loop VALUE=false>" + 
	"<PARAM NAME=play VALUE=false>" + 
	"<PARAM NAME=quality VALUE=high>" + 
	"<PARAM NAME=menu VALUE=false>" + 
	"<PARAM NAME=bgcolor VALUE=#E4D9BB>" + 
	"<EMBED src=\"/flipbook.swf\" loop=false play=false quality=high menu=false bgcolor=#E4D9BB WIDTH=\"" + dimObj.w +"\" HEIGHT=\"" + dimObj.h + "\" NAME=\"flipbook\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>" + 
	"</OBJECT>";
	var fbDiv = document.getElementById("flipbookDiv");
	fbDiv.innerHTML = str;
	fbDiv.style.position = 'absolute';
	fbDiv.style.left = dimObj.xPos;
	fbDiv.style.top = dimObj.yPos;
	fbDiv.style.display = 'inline';
	fbDiv.style.zIndex = 10;
	fbDiv.style.width = dimObj.w;
	fbDiv.style.height = dimObj.h;
	fbDiv.style.border = '1px solid #333366';
	//passVars(intLangID, "?intLangID=", ext);
}

/**
 * dimObject()
 * creates an object to set position attributes for Flipbook.
 * Attributes are set based on current language ID.
 */
function dimObject()
{
	this.xPos = 10; // default position from left of window
	this.yPos = 55; // default position from top of window
	this.h = 480; // default height of movie
	this.w = 640; // default width of movie
}

/**
 * passVars()
 * Sets names and values of variables and passes them to Flash via
 * window.document.objName.SetVariable("name", value);
 */
function passVars()
{
	var intLangID = passVars.arguments[0];
	var qs = passVars.arguments[1];
	var ext = passVars.arguments[2];
	window.document.flipbook.SetVariable("intLangID", intLangID);
	window.document.flipbook.SetVariable("qs", qs);
	window.document.flipbook.SetVariable("ext", ext);
}
