// JavaScript Document

$(document).ready(function(){	
	
	/* Menus */
	$(".tax-relief, .sub-menu").hover(function(){
		$(".sub-menu").show();						
	},function(){
		$(".sub-menu").hide();						
	});
	var sibling = $(".submenus ul").children("li");	
	sibling.each(function(){
		if ($(this).hasClass('current_page_item')){
			$(".sub-menu").show();	
			$("li.tax-relief").addClass("current-menu-item");
		}
	});
	
	$(".view-det a").click(function(){
		if(!$(this).parent().siblings("li.calc-det").is(":visible")){
			$(".calc-det").slideDown();		
		}
		else{
			$(".calc-det").slideUp();		
		}
	});
	
	/* Slide Up and Down - Other tax relief */
	$(".other-taxes .btn-down").click(function(){
		$(this).hide();
		$(this).siblings(".btn-up").show();
		$(this).parent(".other-taxes").siblings(".other-taxes-info").slideDown();
	});
	$(".other-taxes .btn-up").click(function(){
		$(this).hide();
		$(this).siblings(".btn-down").show();
		$(this).parent(".other-taxes").siblings(".other-taxes-info").slideUp();
	});
	$(".other-taxes-info .close-btn").click(function(){
		$(this).parent().siblings(".other-taxes").children(".btn-up").hide();
		$(this).parent().siblings(".other-taxes").children(".btn-down").show();
		$(this).parent().slideUp();
	});
	
	/* Expanded Feature */
	$(".expandedFeat").slideUp(5);		
	$(".expand").click(function(){
		$(this).hide();
		$(".expandClose").show();		
		$(".expandedFeat").slideDown();		
	});
	$(".expandClose").click(function(){
		$(this).hide();
		$(".expand").show();	
		$(".expandedFeat").slideUp();	
	});
	$(".expandClosed").click(function(){
		$(".expandedFeat").slideUp();	
		$(".expand").show();	
		$(".expandClose").hide();	
	});
	
	$('.sel').selectbox();
});

