//nivo_slider
$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'fold', //Specify sets like: 'fold,fade,sliceDown'
		animSpeed:500,
		pauseTime:5000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
      controlNavThumbsFromRel:false, //Use image rel for thumbs
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.7, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});

//menu_left
$(document).ready(function () {

		//Set the height of the block
		$('#menu .block').height($('#menu li').height());

		//go to the default selected item
		topval = $('#menu .selected').position()['top'];
		$('#menu .block').stop().animate({top: topval}, {easing: '', duration:500});

		$('#menu li').hover(

			function() {

				//get the top position
				topval = $(this).position()['top'];

				//animate the block
				//you can add easing to it
				$('#menu .block').stop().animate({top: topval}, {easing: '', duration:500});

				//add the hover effect to menu item
				$(this).addClass('hover');
			},

			function() {
				//remove the hover effect
				$(this).removeClass('hover');
			}
		);

	});

//slider bottom
function formatText(index, panel) {
return slider[index - 1]; }
$(window).load(function() {
	$('#slider1, #slider2').anythingSlider({
  // Appearance
  width               : null,      // Override the default CSS width
  height              : null,      // Override the default CSS height
  resizeContents      : false,      // If true, solitary images/objects in the panel will expand to fit the viewport

  // Navigation
  startPanel          : 1,         // This sets the initial panel
  hashTags            : true,      // Should links change the hashtag in the URL?
  buildArrows         : true,      // If true, builds the forwards and backwards buttons
  buildNavigation     : false,      // If true, buildsa list of anchor links to link to each panel
  navigationFormatter : null,      // Details at the top of the file on this use (advanced use)
  forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
  backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)

  // Slideshow options
  autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
  startStopped        : false,     // If autoPlay is on, this can force it to start stopped
  pauseOnHover        : true,      // If true & the slideshow is active, the slideshow will pause on hover
  resumeOnVideoEnd    : true,      // If true & the slideshow is active & a youtube video is playing, it will pause the autoplay until the video has completed
  stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page
  playRtl             : false,     // If true, the slideshow will move right-to-left
  startText           : "Start",   // Start button text
  stopText            : "Stop",    // Stop button text
  delay               : 3000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
  animationTime       : 600,       // How long the slideshow transition takes (in milliseconds)
  easing              : "swing"    // Anything other than "linear" or "swing" requires the easing plugin
});
});


// fancybox

 $(document).ready(function() {
   /*
   *   Examples - images
   */

   $("a#example1").fancybox();

   $("a#example2").fancybox({
    'overlayShow' : false,
    'transitionIn' : 'elastic',
    'transitionOut' : 'elastic'
   });

   $("a#example3").fancybox({
    'transitionIn' : 'none',
    'transitionOut' : 'none'
   });

   $("a#example4").fancybox({
    'opacity'  : true,
    'overlayShow' : false,
    'transitionIn' : 'elastic',
    'transitionOut' : 'none'
   });

   $("a#example5").fancybox();

   $("a#example6").fancybox({
    'titlePosition'  : 'outside',
    'overlayColor'  : '#000',
    'overlayOpacity' : 0.9
   });

   $("a#example7").fancybox({
    'titlePosition' : 'inside'
   });

   $("a#example8").fancybox({
    'titlePosition' : 'over'
   });

   $("a[rel=example_group]").fancybox({
    'transitionIn'  : 'none',
    'transitionOut'  : 'none',
    'titlePosition'  : 'over',
    'titleFormat'  : function(title, currentArray, currentIndex, currentOpts) {
     return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
    }
   });

   /*
   *   Examples - various
   */

   $("#various1").fancybox({
    'titlePosition'  : 'inside',
    'transitionIn'  : 'none',
    'transitionOut'  : 'none'
   });

   $("#various2").fancybox();

   $("#various3").fancybox({
    'width'    : '6',
    'height'   : '4',
    'autoScale'   : false,
    'transitionIn'  : 'none',
    'transitionOut'  : 'none',
    'type'    : 'iframe'
   });

   $("#various4").fancybox({
    'padding'   : 0,
    'autoScale'   : false,
    'transitionIn'  : 'none',
    'transitionOut'  : 'none'
   });
  });
