﻿	function popUp(url) {
		sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=550,height=500');
		self.name = "mainWin";
	}
	function fnValidateEmailFormat(emailAddress)
	{
		var StrTemp,part1,part2;
		StrTemp=emailAddress;
		if ((emailAddress.indexOf(" ")) == 0)
	//ValidateEmailFormatSpaceBeginning
			while (StrTemp.indexOf(" ") == 0)
				StrTemp = (StrTemp.replace(" ",""));
	//
		part1 = (StrTemp.indexOf("@"));
		part2 = (StrTemp.lastIndexOf("."));
		if((StrTemp.indexOf("'")) >= 0 ||(StrTemp.indexOf("@.")) >= 0 || (StrTemp.lastIndexOf(",")) >= 0 || (StrTemp.indexOf(".@")) >= 0 || (StrTemp.lastIndexOf("@")) != part1 || (StrTemp.length) == (part2+1) || (StrTemp.indexOf(" ")) > 0)
			return false;
		if(part1 > 0 && part2 > 0 && part2 > part1)
			return true;
		return false;
	}

	function fnValidateOnlineForm()
	{
   var TheEmail = document.OnlineForm.Email.value;    	
			if (TheEmail.length>1)
			{
				if (!fnValidateEmailFormat (TheEmail))
				{
					alert ("EMail address does not seems to be valid."+"\n"+"Is it important that you will enter a VALID email. "+"\n"+"(Invoice and registration information will be sent to that email)");
					document.OnlineForm.Email.focus();
					return false;
				}
			}	
			else
			{
					alert ("EMail address does not seems to be valid."+"\n"+"Is it important that you will enter a VALID email."+"\n"+"(Invoice and registration information will be sent to that email)");
					document.OnlineForm.Email.focus();
					return false;
				}
				document.OnlineForm.submit();
			return true;
	}

