jQuery(document).ready(function($) {
jQuery('#da-thumbs > li').hoverdir();
jQuery('.ThumbCover').hover(function(){
		jQuery(".cover", this).stop().animate({top:'0'},{queue:false,duration:580});
	}, function() {
		jQuery(".cover", this).stop().animate({top:'100%'},{queue:false,duration:580});
	});	
			// Create the dropdown bases
			jQuery("<select />").appendTo(".navigation nav");
			
			// Create default option "Go to..."
			jQuery("<option />", {
			   "selected": "selected",
			   "value"   : "",
			   "text"    : "Select Menu"
			}).appendTo("nav select");
			
			
			// Populate dropdowns with the first menu items
			jQuery(".navigation nav li a").each(function() {
				var el = $(this);
				jQuery("<option />", {
					"value"   : el.attr("href"),
					"text"    : el.text()
				}).appendTo("nav select");
			});
			
			//make responsive dropdown menu actually work			
			jQuery("nav select").change(function() {
				window.location = $(this).find("option:selected").val();
			});
			
			
			// Create the dropdown bases
			jQuery("<select />").appendTo(".topBar nav");
			
			// Create default option "Go to..."
			jQuery("<option />", {
			   "selected": "selected",
			   "value"   : "",
			   "text"    : "Go to ..."
			}).appendTo(".topBar nav select");
			
			
			// Populate dropdowns with the first menu items
			jQuery(".topBar nav li a").each(function() {
				var el = $(this);
				$("<option />", {
					"value"   : el.attr("href"),
					"text"    : el.text()
				}).appendTo(".topBar nav select");
			});
			
			//make responsive dropdown menu actually work			
			jQuery("nav select").change(function() {
				window.location = $(this).find("option:selected").val();
			});
//dropdown
	jQuery("#mainNavigation ul#dropmenu a, .topBar ul#topNavigation a").removeAttr('title');
	jQuery("#mainNavigation ul#dropmenu ul, .topBar ul#topNavigation ul").css({display: "none"}); // Opera Fix
	jQuery("#mainNavigation ul#dropmenu li, .topBar ul#topNavigation li").each(function()
		{	
	var jQuerysubmeun = jQuery(this).find('ul:first');
	jQuery(this).hover(function()
		{	
	jQuerysubmeun.stop().css({overflow:"hidden", height:"auto", display:"none", paddingTop:0}).slideToggle(350, function()
		{
	jQuery(this).css({overflow:"visible", height:"auto"});
		});	
		},
	function()
		{	
	jQuerysubmeun.stop().slideUp(300, function()
		{	
	jQuery(this).css({overflow:"hidden", display:"none"});
			});
		});	
	});
	
	
//tip
  jQuery('.tip_s').tipsy({gravity: 's'});
  jQuery('.tip_n').tipsy({gravity: 'n'});
  jQuery('.tip_e').tipsy({gravity: 'e'});
  jQuery('.tip_w').tipsy({gravity: 'w'});

// custom Tabs 
	jQuery(".custom_tabs").tabs(".custom_tabs_content", {
		tabs: "li",
		effect:'fade'
	});

//Accordion
	jQuery(".accordion").tabs(".accordion .acc_content", {tabs: 'h2.acc_title', effect: 'slide', initialIndex: null});
	jQuery('.accordion .acc_title:first-child').addClass('current');
	jQuery('.accordion .acc_title.current').next('div.acc_content').css('display', 'block');

//toggle
jQuery("h4.toggle").click(function () {
	jQuery(this).next(".toggle_content").slideToggle();
	jQuery(this).toggleClass("active_toggle");
	jQuery(this).parent().toggleClass("toggle_var");
});

jQuery("h4.toggle_min").click(function () {
	$(this).next(".toggle_content_min").slideToggle();
	$(this).toggleClass("active_toggle_min");
});

//Images
jQuery('a.lightbox_img img ').hover( function () {
			jQuery(this).stop().animate({ opacity: 0.8}, 300);

		}, function () {
			jQuery(this).stop().animate({ opacity: 1 }, 300);
		});


jQuery('.gallery .gallery-item img').hover( function () {
			jQuery(this).stop().animate({ opacity: 0.6}, 300);

		}, function () {
			jQuery(this).stop().animate({ opacity: 1 }, 300);
		});

	jQuery("a.lightbox_img").prettyPhoto({deeplinking: false});
	jQuery(".wp-caption a").prettyPhoto({deeplinking: false});


// Images Tip
  $('.widgetPostImage a img , .tabImage a img , .liopostThumb a img , .category3-image a img , .LioCatPostsThumb a img, .tagcloud a , .tabNav li a , .social a , .slidePostContent img , .flickr_badge_image a img , #banner a , #footerBanner a , #singleTopBanner a, #singleBtmBanner a ').tipsy({gravity: 's', fade: true});
  $('#featuredThumbs li img , #firstfeaturedThumbs li img , .topRss .social a').tipsy({gravity: 'n', fade: true});
  
//scroll to top
$('.scrollTo_top').hide();
	$(window).scroll(function () {
		if( $(this).scrollTop() > 100 ) {
			$('.scrollTo_top').fadeIn(300);
		}
		else {
			$('.scrollTo_top').fadeOut(300);
		}
	});

	$('.scrollTo_top').click(function(){
		$('html, body').animate({scrollTop:0}, 500 );
		return false;
	});
	
	
	var ticker = function()
	{
		setTimeout(function(){
			jQuery('#newsTicker li:first').animate( {marginTop: '-40px'}, 800, function()
			{
				jQuery(this).detach().appendTo('ul#newsTicker').removeAttr('style');	
			});
			ticker();
		}, 4000);
	};
	ticker();
	
	
		
		//Default Action
	jQuery(".tabContent").hide(); //Hide all content
	jQuery("ul.tabNav li:first").addClass("active").show(); //Activate first tab
	jQuery(".tabContent:first").show(); //Show first tab content
	
	//On Click Event
	jQuery("ul.tabNav li").click(function() {
		jQuery("ul.tabNav li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tabContent").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn("slow"); //Fade in the active content
		return false;
	});
	
		//Default Action
	jQuery(".maintabContent").hide(); //Hide all content
	jQuery("ul.maintabNav li:first").addClass("active").show(); //Activate first tab
	jQuery(".maintabContent:first").show(); //Show first tab content
	
	//On Click Event
	jQuery("ul.maintabNav li").click(function() {
		jQuery("ul.maintabNav li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".maintabContent").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn("slow"); //Fade in the active content
		return false;
	});
	
//NOTIFICATION
$('.notification.ondemand').notify();
$('.button').click(function () {
$('.notification').removeClass('hide').addClass('hide').removeClass('visible');
$('.notification.' + $(this).attr('id') + '').notify({ type: $(this).attr('id') });
});

});
