// ----------------------------------------------------------------------
// DISPLAY LARGE PHOTO
// ----------------------------------------------------------------------

var popWin = null;

function viewPhoto(whichPhoto,x,y) {

  closePopWin(); 	// closes an existing popup window if user opens 
        			// new window before closing existing window
	
	var screenW = x + 50;
	var screenH = y + 50;
	var params  = "width=" + screenW + ",height=" + screenH + ",status=yes,toolbar=no,directories=no,scrollbars=no,resizable=yes,menubar=no,location=no,top=50,left=50,screeny=50,screenx=50"

	popWin = window.open("","VNTV",params);

  popWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
  popWin.document.write('<html xmlns="http://www.w3.org/1999/xhtml">');
  popWin.document.write('<head><title>Dunstan House</title></head>');
  popWin.document.write('<body style="background-color: #F8F8F8;">');
  popWin.document.write('<div style="border: 1px solid #CCC; padding: 10px; background-color: #FFF; text-align: center;">');
  popWin.document.write('<a href="javascript:window.close();"><img src="' + whichPhoto + '" style="border:0; width:' + x + '; height:' + y + ';" alt="Click to Close" title="Click to Close"></a>');
  popWin.document.write('</div>');
  popWin.document.write('</body>');
  popWin.document.write('</html>');
	
	popWin.document.close();
  }

// ----------------------------------------------------------------------
// CLOSE EXISTING CHILD WINDOW
// ----------------------------------------------------------------------

function closePopWin() {
  if ((popWin != null) && (popWin.closed != true))
  	popWin.close();
	}

// ----------------------------------------------------------------------
// WRITE CURRENT DATE
// ----------------------------------------------------------------------

function writeDate() {

  var now      = new Date;
  var modDay   = new Array ("sunday","monday","tuesday","wednesday","thursday","friday","saturday");
  var modMonth = new Array ("january","february","march","april","may","june","july","august","september","october","november","december");
	
  document.write(modDay[now.getDay()] + ", " + now.getDate() + " " + modMonth[now.getMonth()] + " " + now.getFullYear());
  }
  
<!--
function generate_email(strCodedEmail, strCipher, strLinkLabel) {	
	// Email obfuscator script 2.1 by Tim Williams, University of Arizona
	// Random encryption key feature by Andrew Moulden, Site Engineering Ltd
	// This code is freeware provided these four comment lines remain intact
	// A wizard to generate this code is at http://www.jottings.com/obfuscator/
	coded = strCodedEmail
	key = strCipher
	shift=coded.length
	link=""
	for (i=0; i<coded.length; i++) {
		if (key.indexOf(coded.charAt(i))==-1) {
		  ltr = coded.charAt(i)
		  link += (ltr)
		}
		else {     
		  ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length
		  link += (key.charAt(ltr))
		}
	}
	if (strLinkLabel=="") {
		document.write("<a href='mailto:"+link+"'>" + link + "</a>")
	}
	else {
		
		document.write("<a href='mailto:"+link+"'>" + strLinkLabel + "</a>")
	}
}

//-->  

function addLoadEvent(func) {
var oldonload = window.onload;
	if (typeof window.onload != 'function') {
	window.onload = func;
	} else {
	window.onload = 
		function() {
		oldonload();
		func();
		}
	}
}

function popWindow(theURL,winName,features) {
  var newWin
  newWin = window.open(theURL,winName,features);
  newWin.focus();
}
function IsIE() {
	return (navigator.appName == "Microsoft Internet Explorer")
}