var sec;
$( function() {
	if((location.href).search("retouchethics") != -1 ) {
		$('#menu-item-1350').addClass('current-menu-item');
		$('#menu-item-954').addClass('current-menu-item');
		sec = "r_ethic";
		$('#menu-item-1354 a').first().css('color', '#46cbae');
		$('#menu-item-875 a').first().css('color', '#46cbae');
		$( '#header_bottom .current-menu-item a' ).css( 'color', '#fff' );
		$( '#header_bottom .current-menu-item a' ).css( 'background-color', '#BBB7AD' );
		$( '#header_bottom .current-menu-item a' ).css( 'color', '#fff' );
		$( '#header_bottom .current-menu-item a' ).css( 'background-color', '#BBB7AD' );
		showline($('#menu-item-1350'));
		showline($('#menu-item-954'));
	}
	
	if((location.href).substring((location.href).length-14, (location.href).length) == "retouches-cgi/" ) {
		$('#menu-item-808 a').first().css('color', '#46cbae');
	}
	
	if((location.href).substring((location.href).length-3, (location.href).length) == "en/" ) {
		sec = "home_en";
		$('#menu-item-1357 .sub-menu ').css('display','block');
	}
	if((location.href).substring((location.href).length-3, (location.href).length) == "ca/" ) {
		$('#menu-item-1739 .sub-menu ').css('display','block');
		$('#menu-item-1739').addClass("current-menu-item");
	}
	
	if($("#menu-item-953").hasClass("current-menu-item")) {
		$('#menu-item-1252 .sub-menu ').css('display','block');
	}
	if($("#menu-item-1356").hasClass("current-menu-item")) {
		$('#menu-item-1356 .sub-menu ').css('display','block');
	}
	
	$('.itemnl a').click(function(){
		$('.nl_tg').toggle();
		$('.client_login').hide();
	});
	
	
	showline($('#header_bottom ul > li.current_page_item a'));
	$( '#header_bottom ul > li a' ).hover( function() {
		
		showline($(this));
		if( !$( this ).parent().hasClass( 'current-menu-item' ) ) {
			$( '#header_bottom .current-menu-item a' ).css( 'background-color', '#fff' );
			$( '#header_bottom .current-menu-item a' ).css( 'color', '#848484' );
		}
	}, function() {
		if($(this).parents('li').attr('class').indexOf('current_page_item')==-1)
			$( '#header_bottom div.hover' ).css( 'background-image', '' );
			if(sec == "home_en") {
				showline($('#menu-item-1353'));
			} else if(sec == "r_ethic") {
				showline($('#menu-item-1350'));
				showline($('#menu-item-954'));
			} else {
				showline($('#header_bottom ul > li.current_page_item a'));
			}
			
		if( !$( this ).parent().hasClass( 'current-menu-item' ) ) {
			$( '#header_bottom .current-menu-item a' ).css( 'color', '#fff' );
			$( '#header_bottom .current-menu-item a' ).css( 'background-color', '#BBB7AD' );
		}
	} );
	
	if((location.href).search("retouches-cgi") != -1 ) {
		$('#menu-item-808 .sub-menu ').css('display','block');
	}
	if((location.href).search("retouching-cgi") != -1 ) $('#menu-item-1357 .sub-menu ').css('display','block');
	if((location.href).search("retouches-cgi") != -1 ) $('#menu-item-1739 .sub-menu ').css('display','block');
	if((location.href).search("methods") != -1 ) $('#menu-item-1355 .sub-menu ').css('display','block');
	
} );


