jQuery(window).bind("load", function() {
				jQuery("div#slider").codaSlider();
				var current = parseInt(location.hash.slice(1)) - 1;
				if (current >= 0) {
				$("#feature-nav a:eq("+ current +")").addClass("on");
				}
				else {
					$("#feature-nav a:eq(0)").addClass("on");
				}

				$("#feature-nav a").click(function(){
					$("#feature-nav a").removeClass("on");
					$(this).addClass("on");
				});
				
				$("#leftarrow, #rightarrow").click(function() {					 
					var current = parseInt(location.hash.slice(1));
					current -= 1;
					$("#feature-nav a").removeClass("on");
					$("#feature-nav a:eq("+ current + ")").addClass("on");
					clearTimeout(delay);
				});				
			});
			
			
			$(document).ready(function(){
				$.browser.msie6 = $.browser.msie && ($.browser.version && $.browser.version < 7 || /6.0/.test(navigator.userAgent)); 
    			$("a.disable").click(function() {return false;});
    
       			 $("a.disable").click(function() {
       			 	$("#overlay").css("height",$("body").height()+1200);
       			 	$("#overlay").show().animate({opacity: 0.8}, 1000);
       			 	$("#ajax").load($(this).attr("href"), function() {
       			 		$(this).fadeIn(1000);
       			 		$("body").scrollTo("#overlay",1000);
       			 		if($.browser.msie6){
     						$("#state").hide();
  						}
       			 	});      			 	
       			 	
       			 	$("#close").live("click",function() {
       			 		$("#overlay, #ajax").fadeOut("slow", function() {
       			 			$(this).empty();
       			 			if($.browser.msie6){
     						$("#state").show();
  						}
       			 		});
       			 	});
       			 });
       			 
       			 
       			 // Page Navigation loading
       			 
       			 $("#page1link").click(function(){
					$("#page2link").css("backgroundPosition","-227px 0");
					$("#page3link").css("backgroundPosition","-447px 0");
					$("#page2, #page3").hide();
					$("#page1").show();
					$(this).css("backgroundPosition","-0px -82px");
					return false;
				});
				$("#page2link").click(function(){
					$("#page1link").css("backgroundPosition","0 0");
					$("#page3link").css("backgroundPosition","-447px 0");
					$("#page1, #page3").hide();
					$("#page2").show();
					$(this).css("backgroundPosition","-227px -82px");
					return false;
				});
				$("#page3link").click(function(){
					$("#page1link").css("backgroundPosition","0 0");
					$("#page2link").css("backgroundPosition","-227px 0");
					$("#page1, #page2").hide();
					$("#page3").show();
					$(this).css("backgroundPosition","-447px -82px");
					return false;
				});
				$("#offerdets").click(function(){
					$("#page1link").css("backgroundPosition","0 0");
					$("#page2link").css("backgroundPosition","-227px 0");
					$("#page3link").css("backgroundPosition","-447px 0");
					$("#page1, #page2").hide();
					$("#page3").show();
					$(this).css("backgroundPosition","-227px -82px");
					return false;
				});
       			 
       			 // Feature Panel switches
       			 
       			 $("#magazine .more").click(function() {
       			 	$(this).fadeOut();
       			 	$("#feature-nav, #leftarrow, #rightarrow").fadeOut();
       			 	$(this).parent().find("img").animate({marginLeft: "-428px"}, 800, function() {
       			 		$(this).parent().prepend("<a href='javascript:void(0);' class='close' style='display:none;'></a>");
       			 		$(this).parent().find(".close").fadeIn(500);
       			 	});
       			 });
       			 
       			 $("#pt .more").click(function() {
       			 	$(this).fadeOut();
       			 	$("#feature-nav, #leftarrow, #rightarrow").fadeOut();
       			 	$(this).parent().find("img").animate({marginLeft: "-442px"}, 800, function() {
       			 		$(this).parent().prepend("<a href='javascript:void(0);' class='close' style='display:none;'></a>");
       			 		$(this).parent().find(".close").fadeIn(500);
       			 	});
       			 });
       			 
       			  $("#rd .more").click(function() {
       			 	$(this).fadeOut();
       			 	$("#feature-nav, #leftarrow, #rightarrow").fadeOut();
       			 	$(this).parent().find("img").animate({marginLeft: "-435px"}, 800, function() {
       			 		$(this).parent().prepend("<a href='javascript:void(0);' class='close' style='display:none;'></a>");
       			 		$(this).parent().find(".close").fadeIn(500);
       			 	});
       			 });
       			 
       			 // Close button
       			 $(".close").live("click", function() {
       			 	$(this).fadeOut(function() {$(this).remove();});
       			 	$("#feature-nav, #leftarrow, #rightarrow").fadeIn(1000);
       			 	$(this).parent().find("img").animate({marginLeft: "0"}, 800, function() {
       			 		$(this).siblings(".more").fadeIn(500);
       			 	});		 	
       			 });
	 
	 
       			 
       			// Auto Play Slider
				autoPlay();	
     
       			function autoPlay() {
       				$("#rightarrow").trigger("click");
       				delay = setTimeout(autoPlay,5000);
       			}
       			
       			$("#feature").click(function() {
       				clearTimeout(delay);
       			});
       			 
    		});