/********************
 *
 *	PUBLIC.JS
 *	Javascript for public webpages
 * 
********************/

// Opens preview image
function openImgPreview(ImgURL, ImageW, ImageH) {
	WinDoc = window.open('', 'ImgPreviewWin', 'width=' + (ImageW + 50) + ',height=' + (ImageH + 75) + ',scrollbars,status');
	
	with (WinDoc.document) {
		open();
		write('<html><head><title>Enlarged Image</title></head>');
		write('<body onLoad="window.focus()" onClick="window.close()">');
		write('<center><img src="' + ImgURL + '" style="margin-bottom: 25px; display: block">');
		write('<font face="Arial" size=1>(click anywhere to close window)</font></center>');
		write('</body></html>');
		close();
	}
}

// Generates email address safe from harvesters
function generateAntiSpiderEmail(Username, DomainName, TLD, OutputText, NoLink) {
	EmailAddress = Username + "&#64;" + DomainName + "&#46;" + TLD;
	OutputText   = ((OutputText)?OutputText:EmailAddress);
	
	document.write((NoLink)?OutputText:"<a href=\"ma" + "il" + "to:" + EmailAddress + "\">" + OutputText + "</a>");
}

// Toggles the css 'display' property between 'none' and 'block'
function toggleCSSdisplay(Obj) {
	CurrentDisplay = Obj.style.display;
	Obj.style.display = (CurrentDisplay == 'none' || CurrentDisplay == '')?'block':'none';		
}