/* MAIN JAVASCRIPT */
/* KYLE DE FRANCO 2011_02_01 */

	/* DISGUISE ANY ERRORS */
		function noerrors() {window.status=document.title; return true;}
		window.onerror=noerrors;

	/* JQUERY */
		$(document).ready(
			function() {
				/* GENERATE THE TOP LINKS */
					$("#div_links_container").show();
					$.each(
						$("#div_links_container>a"),
						function(index) {
							$(this).css("background-image","url(_images/nav_0"+index+"_off.gif)");
							$(this).bind(
								"mouseover",
								function() {
									$(this).css("background-image","url(_images/nav_0"+index+"_on.gif)");
									if(index!=0) {
										$("#div_sublinks_container").fadeOut("slow");
									}
								}
							);
							$(this).bind(
								"mouseout",
								function() {
									$(this).css("background-image","url(_images/nav_0"+index+"_off.gif)");
								}
							);
						}
					);
				/* DISPLAY THE SUBLINKS */
					$("#div_links_container>a:first").bind(
						"mouseover",
						function() {
							$("#div_sublinks_container").fadeIn("slow");
						}
					);
				/* HIDE THE SUBLINKS */
					$("#div_sections,#div_title,#emb_flash").bind(
						"mouseover",
						function() {
							$("#div_sublinks_container").fadeOut("slow");
						}
					);
			}
		);

	/* THE FUNCTION TO OPEN THE ENGINE EXPLORER WINDOW */
		function window_engine() {
			$.fancybox(
				{
					'padding'	: '0',
					'width'		: 720,
					'height'	: 604,
					'autoScale'	: false,
					'transitionIn'	: 'none',
					'transitionOut'	: 'none',
					'href': 'engine_explorer/MP7_Explorer.html',
					'type'		: 'iframe'
				}
			);
		}
	/* UPDATE THE SPAN */
		function reason_counter(num) {
			document.getElementById("span_reason_counter").innerHTML=num;
			document.getElementById("div_reason_counter").style.display="block";
		}
