function Start(page) {
OpenWin = window.open(page, "_blank", 'toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,status=yes,width=600,height=400');
}

function EnvoiParMail() {
alert("Temos problemas com o nosse serviço de autoresponse. Os seus dados vão ser enviados por e-mail. Desculpe pelo incómodo.");
document.frmInscr.encoding="text/plain";
document.frmInscr.action="mailto:webmaster@clube-positivo.com";
document.frmInscr.submit();
document.location=document.frmInscr.redirect.value;
}

/*
function VerifMail(lMail)
{
var arobase=lMail.indexOf("@")
var point=lMail.lastIndexOf(".")
if ((arobase<1) || (point+1 == lMail.length) || (point < arobase+2)) {alert("E-mail não válido.");return false;}
return true;
}

function FixeCookie (nom,valeur,expire,path,domaine,securise) {
document.cookie = nom + "=" + escape (valeur) + ((expire) ? "; expires=" + expire.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domaine) ? "; domain=" + domaine : "") + ((securise) ? "; secure" : "");
}

function DataOk(strName, strMail) {
if (strName=="") {alert("Por favor, introduza o seu nome.");return false;}
if (strMail=="") {alert("Por favor, introduza o seu e-mail.");return false;}
if (!(VerifMail(strMail))) {return false;}
return true;
}

function EnrData() {
var TheName=frmInscr.name.value;
var TheMail=frmInscr.from.value;
var dateExp = new Date(2200,01,01);
if (DataOk(TheName,TheMail)) {FixeCookie("membername",TheName,dateExp,"/");FixeCookie("membermail",TheMail,dateExp,"/");return true;}
else {return false;}
}
*/
function VerifMail(lMail)
{
var arobase=lMail.indexOf("@")
var point=lMail.lastIndexOf(".")
if ((arobase<1) || (point+1 == lMail.length) || (point < arobase+2)) {alert("E-mail não válido.");return false;}
return true;
}

function FixeCookie (nom,valeur,expire,path,domaine,securise) {
document.cookie = nom + "=" + escape (valeur) + ((expire) ? "; expires=" + expire.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domaine) ? "; domain=" + domaine : "") + ((securise) ? "; secure" : "");
}

function DataOk(strName, strMail) {
if (strName=="") {alert("Por favor, introduza o seu nome.");return false;}
if (strMail=="") {alert("Por favor, introduza o seu e-mail.");return false;}
if (!(VerifMail(strMail))) {return false;}
return true;
}

function EnrData() {
var TheName=document.frmInscr.name_required.value;
var TheMail=document.frmInscr.email_required.value;
var dateExp = new Date(2200,01,01);
if (DataOk(TheName,TheMail)) {FixeCookie("membername",TheName,dateExp,"/");FixeCookie("membermail",TheMail,dateExp,"/");return true;}
else {return false;}
}

function ValeurCookie (Pos) {
var endstr = document.cookie.indexOf (";", Pos);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring (Pos, endstr));
}

function GetValeurCookie (nom) {
var cookielength = document.cookie.length;
var arg = nom + "=";
var arglength = arg.length;
var i = 0;
while (i < cookielength) {
	var j = i + arglength;
	if (document.cookie.substring(i, j) == arg)
	return ValeurCookie (j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break; 
	}
return null;
}

function GetBook(BookName) {
// Vérifier si l'utilisateur s'est déjà inscrit
var valcookie=GetValeurCookie ("membermail");
if (valcookie==null) {
	// L'utilisateur n'est pas inscrit
	strURL=BookName+"1.htm";
	}
else {
	// Utilisateur inscrit -> Appeler la page du livre
	strURL=BookName+"2.htm";
	}
window.location=strURL;
}

function NovoCD() {
NomFen = window.open("http://www.clube-positivo.com/novocd.htm", "_blank", 'toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,status=yes,width=430,height=360');
}