$(document).ready(function(){

	//Drop down
	$("#mn-nv").superfish({autoArrows: false});
	
	//General stuff	
	$('#hd-nv li:first').addClass('first');
	$('#hd-nv li:last').addClass('last');
	
	$('#mn-nv li ul').each(function(){
		$('li:last', this).addClass('last');
	});
	
	$('.notification > .close').click(function() {
		$(this).parent().slideUp(500);
		return false;
	});
	
	$('.notification').each(function(){
		if($(this).attr('id') != 'dont'){
			$(this).delay(5000).slideUp(500);
		}
	})
	
	$("#ft-mn-nv li:first").addClass('first');
	$("#ft-mn-nv li:last").addClass('last');
	$("#ft-nv-lt ul li:first").addClass('first');
	$("#ft-nv-lt ul li:last").addClass('last');
	$(".ne-list li:odd").addClass('alt');
	$(".side-ne-list li:last").addClass('last');
	$(".side-specials li:last").addClass('last');
	$("ul.resources > li > h3").click(function() {$(this).find("+ div").slideToggle("fast");return false;});
	$("ul.resources li div ol li:odd").addClass('alt');
	$("ul.retreats li:nth-child(3n)").addClass('third');
	//$("ul.shop-cat-list li:nth-child(3n)").addClass('third');
	
	// Search box
	$("#sch-keyword").inputLabel(false,{color:"#AC5905"});
    $('#sch input[type="text"]').parent().parent().parent().addClass("idleField");
	$('#sch input[type="text"]').focus(function() {
		$(this).parent().parent().parent().removeClass("idleField").addClass("focusField");   
    });
    $('#sch input[type="text"]').blur(function() {
    	$(this).parent().parent().parent().removeClass("focusField").addClass("idleField");  
    });
    
    // Where anchor used for submit button
    $("a[title=submit]").click( function(){
		$(this).parents("form").submit();
    });
	
	// Cart pop up
    $('#hd-cart-btn').toggle(function() {
    	$('#cart-status-wp').fadeIn('slow');
    	return false;
 	}, function(){
		$('#cart-status-wp').fadeOut('slow');
    	return false;
	});
 	 
 	 $('#cart-close').click(function() {
    	$('#cart-status-wp').fadeOut('slow');
    	return false;
 	 });
	
	$('a[rel=external]').click(function(){
		window.open($(this).attr('href'));
		return false; 
	});
	
	if(window.location.pathname == '/international-links/'){
		$('#ct-lt a').attr('target', '_blank');
	}
	
});

