 
$(document).ready(function(){
	$("a.group").fancybox({
	   'overlayShow': true,
	   'overlayOpacity': 0.7 
	});
});
 
 $(document).ready(function(){
							 
					
	/*--Cycle--*/
		
    $('.slideshow').cycle({
		fx: 'fade',
		random: 1,
		timeout:8000
	});
	
					
					
	 /*--MENU--*/
							 
	$('ul.sf-menu').superfish({ 
		delay:       200,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: false                            // disable drop shadows 
	}); 
	
	 /*--tabs--*/
							 
	$('#splashContent').tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 10000);

	$('#splashContent').bind('tabsselect', function(event, ui) {
	
			//Determine the currently selected class
			var tabSelected = null;			
			switch (ui.tab.hash) {
			case '#slide-1': case '#slide-2': case '#slide-3': 
				tabSelected = 'One';
				break;
			case '#slide-4': case '#slide-5': case '#slide-6': 
				tabSelected = 'Two';
				break;
			case '#slide-7': case '#slide-8': case '#slide-9': 
				tabSelected = 'Three';
				break;
			case '#slide-10': case '#slide-11': case '#slide-12': 
				tabSelected = 'Four';
				break;
			}
	
			if (tabSelected != null) {
				//Highlight the root li anchor
				$(ui.tab).parents('li').not('.tabSelect').children('a:first').addClass('' + tabSelected);
				
				//Remove the highlight from any others
				var tabs = ['One','Two','Three','Four'];
				for(var i in tabs) {
					if (tabs[i] == tabSelected) {
						$(".splashBtn" + tabs[i]).addClass("ui-state-active" + tabs[i]);
					} else {
						$(".splashBtn" + tabs[i]).removeClass("ui-state-active" + tabs[i]);
					}
				}
			}
	
		});
		
	
	/*--Carousel--*/
	
	jQuery('#carousel').jcarousel({
		start: 4,						  
        auto: 10,
		size: 12,
        wrap: 'last'
    });
		
	/*--Fade--*/
		
	$(".quoteOpen").hover( 
		function () {
		  $("> .quoteUp", this).fadeIn('slow');
		},
		function () {
		  $("> .quoteUp", this).fadeOut('fast');
		}
	); 
		 
	 /*--Scroll--*/
	 
	 

	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
		
		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;
		
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
	
  });
  
	
	
