$(document).ready(function() {

	// Slideshow
	
    $('#slideshow').cycle({
		fx: 'fade',
	    speed:  1500, 
	    timeout: 1000
	});
	
	
	// Video Slideshow
	
  	$('#video-slideshow').cycle({
        fx:     'fade',
        speed:  '1000',
        timeout: 0,
        pager:  '#video-nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#video-nav li:eq(' + (idx) + ') a';
        }
    });
    
    // Slideshow
	
     $('#slideshow').cycle({
        fx:      'scrollVert',
        timeout:  4000,
        prev:    '#prev',
        next:    '#next',
        pager:   '#nav-slideshow',
        pagerAnchorBuilder: pagerFactory
    });

    function pagerFactory(idx, slide) {
        var s = idx > 4 ? ' style="display:none"' : '';
        return '<li'+s+'><a href="#" class="nav-circles"></a></li>';
    };
    
   
 	// Accordion
 	
 	$("#accordion").accordion();
	
	// Alert
	
	$("#notification").slideDown(400).delay(1500).slideUp(400);
	
	
	Shadowbox.init({
	   handleOversize: "drag",
		modal: false,
		autoplayMovies: true
	});
	
		// Clear Form
	
	
  		$('.clear').each(function(){
   		 var defaultVal = $(this).attr('value');
    	$(this).focus(function(){
     	 if ($(this).val() == defaultVal){
        $(this).removeClass('active').val('');
     	 }
   		 })
   	 .blur(function(){
   	   if ($(this).val() == ''){
        $(this).addClass('active').val(defaultVal);
      }
		 });
	   });  

	
	
	// fullscreen image 
	
	var FullscreenrOptions = {  width: 2168, height: 738, bgID: '#bgimg' };
			// This will activate the full screen background!
		jQuery.fn.fullscreenr(FullscreenrOptions);
	
	
});
	


