$(document).ready(function(){
	
	       // infinitecarousel
           // ------------------------------------------------------------
			jQuery('.slider').fadeIn(300);
			if ($("#s4").length) {
			$.fn.cycle.defaults.timeout = 6000;
					$(function() {
					// run the code in the markup!
					$('#s4').before('<div id="nav" class="nav">').cycle({
						fx:     'fade',
						speed:  'slow',
						//autostopCount:   4,
						//autostop:   4,
						timeout: 6000,
						pager:  '#nav'
					});
					});
				};
				
				// Fancybox
                // ------------------------------------------------------------
                if($.isFunction($.fn.fancybox)) {
                 $("a[rel^='lightbox']").fancybox({
                   'hideOnContentClick' : true,
  		           //'titlePosition' : 'over',
  		           'transitionIn'	: 'elastic',
  		           'transitionOut'	: 'elastic',
  		           'overlayColor'  : 'black',
  		           'overlayOpacity': 0.7,
  		           'speedIn' :	600, 
  		           'speedOut':	300, 
  		           'padding' :	0
                });
               }
			   
			   $("a[rel^='ext_html']").fancybox({
		           'autoScale'     	: false,
				   //'width'				: '75%',
		           'height'			: '100%',
				   'overlayColor'  : 'black',
				   'overlayOpacity': 0.7,
                   'transitionIn'		: 'none',
		           'transitionOut'		: 'none',
		           'type'				: 'iframe'
	           });
			   
			   
			     // Superfish
                 // ------------------------------------------------------------
  
  if($.isFunction($.fn.superfish)) {
    $('#header ul.nav').superfish({ 
      delay:       500,                             // delay on mouseout in milliseconds
      animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
      speed:       'fast',                          // faster animation speed 
      autoArrows:  true,                            // disable generation of arrow mark-up 
      dropShadows: false                            // disable drop shadows 
    });
  }
			 
});
