jQuery(function(){

 
	/*
	var zIndexNumber = 10000;
	 jQuery('div').each(function() {
	 	jQuery(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
    */
    
	
		$.fn.shuffle = function() {
			return this.each(function(){
				var items = $(this).children().clone(true);
				return (items.length) ? $(this).html($.shuffle(items)) : this;
			});
		}
		
		$.shuffle = function(arr) {
			for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);
			return arr;
		}
	
	//jQuery('#coin-slider').coinslider({ width: 645, height: 225, spw: 7, sph: 5, delay: 8000, sDelay: 30, navigation: false, links : false  });
	
 
 
	
	jQuery('ul.superfish').superfish({ 
            delay:       150,                            // one second delay on mouseout 
            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 
        }); 
	
	jQuery("ul.nav > li > a > span.sf-sub-indicator").parent().attr("href","#"); 
	
	jQuery("#search-icon").click(function(){
										   
		jQuery("#search-body").css('zIndex', 50000);
		jQuery("#search-body").css('display', 'block');
		jQuery(".search_bg").css('zIndex', 50001);
		jQuery("#searchform").css('zIndex', 50002);
		  
		jQuery("#search-body").slideToggle("fast");
		jQuery(this).toggleClass("active"); 
		return false;
	});
	
	jQuery('a[href*=#]:not([href=#])').click(function() {
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 	&& location.hostname == this.hostname) {
	  var $target = jQuery(this.hash);
	  $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
	  if ($target.length) {
		var targetOffset = $target.offset().top;
		jQuery('html,body').animate({scrollTop: targetOffset}, 1000);
	   return false;
	  }
	}
  });
	
   
		
 

});
