function whichSite() {
	alert(squonk);
}

function normRoll(imgname, imgsrc) {

	if (whichsite == "CRE") {
		imgdir = "img_cre";
	} else {
		imgdir = "img_gfi";
	}

	imgsrc = imgdir + "/" + imgsrc;
	document.images[imgname].src = imgsrc;
	return true;
}

function formvalidation(thisform) {
	with (thisform) {

		if (emptyvalidation(fromname,"Please enter your name.")==false) {fromname.focus(); return false;};

		if (emailvalidation(fromemail,"Please enter a valid email.")==false) {fromemail.focus(); return false;};

		return true;

	}
}


// Form Validation

function emailvalidation(entered, alertbox) {
	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 (alertbox) {
				alert(alertbox);
			} 
			return false;
		} else {
			return true;
		}
	}
}

function emptyvalidation(entered, alertbox) {
	with (entered) {
		if (value==null || value=="" || value==0) {
			if (alertbox!="") {
				alert(alertbox);
			} return false;
		} else {
			return true;
		}
	}
}


function filevalidation(entered, alertbox) {
	docmarker = 0;
//	alert(whichmany);
	with (entered) {
		if (value == "") {
			value = none;
		}
//		alert(value);
		for (var i = 0; i <= whichmany; i++) {
			oppos=value.lastIndexOf(whichdocs[i]);
			xpos = value.length;
			markpos = xpos - 4;
//			alert(markpos + " " + oppos);
			if (markpos == oppos) {
				docmarker = 1;
			}
		}
		
		if (docmarker != 1) {
			if (alertbox) {
				alert(alertbox);
			}
			return false;
		} else {
			return true;
		}

	}
}

// End Form Validation

