// JavaScript
var $j = jQuery.noConflict();  
$j(document).ready(function() {
   
	$j("ul#nav li a").addClass("js");
	$j("ul#nav li a").hover(
      function () {
       $j(this).stop(true,true).animate({backgroundPosition:"(0 0)"}, 200);
      $j(this).animate({backgroundPosition:"(0 0px)"}, 140);
      }, 
      function () {
       $j(this).animate({backgroundPosition:"(0 -143px)"}, 200);

      }
    );

});


/*

$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
$("ul#nav li.b span").click(function () { //When trigger is clicked...
    //Following events are applied to the subnav itself (moving subnav up and down)
    $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
    $(this).parent().hover(function () {
    }, function () {
        $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
    });
    //Following events are applied to the trigger (Hover events for the trigger)
}).hover(function () {
    $(this).addClass("subhover"); //On hover over, add class "subhover"
}, function () { //On Hover Out
    $(this).removeClass("subhover"); //On hover out, remove class "subhover"
});





    $(function () {
        // Set starting slide to 1
        var startSlide = 1;
        // Get slide number if it exists
        if (window.location.hash) {
            startSlide = window.location.hash.replace('#', '');
        }
        // Initialize Slides
        $('#slides').slides({
            preload: true,
            preloadImage: 'images/loading.gif',
            generatePagination: true,
            generateNextPrev: true,
            play: 5000,
            pause: 2500,
            hoverPause: true,
            // Get the starting slide
            start: startSlide,
            animationComplete: function (current) {
                // Set the slide number as a hash
                window.location.hash = '#' + current;
            }
        });
    });
});
*/
/*$(function(){
			// Set starting slide to 1
			var startSlide = 1;
			// Get slide number if it exists
			if (window.location.hash) {
				startSlide = window.location.hash.replace('#','');
			}
			// Initialize Slides
			$('#slides').slides({
				effect: 'fade',
				preload: true,
				preloadImage: 'images/loading.gif',
				generatePagination: true,
				generateNextPrev: true;
				play: 5000,
				pause: 2500,
				hoverPause: true,
				// Get the starting slide
				start: startSlide,
				animationComplete: function(current){
					// Set the slide number as a hash
					window.location.hash = '#' + current;
				}
			});
	});*/


/*$(document).ready(function() {
	 
	 $('#nav a').each(function(){
                    $(this).stop().animate({
                        'marginTop':'-143px'
                    },d+=150);
                });
	$("#nav > li a").addClass("js");
	$("#nav > li").hover(
      function () {
        $('a', $(this)).stop(true,true).animate({backgroundPosition:"(0 0)"}, 200);
        $('a', $(this)).animate({backgroundPosition:"(0 -1px)"}, 150);
      }, 
      function () {
        $('a', $(this)).animate({backgroundPosition:"(0 -135px)"}, 200);

      }
    );

});

/*
Document$(document).ready(function() {
  
                var d=300;
                $('#nav a').each(function(){
                    $(this).stop().animate({
                        'marginTop':'-143px'
                    },d+=150);
                });

                $('#nav > li').hover(
                function () {
                    $('a',$(this)).stop().animate({
                        'marginTop':'-2px'
                    },200);
                },
                function () {
                    $('a',$(this)).stop().animate({
                        'marginTop':'-143px'
                    },200);
                }
            );
           
			
});*/
