﻿
function dothis(){

email  = document.getElementById("email").value;




if(!check_email(email)){
alert("عذرا البريد الاكتروني خاطئ");
return false;
}

form1.B1.disabled=true;
params = "?email=" + email ;


var w = 450, h = 345;

if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}

var popW = 450, popH = 345;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;

window.open('admin/mailing_result.php' + params ,'popup','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);


}




function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){ 
return (false);
}	
} 

if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);		
} 

}

}

