//shorthand function
function getObj(objID) {
	return document.getElementById(objID);
}

//change the class of an object with a fade
function changeClass(object, newClass) {
if (navigator.appName == "Microsoft Internet Explorer") {
		object.style.filter = "progid:DXImageTransform.Microsoft.Fade()";
		object.filters[0].Apply();
		object.className = newClass;
		object.filters.item(0).Play(0.4); // make fade .4 seconds
	} else {
	object.className = newClass;
	}
}

function changeClassNoFade(object, newClass) {
	object.className = newClass;	
}

// the onclick event handler for the show pictures  button
function showEmail() {
	changeClass(getObj('eContainer'), 'show');
}

function checkEmail() {
	var emailTo = getObj('inputEmail').value;
    var emailMessage = getObj('inputMessage').value;
	
	if(emailTo == "" || emailMessage == "") {
		getObj('eError').innerHTML = "Error: Please fill in all fields.";
	} else {
		getObj('eError').innerHTML = "Mail sent successfully.";
		window.setTimeout('hideEmail()',1000);
	}
}

function hideEmail() {
		changeClass(getObj('eContainer'), 'hidden');
		getObj('eError').innerHTML = "";
		getObj('inputMessage').value = "";
		getObj('inputEmail').value = "";
}

function show_photo(pFileName, pTitle, pWidth, pHeight) {

// specify window paramaters
	photoWin = window.open('', 'photo', 'width=' + pWidth + ', height=' + pHeight + '');

// wrote content to window
	photoWin.document.write('<html><head><title>' + pTitle + '</title></head>');	
	photoWin.document.write('<BODY topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">');
	photoWin.document.write('<div align="center">');
	photoWin.document.write('<a href="javascript:window.close();"><img src="' + pFileName + '" border="0" alt="Click Picture to Close"></a>');
	photoWin.document.write('</div>');
	photoWin.document.write('</body></html>');
	photoWin.document.close();	
	
// If we are on NetScape, we can bring the window to the front
	if (navigator.appName.substring(0,8) == "Netscape") photoWin.focus();

}