jQuery(function($){	

	//Highlight Current Page
	/*if(currentPage!=null)
	$("#navigation > li").eq(currentPage-1).addClass("active");*/
	$("#navigation > li:not(.current-menu-item)").hover(function(){
		$(this).toggleClass("current-menu-item");
	});
	
	
	//navigation Dom
	$("#navigation > li > a").wrapInner("<span class='w2'><span class='w3'></span></span>").append('<img src="/wordpress/wp-content/themes/fcl/images/navigation-dimage.png" class="dimage" height="15" width="80" />').wrapInner("<span class='w1'></span>");
	
	//Dropdown DOM
	$("#navigation ul").wrap('<div class="submenu"></div>');
	$("#navigation .submenu").prepend('<div class="top"></div>').append('<div class="bottom"></div>');
	
	//Dropdown 
	$("#navigation > li").hover(function(){
		var $dropdown = $(this).find(">.submenu");
		$dropdown.height("auto")
		$dropdown.clearQueue().slideDown(300).parent().addClass("hovered");
	},function(){
		var $dropdown = $(this).find(">.submenu");
		$dropdown.delay(300).slideUp(0,function(){
			$dropdown.parent().removeClass("hovered");
		});
	});
	
	//list-7 DOM
	$(".list-7 .image").append('<img src="/wordpress/wp-content/themes/fcl/images/image-hover.png" alt="" class="hoverimage" />');
	
	$(".list-7 li").hover(function(){
		$(this).find(".hoverimage").clearQueue().animate({top:0});
	}, function(){
		$(this).find(".hoverimage").animate({top:300});
	});
	$(".list-7 li:nth-child(3n+1)").css("clear", "both");
	
		
	//banner slideshow
	$(".slideshow").cycle({
		timeout: 6000
	});
	
	//Tabs
	$(".tabbox-1").Boxtab({
		animType: "fade"
	});
	
	//slider
	$("#slider-1").powerSlider({
		nextSelector : ".next",
		prevSelector : ".previous",
		autoSlide: true, 
		slideInterval : 10000
	});
	
	//#slider-2
	$("#slider-2").cycle({
		timeout: 6000
	});
	
	//list-6 dynamic frame
	var frameClass = new Array("f1", "f2", "f3", "f4");
	$(".list-6 .image").each(function(){
		$(this).addClass(frameClass[Math.floor(Math.random()*4)]);
	});
	
	//colorbox
	//$("a[rel='gallery']").colorbox();
	
	$('.list-7 li').each(function(){
		$("a[rel='"+$(this).find('a:first').attr('rel')+"']").colorbox();
	
	})
		
});
