// JavaScript Document

/*
 *this function is used verify input in the online contact form.
 *the verifyRequired function checks that no required elements of a form are empty.
 *parameter -parent- is the form object whose child elements you want to check. 
 *parameter -required- is an array filled with the names of the elements that cannot be empty.
 */
function verifyRequired(parent, required){
	var curr;
	for(i=0; i<required.length; i++){
		curr=eval("parent." + required[i] + ".value");
		if(curr.length<1){
			alert("Please make sure that you have filled in all required fields");
			return false;
		}
		if(required[i]=="email"){
			if(curr.indexOf("@")==-1 || curr.indexOf(".")==-1){
				alert("Please make sure that you have entered a valid email address");
				return false;
			}
		}
	}
	return true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function imgPopup(path, width, height, alt){
	ImgWindow=window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',left=20,top=20');
	ImgWindow.document.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">');
	ImgWindow.document.writeln('<html>');
	ImgWindow.document.writeln('<head>');
	ImgWindow.document.writeln('<title>'+alt+'<\/title>');
	ImgWindow.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">');
	ImgWindow.document.writeln('<\/head>');
	ImgWindow.document.writeln('<body style="margin: 0px; padding: 0px;">');
	ImgWindow.document.writeln('<img src="'+path+'" border="0" alt="'+alt+'"\/>');
	ImgWindow.document.writeln('<\/body>');
	ImgWindow.document.writeln('<\/html>');
	ImgWindow.document.close();
	ImgWindow.focus();
}