// ------------------   infoBubble Script   -------------------
// Made for use of div or any other block tag as a popup bubble.
// Users can input their own coordinates or use mouse coordinates.
// Those are the css styles that I used to make the bubble.
//
// #infoBubble{
//	position:absolute;
//	width:291px;
//	height:366px;
//	background-image:url(../../siteImages/genrePage/bubble.png);
//	background-position:top left;
//	background-repeat:no-repeat;
//	display:none;
//}
var initializePage=0;
			function bubbleThis() {
				document.getElementById("infoBubble").style.display = "block"	;
				document.getElementById("infoBubble").style.left = 100 + "px";
				document.getElementById("infoBubble").style.top = -30 + "px";
				document.getElementById("infoBubble").style.zIndex = "1";
				document.getElementById("infoBubble").parentNode.parentNode.style.zIndex = "1";
												
			}

			function bubble(Bx,By) {
				/*document.getElementById("infoBubble").style.display = "none"	;*/
				document.getElementById("infoBubble").style.zIndex = "1";
				var browser=navigator.appName;
				/*if (navigator.appVersion.match(/MSIE 6/))// for IE6 browser (display gif image instead of png).
				{
					document.getElementById("infoBubble").style.backgroundImage = "url(http://cdn.exent.com/freeride_marketing/website/siteImages/genrePage/bubble.gif)";
				}*/
				
				if(Bx !="" && Bx != null && By !="" && By != null) { // The Bubble x and y will be controll by the user.
					document.getElementById("infoBubble").style.left = Bx + "px";
					document.getElementById("infoBubble").style.top = By + "px";
				}
				else {// The Bubble x and y will be controll by the mouse coordinates.
					
						if (browser=="Microsoft Internet Explorer") // for IE browser
						{
							document.getElementById("infoBubble").style.left = window.event.clientX + "px";
							document.getElementById("infoBubble").style.top = window.event.clientY  + "px";
						}
						else
						{
							onmouseover = function(e) // for other Browser
							{
								document.getElementById("infoBubble").style.left = e.clientX + "px";
								document.getElementById("infoBubble").style.top = e.clientY  + "px";
							}
						}
					
				}
				/*t = setTimeout("document.getElementById('infoBubble').style.display = 'block'",0);*/
				document.getElementById('infoBubble').style.display = 'block';
											
			}
			
			function bubbleOut() {
				document.getElementById("infoBubble").style.display = "none"	;
				/*for (i=0;i < 12;i++) {
					document.getElementById("gameCatalog").getElementsByTagName("div").item(i+2).style.zIndex = "0";
				}*/
			}
			
		
		//Show and hide elemnts that overtop the info bubble.
		function hideElm(elm) {
			document.getElementById(elm).style.display = "none";	
		}
		function showElm(elm) {
			document.getElementById(elm).style.display = "block";	
		}
		//Send information about the current game to the info bubble.
		function bubbleInfo(gid)
		{
			document.getElementById('infoBubble').style.display="none";
			bUrl = "http://www.freeridegames.com/online-games/genrePageBubble.html";
			document.getElementById('bubbleIframe').src = bUrl + "?ID="+gid;
			initializePage=1; 
			
		}
		function loadedBubble()
		{
			if (initializePage>0)
			
			{document.getElementById('infoBubble').style.display='block'}
		}