jQuery(document).ready(function(){		
							
	$("#navigation a.loft-conversions-a").parent().append("<span class='showSubnav'></span>");
		//Only shows drop down trigger when JS is enabled (adds empty span tag after ul.subnav)

		$("#navigation a.loft-conversions-a, #navigation li span.showSubnav").hover(function() { //When trigger is hovered...
		
		//Drop down the subnav on hover
		$(this).parent().find("ul.subnav").slideDown('fast').show();

		$(this).parent().hover(function() {
		}, function(){
			//When the mouse hovers out of the subnav, move it back up
			$(this).parent().find("ul.subnav").slideUp('slow');
		});

		//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"
	});
								
	// General CSS Styling
	// e.g.
	//$("p").css("text-shadow","1px 1px 1px #000");
	//$("li").css("text-shadow","1px 1px 1px #fff");								
	
	// Lightbox
	$(function() {
		$(".lightbox").lightbox();
	});
	
	// Hide/Show Specifications
	$("p.spec").addClass("switchOff").click(function() {
													 
		if($(this).is(".switchOff")) {
			$(this).next().slideDown("slow", function() { 
				$(this).prev().removeClass("switchOff").addClass("switchOn");
			});
			
		} 
		if ($(this).is(".switchOn")) {
			$(this).next().slideUp("slow", function() { 
				$(this).prev().removeClass("switchOn").addClass("switchOff");
			});
		}
		
		return false;
		
	}).next().hide();
	

});

	// SlideShow
		function slideSwitch() {
			var $active = $('#slideshow img.active');
		
			if ( $active.length == 0 ) $active = $('#slideshow img:last');
		
			var $next =  $active.next().length ? $active.next()
				: $('#slideshow img:first');
		
			$active.addClass('last-active');
		
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1000, function() {
					$active.removeClass('active last-active');
				});
		}
		
		$(function() {
			setInterval( "slideSwitch()", 4000 );
		});
