////////////////////////////////////////////////////////////////////////////////
// BEGIN
//

	var winW = 630, winH = 460;

	function getWindowDimensions()
	{
		if( parseInt( navigator.appVersion ) > 3 )
		{
			if( navigator.appName == "Netscape" )
			{
				winW = window.innerWidth;
				winH = window.innerHeight;
		 	}
			if( navigator.appName.indexOf( "Microsoft" ) != -1 )
			{
				winW = document.body.offsetWidth;
				winH = document.body.offsetHeight;
			}
		}
	}

	// -- Menu ----------------------------------------------------------------
	var menuTimer;

	function init()
	{
		// JS Enabled
		var contentDIVElem;
		if( (contentDIVElem = document.getElementById( "contentDIV" )) !== null )
			contentDIVElem.style.overflow = "hidden";
		
		initSubMenus();
		getWindowDimensions();
	}
	
	function initSubMenus()
	{
		var menuElems = document.getElementById( "subMenus" ).getElementsByTagName( "div" );
		for( var n = 0; n < menuElems.length; n++ )
		{
			// Menu Container
			if( menuElems[n].className == "subMenu" || menuElems[n].className == "subMenuMain" )
			{
				menuElems[n].onmouseover = function()
				{
					clearHideMenus();
				}
				menuElems[n].onmouseout = function()
				{
					startHideMenus();	
				}
			}
		}	
	}
	
	function showMenu( mnu )
	{
		hideMenus();
		var menuElem = document.getElementById( mnu );
			menuElem.style.visibility = "visible";
			
		clearHideMenus();
	}
	
	function hideMenus()
	{
		var menuElems = document.getElementById( "subMenus" ).getElementsByTagName( "div" );
		for( var n = 0; n < menuElems.length; n++ )
		{
			// Menu Container
			if( menuElems[n].className == "subMenu" || menuElems[n].className == "subMenuMain" )
			{
				menuElems[n].style.visibility = "hidden";
			}
		}		
		
		clearHideMenus();
	}
	
	function startHideMenus()
	{
		clearTimeout( menuTimer );
		menuTimer = setTimeout( "hideMenus()", 2000 );
	}
	
	function clearHideMenus()
	{
		clearTimeout( menuTimer );
	}
	
	// -- End Menu ------------------------------------------------------------
	// -- SWF -----------------------------------------------------------------
	function showSWF( id, type )
	{
		// Create SWF Container
		var swfContainer = document.createElement( "div" );
			swfContainer.id = "swfContainer";
			swfContainer.className = "posABS";

		var w = 0;
		var h = 0;
		if( type == "minisite" )
		{
			h = 329;
			w = 688;			
		}
		else
		{
			h = 283;
			w = 480;
		}
		
		// Position  Element
		swfContainer.style.top = ((winH - h) / 2) + "px";
		swfContainer.style.left = ((winW - w) / 2) + "px";
		swfContainer.style.width = w + "px";
		
		swfContainer.innerHTML = "<div><span class=\"myClose\" onClick=\"hideSWF();\">X</span></div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\""+ w +"\" height=\""+ h +"\"><param name=\"movie\" value=\"ads/"+ id +".swf\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed src=\"ads/"+ id +".swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+ w +"\" height=\""+ h +"\" name=\"wmode\" value=\"transparent\"></embed></object>";
		
		document.body.appendChild( swfContainer );
	}
	function hideSWF()
	{
		document.body.removeChild( document.getElementById( "swfContainer" ) );
	}
	// -- End SWF -------------------------------------------------------------

//
// END
////////////////////////////////////////////////////////////////////////////////