	  var menuOut = false; 
	  /*
	  function mouseOver() { 
		$(".submenu").one("mouseenter", function() {  

				$("#" + this.id + " .pop_over").fadeIn("fast", mouseOut); 
			
			});
	  }
	  function mouseOut () {
	  	$(".submenu .pop_over").one("mouseleave", function() { 
			$(this).fadeOut("fast", function () { 

				setTimeout(mouseOver, 1000); 
				}); 
			});
		}
		*/
		function doOnLoad() { 
			var popi=0; 
			var extendablei=0; 
			var extHiddenImg = "img/hidden-arrow.png"; 
			var extShowingImg = "img/showing-arrow.png";
			
			$(".submenu").bind("mouseenter", function(e) {   	
				if (menuOut <= 0) {
					$("#" + this.id + " .pop_over").show();//fadeIn("fast");
					menuOut+=1; 
					var myImg = $(this).children("img:not(.active)");
					if (myImg != undefined && myImg.length != 0)
						myImg.attr({src: "img/categories/" + myImg.attr("id").substr(3,1) + "on.gif"});
				}	
				});
					
			$(".submenu").bind("mouseleave", function(e) { 
				menuOut-=1;
				//$("#" + this.id + " .pop_over").fadeOut("fast"); 
				$(this).children(".pop_over").hide();//fadeOut("fast");
				var myImg = $(this).children("img:not(.active)");
				if (myImg != undefined && myImg.length != 0)
					myImg.attr({src: "img/categories/" + myImg.attr("id").substr(3,1) + "off.gif"});				
			});
			$(".some_media img").hide();
			$(".some_media").mouseover(function(e) { 
				$(this).children('img').show();
			});				
			$(".some_media").mouseout(function(e) { 
				$(this).children('img').hide();
			});
			
			//mouseOver();
			
			$(".pop_over li").bind("mouseover", function(e) { 
				if (this.id == "" || !this.id) { 
					this.id = "subpop_" + popi;
					popi++; 
				}
				$("#" + this.id).addClass("highlight");
			});
			
			$(".pop_over li").bind("mouseout", function(e) { 
				
				$("#" + this.id).removeClass("highlight"); 
			});
			
			$("div.extendable").bind("click", function(e) {
					if (this.id == "" || !this.id) { 
					this.id = "extendable_" + extendablei;
					extendablei++; 
				}
				$("#" + this.id + " div").slideToggle("slow"); 
				if ($("#" + this.id + " img").attr("src") == extHiddenImg)
					$("#" + this.id + " img").attr("src", extShowingImg);
				else
					$("#" + this.id + " img").attr("src", extHiddenImg);			
			});
		}
		function mediaInfo() { 
		}
		function showMovie(flv) { 
		
				 flashembed("active_media", 
		
			/* 
				first argument supplies standard Flash parameters. See full list:
				http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
			*/
			{
				src:'img/FlowPlayerLight.swf',
				width: 320, 
				height: 268
			},
			
			/*
				second argument is Flowplayer specific configuration. See full list:
				http://flowplayer.org/player/configuration.html
			*/
			{config: {   
				autoPlay:true,
				loop: false,
				controlBarBackgroundColor:'0x464646',
				initialScale: 'scale',
				videoFile: "../" + flv,
				showFullScreenButton: false,
				showLoopButton: false,
				showPlayListButtons: false,
				loop: false, 
				timeDisplayFontColor: '0xFFFFFF'
			}} 
		);
		$("#active_media").removeClass("active_media_image"); 
		
		$("#active_media").addClass("active_media_video");
		}
		function getMedia(id) {
		/*
		$.get("./ajaxGetMedia.php", {media_id: id },
			  function(data){
			   $('#media_div').html(data); 
			  });
			  */
		$(".bd.additional_media div.active_media").removeClass("active_media");
		$("#media_" + id).addClass("active_media");
		$.getScript("./ajaxGetMedia.php?media_id=" + id + "&page=" + phpPageId);
		}
		function showSupplement(text, caption) { 
			if (text == "" || text == "<p></p>" )
				$("#supplement").hide();
			else $("#supplement").show(); 
			$("#supplement .media_caption").html(caption); 
			$("#supplement .translation-text").html(text); 
		}
		function changedDropDown() { 
			var pageToGet = $("#drop-down").attr("value");
			if (pageToGet == 0) {
			$.getScript("./ajaxGetDropDown.php?reset=true&pageToGet=phpPageTitle"); 
			} else {
			$.getScript("./ajaxGetDropDown.php?pageToGet=" + pageToGet); 
			}
		}
	function showBugForm() { 
	$('#popup-container').removeClass('small');
	$('#popup-container .hidden').slideToggle();
	 
}
		
function submitBugForm() { 
		var vWidth = window.innerWidth | document.body.clientWidth | 0;
		var vHeight = window.innerHeight | document.body.clientHeight | 0;
		$.post('ajaxBugReport.php', {width: vWidth, height: vHeight, text: $('#bug-report').val()}, function(data) {
			 	$('#bug-report').val("");
				$('#popup-container .hidden').slideUp("normal", function() { $('#popup-container').addClass('small') }); 
			});
		return false;
	}			
