// Initiate the dropdown menu

	$(document).ready(function() { 
        $('ul.sf-menu').superfish({ 
            delay: 200,												// delay on mouseout
            animation: {opacity:'show',height:'show'},
            autoArrows: false,										// disable generation of arrow mark-up 
            dropShadows: false,									// disable drop shadows 
            speed: "fast"
        });
    });
    
// Move dropdown links on hover
	
	$(document).ready(function(){

		$(".sf-menu ul a").css({
			paddingLeft: "15px",
			backgroundPosition: "0px 12px"
			});
		$(".sf-menu ul a").hover(function() {
		$(this).stop().animate({
			paddingLeft: "25px",
			backgroundPosition: "10px 12px"
			}, 'fast');
		}, function() {
		$(this).stop().animate({
			paddingLeft: "15px",
			backgroundPosition: "0px 12px"
			}, 'fast');
		});
	});

// Set background of dropdown to 90% opacity - fix for IE naturally.

	$(document).ready(function(){
		$(".sf-menu li ul").css({
			opacity: 0.9
			});
	});

// Start the slider

/*	$(document).ready(function() {
    	$('.slides').cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			next:   '.next', 
    		prev:   '.previous',
    		timeout: 7000, 
    		pager:  '.pager',
    		cleartype: true,
    		cleartypeNoBg: true
		});
	});*/
	
// Move footer posts on hover
	
	$(document).ready(function(){

		$(".foot-posts a").css({
			paddingLeft: "20px",
			backgroundPosition: "5px 9px"
			});
		$(".foot-posts a").hover(function() {
		$(this).stop().animate({
			paddingLeft: "30px",
			backgroundPosition: "15px 9px"
			}, 'fast');
		}, function() {
		$(this).stop().animate({
			paddingLeft: "20px",
			backgroundPosition: "5px 9px"
			}, 'fast');
		});
	});
	
// Start the Slide deck

/*	$(document).ready(function(){
	
		$('dl').slidedeck({
			scroll: false,
			index: false
		});
	});
*/
// Give image links in Slidedeck hover effect

	$(document).ready(function(){

		$(".slidedeck .panel .right img").css({
			opacity: 0.6
			});
		$(".slidedeck .panel .right img").hover(function() {
		$(this).stop().animate({
			opacity: 1.0
			}, 'fast');
		}, function() {
		$(this).stop().animate({
			opacity: 0.6
			}, 'fast');
		});
	});

	$(document).ready(function(){	
 	
 		$('.cover').hover(function(){  
       	 $(".thumb", this).stop().animate({top:'-45px'},{queue:false,duration:160});  
    			}, function() {  
        $(".thumb", this).stop().animate({top:'0px'},{queue:false,duration:160});  
   		 });
	});
	
//animate the sscroll to top
	
$(document).ready(function() {
  function filterPath(string) {
  return string
 .replace(/^\//,'')
 .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
 .replace(/\/$/,'');
  }
  var locationPath = filterPath(location.pathname);
  var scrollElem = scrollableElement('html', 'body');
  $('.entry-meta a[href*=#], .top a[href*=#]').each(function() {
 var thisPath = filterPath(this.pathname) || locationPath;
 if (  locationPath == thisPath
 && (location.hostname == this.hostname || !this.hostname)
 && this.hash.replace(/#/,'') ) {
   var $target = $(this.hash), target = this.hash;
   if (target) {
  var targetOffset = $target.offset().top;
  $(this).click(function(event) {
    event.preventDefault();
    $(scrollElem).animate({scrollTop: targetOffset}, 400, function() {
   location.hash = target;
    });
  });
   }
 }
  });
  // use the first element that is "scrollable"
  function scrollableElement(els) {
 for (var i = 0, argLength = arguments.length; i <argLength; i++) {
   var el = arguments[i],
    $scrollElement = $(el);
   if ($scrollElement.scrollTop()> 0) {
  return el;
   } else {
  $scrollElement.scrollTop(1);
  var isScrollable = $scrollElement.scrollTop()> 0;
  $scrollElement.scrollTop(0);
  if (isScrollable) {
    return el;
  }
   }
 }
 return [];
  }
});