$(document).ready(function() {

	$("a[rel='external']").attr("target","_blank");
	
	/*
	if($( "#arrive, #depart" ).length > 0){
		$( "#arrive, #depart" ).datepicker({
			showOn: "button",
			buttonImage: "images/calendar-icon.png",
			buttonImageOnly: true
		});
	}
	*/
	
	/*
	if($(".accordion").length > 0){
		$(".accordion").accordion({
			active: 9999,
			autoHeight: false,
			collapsible: true,
			animated: false,
			navigation: true
		});
	}
	*/
	
	if($("a.lightbox").length > 0){
		$("a.lightbox").colorbox();
	}
		
	
	
		
	// highlight any subnav items: id must equal path from webroot
	if(window.location.pathname.length > 1){
		var page = "#"+window.location.pathname.substring(1);
		if($(page).length > 0){
			$(page).addClass("active");
		}
	}
	
	$('#newsletter-subscribe').submit(function(){
		var postdata = $(this).serialize();
		$.ajax({
			type: "POST",
			url: "/signup.php",
			data: postdata,
			success: function(data){
				$("#subscribe-wrapper").html(data);
			}
		});
		return false;
	});
	
	$('input:text').each(function(){
		var txtval = $(this).val();
		$(this).focus(function(){
			$(this).val('')
			$(this).css("color","#444");
		});
		$(this).blur(function(){
			if($(this).val() == ""){
				$(this).val(txtval);
				$(this).css("color","#999");
			}
		});
	});

});
