
function openWindow(Url, winName, winWidth, winHeight) { 
var winl = (screen.width-winWidth)/2;
var wint = (screen.height-winHeight)/2;

	newWindow = window.open(Url, winName, 'top='+wint+', left='+winl+', toolbar=no, location=no, directories=no, scrollbars=yes, status=no, resizable=no, width='+winWidth+', height='+winHeight+'');
	newWindow.focus();

}

function zoomImage(imgName, imgWidth, imgHeight) {
//imgWindow = window.open(imgName, 'ZoomImage', 'top=0, left=0, toolbar=no, location=no, directories=no, scrollbars=yes, status=no, resizable=yes');
var winWidth=(imgWidth>screen.width)?screen.width:imgWidth;
var winHeight=(imgHeight>screen.height)?screen.height:imgHeight;

var windowX = (screen.height-winHeight)/2;
var windowY = (screen.width-winWidth)/2;
var Html=""+
"<html>"+
"<head>"+
"<title>Zoom Image</title>"+
"</head>"+
"<body style=\"margin: 0px 0px 0px 0px; overflow:auto;\">"+
"<img src=\""+imgName+"\" width=\""+imgWidth+"\" height=\""+imgHeight+"\" border=\"0\" alt=\"\">"+
"</body>"+
"</html>"
	//newWindow = window.open(Url, winName, 'top='+wint+', left='+winl+', toolbar=no, location=no, directories=no, scrollbars=yes, status=no, resizable=yes, width='+winWidth+', height='+winHeight+'');
	//newWindow.focus();

	imgWindow = window.open("", 'ZoomImage', 'top='+windowX+', left='+windowY+', toolbar=no, location=no, directories=no, status=no, resizable=no, width='+winWidth+', height='+winHeight+'');
	imgWindow.blur();
	window.focus()
	//imgWindow.resizeTo(winWidth, winHeight);
	//newWindow.moveTo(windowX, windowY);
	imgWindow.document.open();
	imgWindow.document.write(Html);
	imgWindow.document.close();
	imgWindow.focus()

}

function CheckContactForm() {
	if(document.getElementById('Name').value=='') {
		document.getElementById('Name').focus();
		return false;
	} else if(document.getElementById('Telephone').value=='') {
		document.getElementById('Telephone').focus();
		return false;
	} else if(!EmailValid(document.getElementById('Email').value)) {
		document.getElementById('Email').focus();
		return false;
	} else if(document.getElementById('Address').value=='') {
		document.getElementById('Address').focus();
		return false;
	} else if(document.getElementById('Comment').value=='') {
		document.getElementById('Comment').focus();
		return false;
	}
	return true;
}

function EmailValid(Email) {

var goodEmail = Email.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);

	if (goodEmail){
		return true;
	} else {
		return false
	}
}
