function DESemail(emailname,emailserver) {
	document.write("<a href='mailto:" + emailname + "@" + emailserver +"'>");
	document.write(emailname + "@" + emailserver); 
	document.write("</a>"); 
}

function DESapply(emailname,emailserver,subject) {
	document.write("<a class=\"apply_link\" href='mailto:" + emailname + "@" + emailserver +"?subject=" + subject + "'>");
	document.write('Apply for this job');
	document.write("</a>"); 
}





$(document).ready(function(){
	
	// date pickers in forms
	if ($("#vac_starts")[0]) $("#vac_starts").datepicker({ mandatory: true, dateFormat: 'yy-mm-dd' });
	if ($("#tea_available")[0]) $("#tea_available").datepicker({ mandatory: true, dateFormat: 'yy-mm-dd' });
	if ($("#tea_dob")[0]) $("#tea_dob").datepicker({ mandatory: true, dateFormat: 'yy-mm-dd', yearRange: '1900:2008' });

	// sortable table headers for vacancy list
	if ($("#job_list")[0]) $("#job_list").tablesorter({ sortList: [[3,0]] });

	// lightbox, yo
	if ($('.gallery_thumbs')[0]) $('.gallery_thumbs a').lightBox();

	$("input.btn").click( function() { $(this).val("Please Wait"); });

}); // End jQuery
