function checkIfConnected(){
	return true;

}

function alertme(){
alert("yes!");

}
//*****************(1)*******************************************
//get tow mails (from bothe mail boxes, checks if one of them is mail 
function checkEmails(email1,email2){
	alert("mail1"+email1);
	alert("mail2"+email2);
	
	var reg = new RegExp("@"); //get better regex!
	
	var mail1=reg.test(email1);
	var mail2=reg.test(email2);

	alert("regex1: "+mail1);
	alert("regex1: "+mail2);
	if (mail1){//mail1 OK
		if (mail2){//mail2 OK
			if(email1==email2){
				Cmail=email1;
			
			}else 
				return "unequal";
		
		}
		else{
			alert("mail1");
		
		}
	
	}
	else{
		alert("mail2");
	
	}
	
}
	
//*******************(2)*****************************
function check_email(mail){
	mail = replace(mail,' ','');
	var m = mail.split("@");
	if (m[1]!=null){
		var n = m[1].split(".");
		if (n[1]!=null) {
			var a=n[0];
			var b=n[1];
			if (a.length<2) m="a";
			if (b.length<2) m="a";
		}
		else {
			m="a";
		}
	}
	else{
		m="a";
	}	
	
	if ((mail!="")&(m!="a"))
	{
		divide_string(mail)
	}
}
			

//************(3)***********************************			
function divide_string(doma){
	var mytool_array=doma.split("@");			
	startRequest(mytool_array[1]);
}	
	
//*************(4)************************
 function startRequest(domain)   { 
     createXMLHttpRequest(); 
     xmlHttp.onreadystatechange = handleStateChange1 ; 
     xmlHttp.open("GET", 'emailcheck.aspx?domain='+domain, false); 
     xmlHttp.send(null); 
} 
//*****************(5)****************************
 function createXMLHttpRequest()  
          {          
              if (window.ActiveXObject)  
              { 
                 try {
		 			
		 			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		 		 	} 
		 	 	catch (e) 
		 		 {
		 		 	try 
		 		 	{
			 	 		
			 	 		http_request = new ActiveXObject("Microsoft.XMLHTTP");
			 	 	} 
			 	 	catch (e) {}
			  	}
                  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
               } 
               else if (window.XMLHttpRequest) 
			 	{  // Mozilla, Safari,...
			 	
			 	http_request = new XMLHttpRequest();
				 	if (http_request.overrideMimeType) 
				 	{
				 		http_request.overrideMimeType('text/plain');
				 		
				 	}  
                 } 
} 
//****************(6)***************************

 function handleStateChange1(){ 
     if(xmlHttp.readyState == 4){ 
		if(xmlHttp.status == 200){ 
           answ=xmlHttp.responseText;
		   if (answ==1) 
				alert("   email do not exist   ");
        } 
     } 
} 

//*****************(6)*******************************



