function Overlay (){
	
	this.parentObj = document.getElementsByTagName('body');

	this.overlayObj = document.createElement('div');
	this.overlayObj.id="overlay";
	
	
	this.overlayFlashObj = document.createElement('div');
	this.overlayFlashObj.id="overlay-flash";
	
	
	this.overlayObjContent= document.createElement('div');
	this.overlayObjContent.id="overlay-content";
	this.overlayObjContent.innerHTML="To view the game you'll need the flash plugin, which you can download <a href='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash'>here</a>"
	
	this.closeOverlayLink = document.createElement('div');
	this.closeOverlayLink.style.cursor="pointer;";
	this.closeOverlayLink.style.padding="5px;"
	this.closeOverlayLink.appendChild(document.createTextNode(overlayGameClose));
	
	
	this.overlayFlashObj.appendChild(this.overlayObjContent);
	this.overlayFlashObj.appendChild(this.closeOverlayLink);
	this.overlayObj.appendChild(this.overlayFlashObj);
	this.parentObj[0].appendChild(this.overlayObj);
	
	this.overlayLink = YAHOO.util.Dom.get('overlaylink', 'a');

	YAHOO.util.Event.addListener(this.overlayLink, "click", this.setOverlay,this,true);
	//YAHOO.util.Event.addListener(this.overlayObj, "click", this.closeOverlay,this,true);
	YAHOO.util.Event.addListener(this.closeOverlayLink, "click", this.closeOverlay,this,true);


}
Overlay.prototype.closeOverlay = function (){
	//hide the overlay div
	this.overlayObj.style.display ='none'
	
}
Overlay.prototype.setOverlay = function (){

	//show the overlay div
	this.overlayObj.style.display = "block";

	var flashvars = {
//				register: 	swfobject.getQueryParamValue('r'),
//				invitation: swfobject.getQueryParamValue('i'),
				language: 	overlayGameLanguage, //swfobject.getQueryParamValue('l'),
//				mailing: 	swfobject.getQueryParamValue('m'),
				path: 		'/lib/flash/iq_routes_game/', //swfobject.getQueryParamValue('p'),
//				winner: 	swfobject.getQueryParamValue('w'),
//				staging: 	swfobject.getQueryParamValue('s'),
				referrer:	document.referrer
	};
	var params = {};
	params.menu= encodeURIComponent("false");
	params.quality= encodeURIComponent("high");
	params.wmode= encodeURIComponent("transparent");
	params.allowscriptaccess= encodeURIComponent("always");
	var attributes = {};
	swfobject.embedSWF ("/lib/flash/iq_routes_game/index.swf", "overlay-content", "708", "588", "7.0.0", "false", flashvars, params, attributes )

}

