function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function formvalidation(form) {
	with (form) {
	
	if (emptyvalidation(email,"Please Enter Your Email Address")==false) {email.focus(); return false;};
	if (emptyvalidation(password,"Please Enter Your Password")==false) {password.focus(); return false;};

	

this.form.submit();
}
}

function emptyvalidation2(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function formvalidation2(form) {
	with (form) {
	if (emptyvalidation2(em_name,"Please Enter Your Name")==false) {em_name.focus(); return false;};	
	if (emptyvalidation2(em_email,"Please Enter Your Email Address")==false) {em_email.focus(); return false;};	
	if (emptyvalidation2(em_comments,"Please Enter Your Comments")==false) {em_comments.focus(); return false;};	

this.form.submit();
}
}


function IsEmailValid(FormName,ElemName)
{
var EmailOk  = true
var Temp     = document.forms[FormName].elements[ElemName]
var AtSym    = Temp.value.indexOf('@')
var Period   = Temp.value.lastIndexOf('.')
var Space    = Temp.value.indexOf(' ')
var Length   = Temp.value.length - 1   

if ((AtSym < 1) ||                    
    (Period <= AtSym+1) ||            
    (Period == Length ) ||          
    (Space  != -1))                  
   {  
      EmailOk = false
      alert("Please enter a valid e-mail address!");
      Temp.value="";
      Temp.focus()
   }
return EmailOk
}

function openSesame(theURL) {
		leftPos = (screen.width / 2) - 200;
	topPos = (screen.height / 2) - 150;
  window.open(theURL,'vid','width=400,height=300,left='+leftPos+',top='+topPos+',innerHeight=0,innerWidth=0,outerHeight=0,outerWidth=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0');
}