// JavaScript Document
//JavaScript Document

jQuery(document).ready(function(){
	jQuery('ul.sf-menu').superfish();
})

/*var menuShown;
jQuery(document).ready(function(){
	jQuery("#navigation ul li a").hover(function() {
		jQuery(this).parent().find("ul").show();
		jQuery(this).parent().hover(function() {
	}, function(){
		menuShown=jQuery(this).parent().find("ul").hide();
	 //window.setTimeout("hideMenu()",500)
		});
	}); 
})*/

//to keep fade effect in highlight's teaser image
jQuery(document).ready( 
    function(){    
     jQuery('#header-image .item').innerfade({ speed: 5000, timeout: 10000, type: 'sequence', containerheight: '177px' }); 
     } 
   ); 

//enable lighbox effect
jQuery(document).ready(function() {
jQuery(".lightbox-2").lightbox({
			    fitToScreen: true,
				fileLoadingImage: '/system/layout/images/loading.gif',
				fileBottomNavCloseImage: '/system/layout/images/closelabel.gif',
				strings : { image: 'Image ' , of : ' Of ' , prevLinkText: '&laquo;  Previous' , nextLinkText : 'Next &raquo;',
							closeTitle : 'Close Gallery', prevLinkTitle : 'Previous Image', nextLinkTitle : 'Next Image'
							}
});
});

//header image fadein fade out 
jQuery(document).ready(
	function(){
	jQuery('#header-image .item').innerfade({
			speed: 1000,
			timeout: 4000,
			type: 'sequence',
			containerheight: '217px'
		});

	jQuery('#highlight #disappeared ').innerfade({
			speed: 1000,
			timeout: 5000,
			type: 'sequence',
			containerheight: '120px'
		});
	
		
		});

	
// home page tabbing 
jQuery(document).ready(function() {
 
	//Default Action
	jQuery(".tab_content").hide(); //Hide all content
	jQuery("ul.tabs li:first").addClass("active").show(); //Activate first tab
	jQuery(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	jQuery("ul.tabs li").click(function() {
		jQuery("ul.tabs li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tab_content").hide(); //Hide all tab content
		var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active content
		return false;
		
	});
	
	
	
});
