// JavaScript Document
function NewWindow(mypage,myname,w,h,scroll,pos)
{
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
}

function test(field)
{
if(field.value.length > 0) return(true)
alert("ATTENTION!\n\nYou have not entered information in the " + field.id + " field.\n\nPlease do so before proceeding.");
field.focus();
field.select();
return(false);
}

function validateEmail(email)
{
if(window.RegExp)
{
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
var reg1 = new RegExp(reg1str);
var reg2 = new RegExp(reg2str);
if(!reg1.test(email.value) && reg2.test(email.value)) return(true);
alert("ATTENTION!\n\nYour email address seems incorrect.\n\nPlease make make sure you have entered a valid email address.");
email.focus();
email.select();
return(false);
}
else
{
if(email.value.indexOf("@") >= 0) return(true);
alert("ATTENTION!\n\nYour email address seems incorrect.\n\nPlease make make sure you have entered a valid email address.");
email.focus();
email.select();
return(false);
}
}

function checkSubscriber(post)
{ 
var check;
check = test(post.Email) && validateEmail(post.Email);
return check;
}
