function DESemail(emailname,emailserver) {
	document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
	document.write(emailname + "@" + emailserver); 
	document.write("</a>"); 
}

// Accessible Pop Ups
function DESopen(url,width,height,toolbar,scroll) {
	window.open(url, "", "scrollbars="+scroll+",toolbar="+toolbar+",height="+ height +",width="+width);
	return false;
}

$(document).ready(function(){
	
	// --------------------------------
	// Thumbnail Image Gallery
	// --------------------------------
	$("#pimages a").click(function() {
		var newSrc = $(this).get(0).href;
		var newTitle = $(this).find("img").attr("alt");
		var myString = '<img src="' + newSrc + '" /><p id="pcaption">'+newTitle+'</p>';
		$("#masterPic").html(myString);
		$("#pimages a").removeClass("current");
		$(this).addClass("current");
		return false;
	});
	
	if (document.getElementById("slideshow")) {
		$('#slideshow').cycle( { random: 1, height: "220px", fade:1, speed: 2000, timeout: 1000 } ); 
	}
	
	if (document.getElementById("checkIn") && document.getElementById("checkOut")) {
		$('#checkIn').calendar({
			autoPopUp: 'both',
			buttonImage: '/img/design/calendar.gif',
			buttonImageOnly: true,
			minDate: new Date(),
			appendText: '<em class="df">yyyy-mm-dd</em>'
		})
		$('#checkOut').calendar({
			autoPopUp: 'both',
			buttonImage: '/img/design/calendar.gif',
			buttonImageOnly: true,
			minDate: new Date(),
			appendText: '<em class="df">yyyy-mm-dd</em>'
		})
	}
	
}); // End jQuery