var stop=1;
$(document).ready(function() {
	
	// Toggle Navigation
	$("#ul_nav li:has(ul)").addClass("parent");
	$("#ul_nav li ul li ul li a").click(function(event){
		stopPropagation(event);
	});
	$("#ul_nav li.parent a").click(function(){
		if ($(this).next("ul").is(":hidden")) {
			$(this).next("ul").slideDown("fast");
			return false;
		} else {
			$(this).next("ul").slideUp("fast");
			return false;
		}		
	});	
	// Show Current Navigation
	$('.currentCat').parents('ul,li').addClass('show'); 
	$('.currentCat').children('ul').addClass('show'); 
		
	
	 // tabs1
	//When page loads...
		$(".tab_content").hide(); //Hide all content
		$("#toc li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content
	
		//On Click Event
		$("#toc li").click(function() {
	
			$("#toc li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".tab_content").hide(); //Hide all tab content
	
			var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
			$(activeTab).fadeIn('fast',function(){
				//j scroll
				 $('.scroll-pane').jScrollPane();	
			}); //Fade in the active ID content
			return false;
		});
		
	// fancybox
	$("a.view").fancybox({
		centerOnScroll: false
	});
});

function showDespre(){
	if($('#maimultd').text()=='[Citeste mai mult]'){

		var url = "ajax.php?a=showDespre";
		$.post(url, {tip:'open'},function(data) {
			$('#singlePage').html(data);
		});
	}
	else {
		var url = "ajax.php?a=showDespre";
		$.post(url, {tip:'close'},function(data) {
			$('#singlePage').html(data);
		});
	}
}

