/* MENU SINGLE POST */
function initMenus() {
	$('#blk_inRight .widget ul.menuli li ul').hide();
	$('#blk_inRight .widget ul.menuli li ul.expand').slideDown('nomal');

	$('#blk_inRight .widget ul.menuli li h2').hover(
		function() {
			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;
			
			
		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('slow');
		
				checkElement.slideDown('normal');
					return false;
					}
				});
			}

	
/* MENU ITEM FLOAT */
function floatYloc() {
	var name = "#floatMenu";
		var menuYloc = null;
					menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
			$(window).scroll(function () { 
				offset = menuYloc+$(document).scrollTop()+"px";
				$(name).animate({top:offset},{duration:750,queue:false});
			});
}


/* MENU PAGES AND SUBPAGES */
function menColl() {
	
	  $(".menuPage ul#mainBlk li.page_item ul").hide();
	  $(".menuPage ul#mainBlk li.page_item ul li.page_item ul").hide();
	  $(".menuPage ul#mainBlk li.current_page_ancestor ul").show();
	  
	  
		$(".menuPage ul#mainBlk li.page_item a").click(
		function() {
			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;
			

			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('slow');
				$(".menuPage ul#mainBlk li.page_item ul li.page_item ul").show();
				checkElement.slideDown('normal');
					return false;
					}
				});

}

/* DOCUMENT READY */
		$(document).ready(function(){
		menColl();
		initMenus();
		floatYloc();	
	
		$(".gallery a").fancybox();
		$(".gallery a img").css({"border":"0px"});
		$(".gallery a:hover img").css({"cursor":"pointer"});
		$(".gallery a").attr({rel:"prettyPhoto[gallery]"});

	
		});
		
		