// JavaScript Document



$(document).ready(function(){
	
	// detects webkit and allows dom to fully load code is the same in both versions
	
	if($.browser.webkit)
	
	{
			
			$(window).load(function(){
				
				 // tooltip code
		 
				$("#tooltip").hide();
				
				$('a[id^="footer-hover"]').tooltip({
					track: true,
					delay: 0,
					showURL: false,
					showBody: " - ",
					fade: 250
				}).mouseover(function() {
					
					Cufon.refresh();
					
				});
			
				// slideshow code
				
				if ($('.slideshow').length > 0) {
					$('.slideshow').cycle({
						fx: 'fade',
						cleartype: true,
						cleartypeNoBg: true,
						startingSlide: 1,  // start on the slide that was in the markup
						timeout:  5000,
						speed:    900,
						prev:    '#prev-btn',
						next:    '#next-btn'
					});
				}
				
				if ($('.slideshow-right').length > 0) {
					$('.slideshow-right').cycle({
						fx: 'fade',
						cleartype: true,
						cleartypeNoBg: true,
						startingSlide: 1,  // start on the slide that was in the markup
						timeout:  4000,
						speed:    600,
						prev:    '#prev-btn',
						next:    '#next-btn'
					});
				}
		
		});
		
		
	}
	
	else 
	
	{

		 // tooltip code
		 
		$("#tooltip").hide();
		
		$('a[id^="footer-hover"]').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		}).mouseover(function() {
			
			Cufon.refresh();
			
		});
	
		// slideshow code
		
		if ($('.slideshow').length > 0) {
			$('.slideshow').cycle({
				fx: 'fade',
				cleartype: true,
				cleartypeNoBg: true,
				startingSlide: 1,  // start on the slide that was in the markup
				timeout:  5000,
				speed:    900,
				prev:    '#prev-btn',
				next:    '#next-btn'
			});
		}
		
		if ($('.slideshow-right').length > 0) {
			$('.slideshow-right').cycle({
				fx: 'fade',
				cleartype: true,
				cleartypeNoBg: true,
				startingSlide: 1,  // start on the slide that was in the markup
				timeout:  4000,
				speed:    600,
				prev:    '#prev-btn',
				next:    '#next-btn'
			});
		}
	}

});

