﻿$(document).ready(function (){
    var p = $('#specialsInner a').length;
    var j = $('#specialsInner a').innerWidth();
    var t = p * j;
    $('#specialsInner').css({width: t});    
    
    		function closeOtherSliders(){    		
    		    $(".shutter").show().animate({backgroundPosition: '(0px 0px)'}, 700);
    		    //$(".shutter").show().animate({backgroundPosition: '(0px 0px)'}, 600);
    		    //$(".shutter").not("#coachWeekendSlider .shutter").show().animate({backgroundPosition: '(0px 0px)'}, 600);
    		}

			//Set css in Firefox (Required to use the backgroundPosition js)
			$('.shutter1').css({backgroundPosition: '0px 0px'});
			$('.shutter2').css({backgroundPosition: '0px 0px'});
			$('.shutter3').css({backgroundPosition: '0px 0px'});
			$('.shutter4').css({backgroundPosition: '0px 0px'});

			//Animate the shutter  
			$("#coachWeekendSlider .link").mouseover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -152px)'}, 600, function(){$(this).hide()} );
			      closeOtherSliders();
			});
			$("#cheapWeekSlider .link").mouseover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -160px)'}, 600, function(){$(this).hide()} );			   
			      closeOtherSliders();
			});
			$("#flightWeekendSlider .link").mouseover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -233px)'}, 650, function(){$(this).hide()} );				    
			      closeOtherSliders();
			});
			$("#flyDriveSlider .link").mouseover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -280px)'}, 750, function(){$(this).hide()} );	
			      closeOtherSliders();
			});
			
			    
			/*$("#coachWeekendSlider .link").hover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -152px)'}, 600 );
			    }, function() {
			      $(this).parent().stop().animate({backgroundPosition: '(0px 0px)'}, 500 );
			});	
			$("#cheapWeekSlider .link").hover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -160px)'}, 600 );
			    }, function() {
			      $(this).parent().stop().animate({backgroundPosition: '(0px 0px)'}, 500 );
			});
			$("#flightWeekendSlider .link").hover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -233px)'}, 650 );
			    }, function() {
			      $(this).parent().stop().animate({backgroundPosition: '(0px 0px)'}, 550 );
			});
			$("#flyDriveSlider .link").hover(function(){
			      $(this).parent().stop().animate({backgroundPosition: '(0px -280px)'}, 750 );
			    }, function() {
			      $(this).parent().stop().animate({backgroundPosition: '(0px 0px)'}, 620 );
			});*/
			
			
			
});
