jQuery(function($){	

	//Highlight current page
	try{
		if(currentPage!=null)
		$("#navigation > li").eq(currentPage-1).addClass("active");
	}
	catch(e){
	}
	
	//Dropdown 
	$("#navigation li").hover(function(){
		var $dropdown = $(this).find(">ul");
		$dropdown.height("auto")
		$dropdown.clearQueue().slideDown(600).parent().find(">a").addClass("hovered");
	},function(){
		var $dropdown = $(this).find(">ul");
		$dropdown.delay(500).slideUp(0, function(){$dropdown.parent().find(">a").removeClass("hovered")});
	});
	
	//slider
	$("#slider").cycle({
		timeout : 8000	
	});
	
	//.imagelist-1 a
	$(".imagelist-1 a, .imagelist-2 a").hover(function(){
		$(this).find(".title, .hover").animate({"top":"0%"});
	},function(){
		$(this).find(".title, .hover").animate({"top":"100%"});
	});
	
	//single-img
	$(".single-img a").prettyPhoto({
			//theme: "sparkling",
			show_title: false,
			horizontal_padding:0,
			//overlay_gallery:false,
			//allow_resize: false,
			social_tools: ""
		
	}).append('<span class="zoom"></span>');
	
	//Tabs
	$(".tabbox-1").Boxtab();
	
	//radio-1
	$(".radio-1").jqTransform();
	
	//.box-4 accordian
	$(".box-4.opened .content").slideDown(500);;
	$(".box-4 .control").click(function(){		
		var parent = $(this).parents(".box-4");		
		if(parent.is(".opened")){			
			parent.find(".content").slideUp(500);	
			parent.removeClass("opened");
		}else{
			parent.find(".content").slideDown(500);		
			parent.addClass("opened");		
		}				
		return false;
	});
	
	//form submit
	$("a.submit").click(function(){
		$(this).parents("form")[0].submit();
		return false;
	});

	
});

