﻿var xml;
function addEmail(geturl) {
var email=document.getElementById("emailgame").value;
if (email=='') {
	alert('יש להזין דוא"ל');
	document.getElementById("emailgame").focus();
	return;
}
if (email.indexOf(' ')!=-1 |  email.indexOf(',')!=-1 | email.indexOf("'")!=-1 |  email.indexOf('@')==-1 | email.indexOf('.')==-1) {
	alert('דוא"ל לא חוקי');
	document.getElementById("emailgame").focus();
	return;
}
if (window.XMLHttpRequest)
	xml=new XMLHttpRequest();
else if (window.ActiveXObject)
	xml=new ActiveXObject("Microsoft.XMLHTTP");
if (xml==null)
	alert ("Browser does not support HTTP Request");
var url=geturl+'?email='+email+'&add=true&rnd='+Math.random();
xml.onreadystatechange=emailResult;
xml.open("GET",url,true);
xml.send(null);
}

function emailResult() { 
if (xml.readyState!=4 && xml.readyState!="complete") return;
var data=xml.responseText;
alert(data);
}

function openSms() {
windowprop='toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizeable=yes,width=320,height=200,left=0,top=0';
if (extwin==null || extwin.closed)
	extwin=window.open ('/prizes/smsreg.asp','ext',windowprop);
else
	extwin.open ('/prizes/smsreg.asp','ext',windowprop);
	
extwin.focus();

}
