var ObjMenuPos=window.top.document.getElementById("MenuPos");

function Validate(){
	if (document.QuotationForm.Name.value.length<1){
		alert("Please enter your name.");
		document.QuotationForm.Name.focus();
		return false;
	}
	if (!CheckEmailAddress(document.QuotationForm.email.value)){
		alert("Please enter a valid email address.");
		document.QuotationForm.email.focus();
		return false;
	}
	if (document.QuotationForm.AssayDescription.value.length<10){
		alert("Please enter some information in the experimental description page so we can answer your query more effectively");
		document.QuotationForm.AssayDescription.focus();
		return false;
	}
	return true;
}

function CheckEmailAddress(pEmailAddress){
	DotLoc=pEmailAddress.indexOf(".");
	ampLoc=pEmailAddress.indexOf("@");
	EndChar=pEmailAddress.charAt(pEmailAddress.length-1)
	if (DotLoc<1 || ampLoc<1 || EndChar=="." || EndChar=="@") return false;
	return true;
}

function NumericOnly(pEvent){
	var ValidChars="1234567890()- ";
	keycode = (pEvent.keyCode) ? pEvent.keyCode: pEvent.which;
	char=String.fromCharCode(keycode);
	if (ValidChars.indexOf(char)==-1) return false;
	return true;
}

function SetMenus(){
	StartScroll();
	ObjMenuPos.innerHTML="Imagen";
	Obj=window.top.document.getElementById("Imagen");
	a=findchild(Obj,"A");
	a.style.display="none";
	a=findchild(Obj,"#text");
	if (a)
		a.nodeValue="Imagen"
	else{
 		var TextNode=document.createTextNode("Imagen");
		Obj.appendChild(TextNode);
	}
}

function StartScroll(){
	window.top.document.getElementById("ScrollFlag").innerHTML="true";
}

function findchild(obj,tag){
	cn=obj.childNodes;
	for (k=0; k<cn.length; k++){
		if (cn[k].nodeName==tag) return cn[k];
	}
	return false;
}

