

jQuery(document).ready(function($) {
	$.preLoadImages("images/rotator1.jpg", "images/rotator2.jpg", "images/rotator3.jpg", "images/rotator4.jpg", "images/rotator5.jpg", "images/rotator6.jpg", "images/rotator7.jpg", "images/rotator8.jpg", "images/rotator9.jpg", "images/rotator10.jpg", "images/rotator11.jpg", "images/rotator12.jpg", "images/rotator13.jpg", "images/rotator14.jpg", "images/rotator15.jpg", "images/rotator16.jpg", "images/rotator17.jpg", "images/rotator18.jpg", "images/rotator19.jpg", "images/rotator20.jpg");
	
		$("#topNav ul li#home").not(".currentPage").hover(function() {$(this).stop().animate({backgroundPosition: '0px -62px'})}, function() {$(this).stop().animate({backgroundPosition: '0px 0px'})});		
		$("#topNav ul li#history").not(".currentPage").hover(function() {$(this).stop().animate({backgroundPosition: '-106px -62px'})}, function() {$(this).stop().animate({backgroundPosition: '-106px 0px'})});
		$("#topNav ul li#service").not(".currentPage").hover(function() {$(this).stop().animate({backgroundPosition: '-211px -62px'})}, function() {$(this).stop().animate({backgroundPosition: '-211px 0px'})});
		$("#topNav ul li#elitedifference").not(".currentPage").hover(function() {$(this).stop().animate({backgroundPosition: '-317px -62px'})}, function() {$(this).stop().animate({backgroundPosition: '-317px 0px'})});
		$("#topNav ul li#managementteam").not(".currentPage").hover(function() {$(this).stop().animate({backgroundPosition: '-423px -62px'})}, function() {$(this).stop().animate({backgroundPosition: '-423px 0px'})});
		$("#topNav ul li#relatedlinks").not(".currentPage").hover(function() {$(this).stop().animate({backgroundPosition: '-529px -62px'})}, function() {$(this).stop().animate({backgroundPosition: '-529px 0px'})});
		$("#topNav ul li#contactusdirections").not(".currentPage").hover(function() {$(this).stop().animate({backgroundPosition: '-634px -62px'})}, function() {$(this).stop().animate({backgroundPosition: '-634px 0px'})});
		
		
		
		/*var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

		//Set a background image(thumbOver) on the <a> tag - Set position to bottom
		$(this).find("a").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

		//Animate the image to 0 opacity (fade it out)
		$(this).find("span").stop().fadeTo('slow', 0 , function() {
			$(this).hide() //Hide the image after fade
		});
	} , function() { //on hover out...
		//Fade the image to full opacity 
		$(this).find("span").stop().fadeTo('slow', 1).show();

	});*/
});

var mygallery=new fadeSlideShow({
	wrapperid: "slideShow1", //ID of blank DIV on page to house Slideshow
	dimensions: [184, 146], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [
		["images/rotator1.jpg"],
		["images/rotator5.jpg"],
		["images/rotator9.jpg"],
		["images/rotator13.jpg"],
		["images/rotator17.jpg"]
	],
	displaymode: {type:'auto', pause:4000, cycles:0, wraparound:false,randomize:false},
	persist: false, //remember last viewed slide and recall within same session?
	fadeduration: 500, //transition duration (milliseconds)
	descreveal: "ondemand",
	togglerid: "",
	oninit: function(){
	setTimeout(secondShow, 1000);
	}
})

function secondShow() {
	window.mygallery2=new fadeSlideShow({
	wrapperid: "slideShow2", //ID of blank DIV on page to house Slideshow
	dimensions: [184, 146], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [
		["images/rotator6.jpg"],
		["images/rotator10.jpg"],
		["images/rotator14.jpg"],
		["images/rotator18.jpg"],
		["images/rotator2.jpg"]
	],
	displaymode: {type:'auto', pause:4000, cycles:0, wraparound:false,randomize:false},
	persist: false, //remember last viewed slide and recall within same session?
	fadeduration: 500, //transition duration (milliseconds)
	descreveal: "ondemand",
	togglerid: "",
	oninit: function(){
	setTimeout(thirdShow, 1000);
	}
});
	
function thirdShow() {
	window.mygallery3=new fadeSlideShow({
	wrapperid: "slideShow3", //ID of blank DIV on page to house Slideshow
	dimensions: [184, 146], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [
		["images/rotator7.jpg"],
		["images/rotator11.jpg"],
		["images/rotator15.jpg"],
		["images/rotator19.jpg"],
		["images/rotator3.jpg"]
	],
	displaymode: {type:'auto', pause:4000, cycles:0, wraparound:false,randomize:false},
	persist: false, //remember last viewed slide and recall within same session?
	fadeduration: 500, //transition duration (milliseconds)
	descreveal: "ondemand",
	togglerid: "",
	oninit: function(){
	setTimeout(fourthShow, 1000);
	}
});
	
function fourthShow() {
	window.mygallery4=new fadeSlideShow({
	wrapperid: "slideShow4", //ID of blank DIV on page to house Slideshow
	dimensions: [184, 146], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [	
		["images/rotator8.jpg"],
		["images/rotator12.jpg"],
		["images/rotator16.jpg"],
		["images/rotator20.jpg"],
		["images/rotator4.jpg"]
		
	],
	displaymode: {type:'auto', pause:4000, cycles:0, wraparound:false,randomize:false},
	persist: false, //remember last viewed slide and recall within same session?
	fadeduration: 500, //transition duration (milliseconds)
	descreveal: "ondemand",
	togglerid: ""
	});}}}
