
var normWindow;
function openWin(winPage)
{
	window.open(winPage, 'enlarged_image', 'height=600,width=800,top=0,left=0,screenX=0,screenY=0,resizable=yes,scrollbars=yes');
}


function checkEmail(entered, strAlert) {
	with (entered) {
		apos = value.indexOf("@"); 
		dotpos = value.lastIndexOf(".");
		lastpos = value.length - 1;

		if (apos < 1 || dotpos - apos < 2 || lastpos - dotpos > 3 || lastpos - dotpos < 2) {
			if (strAlert) {
				alert(strAlert);
			} 

			return false;
		}
		else {
			return true;
		}
	}
}

function checkEmpty(input, text) {
	with (input) {
		if (value == "" || value == null) {
			if (text != "" && text != null) {
				alert(text);
			} 
			return false;
		} else {
			return true;
		}
	}
}

function checkEitherEmpty(input1, input2, text) {
	var value1 = input1.value;
	var value2 = input2.value;
	
	if ((value1 == "" || value1 == null) && (value2 == "" || value2 == null)) {
		if (text != "" && text != null) {
			alert(text);
		} 
		return false;
	} else {
		return true;
	}
}