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(){
	// --------------------------------
	// JQuery - Add and remove as needed
	// --------------------------------

	//  Photo Gallery
	$("ul.thumbs a").click(function() {
		$("#image img").fadeOut('fast').remove();
		$("#preloading").css("display","block");
		var randomnumber=Math.floor(Math.random()*150)
		var newSrc = $(this).get(0).href;
		/*
			Add a random number to image to make browser load again
			Ensures .onload works in IE/Opera
			Rubbish hack, would like to improve
		*/
		var newSrc = ''+newSrc+'?ran='+randomnumber+'';

		var nextImg = new Image();
		nextImg.src = newSrc;
		
		var nextImgHTML = '<img src="'+newSrc+'" with="400" />';
		nextImg.onload = function()
		{
			$("#preloading").css("display","none");
			// Safari didn't like append, don't know why I used it anyways!!
			//$("#image").append(nextImg);
			$("#image").html(nextImgHTML);
			$("#image img").fadeIn('medium');
		}
			
		//if (nextImg.complete) {
		//	nextImg.onload();
		//}
		$("ul.thumbs a").removeClass("current");
		$(this).addClass("current");
		
		return false;
	});

}); // End jQuery
