jQuery(document).ready(function() {
		jQuery('.scroll-pane').jScrollPane();		
});
/* Functins CallBack  -----------------------------------------------------------*/

jQuery(window).load(function() {	

		jQuery(".nav, ul.sf-menu").superfish({ 
            animation: {height:'show'},   // slide-down effect without fade-in 
            delay:     800               // 1.2 second delay on mouseout 
        }); 
		sys_toggle();
		jQuery('.scroll-pane').jScrollPane();
		jQuery('.lightbox').lightbox();
		jQuery('ul.social li a').tipsy({gravity: 's'});
});


/* Image Hover Classes  -----------------------------------------------------------*/

function hoverimage() {
		$("a[class^='lightbox']").each(function() {	
			var $image = $(this).contents("img");
				$hoverclass = 'hover_video';
	
		if($(this).attr('href').match(/(jpg|gif|jpeg|png|tif)/)) 
		$hoverclass = 'hover_image';
			
		if ($image.length > 0)
		{	
			var $hoverbg = $("<span class='"+$hoverclass+"'></span>").appendTo($(this));
			
				$(this).bind('mouseenter', function(){
				$height = $image.height();
				$width = $image.width();
				$pos =  $image.position();		
				$hoverbg.css({height:$height, width:$width, top:$pos.top, left:$pos.left});
			});
		}
	
	});	

	$("a[class^='lightbox']").contents("img").hover(function() {
			$(this).stop().animate({"opacity": "0.3"}, 200);
			},function() {
			$(this).stop().animate({"opacity": "1"},200);
	});
}

jQuery(document).ready(function() {

	hoverimage();
		jQuery("ul.tabs").tabs(".panes > .tab_content", {tabs:'li',effect: 'fade', fadeOutSpeed: -400});
		jQuery(".minithumb, .gallery, .gallery-item, postimg, .img_border, .image, .lightbox,").preloadify({force_icon:"true", mode:"sequence" });
});

/* jQuery Toggle   -----------------------------------------------------------*/

function sys_toggle() {
	jQuery(".toggle_content").append("<div class='arrow'></div>").hide();

	jQuery("span.toggle").toggle(function(){
		jQuery(this).addClass("active");
		}, function () {
		jQuery(this).removeClass("active");
	});

	jQuery("span.toggle").click(function(){
		jQuery(this).next(".toggle_content").slideToggle();
	});
}
