﻿function newWindow( url, width, height, resize, scroll ) 
{ 
    var x = (screen.width-width)/2; 
    var y = (screen.height-height)/2 - 70; 
    
    var win = window.open(url,'newwindow','top=' + y + ',left=' + x + ',status=yes,toolbar=no,location=no,scrollbars='+scroll+',width='+width+',height='+height); 
    win.focus();
}

function ValidateEmailFooter()
{
    var bValidated = true;
    var EmailReg = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w)*/;
    var oEmail = document.getElementById("tBox_EmailFooter");
    
    if (oEmail.value=="")
    {
        alert("Please enter a valid e-mail address.");
        oEmail.focus();
        bValidated = false;
    }else{
        if(!EmailReg.test(oEmail.value))
        {
            alert("The e-mail address you entered does not follow the accepted pattern.");
            oEmail.focus();
            bValidated = false;
        }else{
            bValidated = true;
        }
    }
    
    if(bValidated)
    {
        window.location.href = "/happen/subscribe.aspx?email=" + oEmail.value;
    }
}

