/* <![CDATA[ */
	//Animate Background
		var backgroundwidth = 1024;
		var offset = 0;
		function scrollbackground() {
			offset = (offset < 1) ? offset + (backgroundwidth - 1) : offset - 1;
			$('#backdrop').css("background-position", offset + "px" + " 0");
			setTimeout(function() {
				scrollbackground();
				},50
			);
		}
		$(document).ready(function(){
			scrollbackground();
		});
		
	//Animate Navigation Bar
		$(document).ready(function(){
			$('#navigation li')
			.css( {backgroundPosition: "0 -20px"} )
			.css( {padding: "5px 0 0 0"} )
			.mouseover(function(){
				$(this).stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:150})
			})
			.mouseout(function(){
				$(this).stop().animate({backgroundPosition:"(0 -20px)", padding:"5px 0 0 0"}, {duration:150})
			})
		});
		
	// Below is a very convoluted way of having the navigation specific for each page //
		$(document).ready(function(){
			var sPath = window.location.pathname;
			var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
			if(sPage == "index.html" || sPage == "") {
				$('#nav-getstarted').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-latestreviews').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-relatedlinks').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-watchmichael').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#navigation li#nav-home').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:750})
				/* Repeat animation */ 
				$(this).mouseover(function(){
					setTimeout(function() { $('#navigation li#nav-home').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:250}) },5 );
				});
			} else if(sPage == "get-started.html") {
				$('#nav-home').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-latestreviews').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-relatedlinks').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-watchmichael').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#navigation li#nav-getstarted').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:750})
				/* Repeat animation */ 
				$(this).mouseover(function(){
					setTimeout(function() { $('#navigation li#nav-getstarted').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:250}) },5 );
				});
			} else if(sPage == "latest-reviews.html") {
				$('#nav-home').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-getstarted').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-relatedlinks').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-watchmichael').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#navigation li#nav-latestreviews').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:750})
				/* Repeat animation */ 
				$(this).mouseover(function(){
					setTimeout(function() { $('#navigation li#nav-latestreviews').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:250}) },5 );
				});
			} else if(sPage == "related-links.html") {
				$('#nav-home').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-getstarted').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-latestreviews').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-watchmichael').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#navigation li#nav-relatedlinks').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:750})
				/* Repeat animation */ 
				$(this).mouseover(function(){
					setTimeout(function() { $('#navigation li#nav-relatedlinks').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:250}) },5 );
				});
			} else if(sPage == "watch-michael.html") {
				$('#nav-home').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-getstarted').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-latestreviews').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#nav-relatedlinks').css("backgroundImage","url(images/nav-button-off.png)"); 
				$('#navigation li#nav-watchmichael').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:750})
				/* Repeat animation */ 
				$(this).mouseover(function(){
					setTimeout(function() { $('#navigation li#nav-watchmichael').stop().animate({backgroundPosition:"(0 0px)", padding:"25px 0 0 0"}, {duration:250}) },5 );
				});
			}
		});
		
		function openWindow(){
			// Enable target="_blank" and add " opens in a new window" to the title - necessary for valid code with a Strict doctype
			$("a[rel=external]").each(function () {
			  $(this).attr("title", $(this).attr("title")+" (opens in a new window)");
			})
			.click(function(){
				window.open($(this).attr("href"));
				return false;
			});
		}
		
		$(document).ready(function(){
			openWindow();
		});

		// SUPPRESS ALL JAVASCRIPT ERRORS 
		function silentErrorHandler() {return true;}
		window.onerror=silentErrorHandler;

/* ]]> */