
function nightliteNav(event, which) {
	if (document.images) {
		if (event=="over") {
			document.images["img_nav_"+which].src="/images/nav/"+which+"_on.gif";
		} else {
			document.images["img_nav_"+which].src="/images/nav/"+which+"_off.gif";
		}
	}
}

function nightliteNavHome(event, which) {
	if (document.images) {
		if (event=="over") {
			document.images["img_home_nav_"+which].src="/images/home_nav_"+which+"_over.gif";
		} else {
			document.images["img_home_nav_"+which].src="/images/home_nav_"+which+"_off.gif";
		}
	}
}

function validateContact() {
	var errorText="";
	if (document.form_contact.name.value=="") errorText+="-  please enter your name\n";
	if (isEmail(document.form_contact.emailAddress.value)==false) errorText+="-  please enter a properly formatted email address\n";
	if (document.form_contact.comments.value=="") errorText+="-  please enter some comments\n";

	if (errorText=="") {
		return true;
	} else {
		alert(errorText);
		return false;
	}
}

function validateNewsletter() {
	var errorText="";
	if (isEmail(document.form_newsletter.email.value)==false) errorText+="-  please enter a properly formatted email address\n";

	if (errorText=="") {
		return true;
	} else {
		alert(errorText);
		return false;
	}
}

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

function photoDetails(imageName, imageWidth, imageHeight) {
	var newWidth=imageWidth*1+50;
	var newHeight=imageHeight*1+50;
	window.open("photoPopup.php?img="+imageName, "imageDetailsWin", "width="+newWidth+",height="+newHeight+",status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
}

function windowResize(width, height) {
	window.resizeTo(width*1+50, height*1+150);
	self.focus();
}

