function checkEmail(emailAddr) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailAddr)){
	return (true)
	}
	alert("Invalid email!")
	return (false)
}

function validform(nform){
	email = nform.email.value;

	if (email == ""){
		window.alert("Enter your email please!");
		return false;
	
	}else if (checkEmail(email) != true){
		return false;
	}else {
		nform.valid.value = "ok";
		nform.submit();
	}

}

function centerwindow(theurl,wname,width,height,options) {
    x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
        if (screen.availWidth > 1800) { 
        x = ((screen.availWidth/2) - width)/2; 
    } 

	theurl = theurl + location.search ;

	if (options != ""){
		options = "," + options ;
	}
	openWin = window.open(theurl, wname, 'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x + options); 
	if(openWin.window.focus){openWin.window.focus();}

}

function inscription(nform){
	name = nform.name.value;
	email = nform.email.value;

	if ((name == "") || (email == "")){
		window.alert("Enter your name and email please!");
		return false;
	
	}else if (checkEmail(email) != true){
		return false;
	}else {
		//centerwindow("http://www.gagneraupokerenligne.net/loto-quebec-se-lance-dans-le-poker-en-ligne-des-septembre-2010-53","popup",595,180,"scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no, location=no");
		nform.submit();
	}

}
