
/* <![CDATA[ */
jQuery(document).ready(function($){

jQuery.fn.fadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle'}, speed, easing, callback);  
};

jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);  
};





/*FANCYBOX*/
/*$("a[rel=fancybox]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'fade',
		'titlePosition' 	: 'over'
	});
$("a[rel=adviser]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'fade',
		'scrolling'			: 'no',
		'modal'				: true,
		'centerOnScroll'	: true,
		'titleShow'			: false,
		'titlePosition' 	: 'over',
		'onClosed'			: function() {
							    $("#login_error").hide();
								}
	});*/


/*SUPERFISH MENU*/
 $("ul.sf-menu").superfish({ 
            delay:       1000,                            // 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: true                            // disable drop shadows 
        });  


/*SLIDER*/
$('#slider').nivoSlider({
        effect:'fade', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:500, // Slide transition speed
        pauseTime:6000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        controlNavThumbs:false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav:true, // Use left & right arrows
        pauseOnHover:true, // Stop animation while hovering
        manualAdvance:false, // Force manual transitions
        captionOpacity:0.8, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next' // Next directionNav text
    });

$('#slider2').before('<div id="nav" class="nav">').cycle({
        fx:      'scrollHorz',
        timeout:  3500,
        prev:    '#prev',
        next:    '#next',
        pager:   '#nav'
    });
			
/* GENERAL TABS*/
$(".tabContent").hide(); 
$("ul.tabs li:first a").addClass("selected").show();
$(".tabContent:first").show(); 
$("ul.tabs li").click(function() {
	$("ul.tabs li a").removeClass("selected");
	$("a",this).addClass("selected");
	
	$(".tabContent").hide(); 
	var activeTab = $(this).find("a").attr("href"); 
	$(activeTab).parent().find('ul li a[href='+activeTab+']').addClass("selected");
	$(activeTab).show();
	
	return false;
});



/*ACCORDION*/
$('.accordion-container').hide(); //Hide/close all containers
$('.accordion-handler:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
 
//On Click
$('.accordion-handler').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.accordion-handler').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	return false; //Prevent the browser jump to the link anchor
});
				
/*EXTERNAL LINKS */
$('a[rel*=external]').click( function() {
        window.open(this.href);
        return false;
    });
$('.entry a[rel*=external]').addClass("link-external");

/* TOOLTIPS */    
$("acronym").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true, 
    gravity: 's'
    });    
$(".tipTop").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true,   
	offset: 0, 
    gravity: 's'
    });  
$(".tipRight").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true,   
    gravity: 'w'
    });
$(".tipBottom").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true,   
    gravity: 'n'
    });
$(".tipLeft").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true, 
    gravity: 'e'
    });    
$(".tipSe").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true, 
    gravity: 'se'
    });  
$(".tipSw").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true, 
    gravity: 'sw'
    }); 	  
$(".tipNe").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true, 
	offset: -10, 
    gravity: 'ne'
    });
$(".tipNw").tipsy({
    delayIn: 200, 
    delayOut: 100,
    fade: true, 
	offset: -10, 
    gravity: 'nw'
    });

	
$(".preview a").hover(
   function() {
      $(this).find('.overlay').stop().animate({
		  opacity: 1
		  }, 600, 'easeOutBounce');
		  
	$(this).find('.zoom').stop().animate({
		  top: '100px',
		  opacity: 1
		  }, 600, 'easeOutBounce');
		  
	$(this).find('.imgPreview').stop().animate({
		  top: '100px',
		  opacity: 1
		  }, 600, 'easeOutBounce');
		  
   },
   function() {
	   
	$(this).find('.overlay').stop().animate({
		  opacity: 0
		  }, 300);
		  
	$(this).find('.zoom').stop().animate({
		  top: '200px',
		  opacity: 0
		  }, 300);
		  
   }
);

$("#gallery-tabs a").hover(
   function() {
      $(this).find('.overlay').stop().animate({
		  opacity: 1
		  }, 700, 'easeOutElastic');
		  
	$(this).find('.zoom').stop().animate({
		  top: '30px',
		  opacity: 1
		  }, 700, 'easeOutElastic');
		  
		  
   },
   function() {
	   
	$(this).find('.overlay').stop().animate({
		  opacity: 0
		  }, 300);
		  
	$(this).find('.zoom').stop().animate({
		  top: '100px',
		  opacity: 0
		  }, 300);
		  
   }
);
	



    });
/* ]]> */

