/////////////////////////////////////ajax script for find password////////////////////////////////////////

var xmlHttp_mail;


function send_mailer(city,eatzId)

{

var email_mail=document.getElementById("email_mail").value;

//////////////////////////////////////
if(email_mail=='')
{
alert("Enter Mail Id");
}
else
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
 
  if(reg.test(email_mail) == false)
   {
     alert("Invalid Email Address");
    email_mail='';
    document.getElementById("email_mail").focus();
     
	 }
	 else{
/////////////////////////////////////////

xmlHttp_mail=GetXmlHttpObject()

if (xmlHttp_mail==null)

  {

  alert ("Your browser does not support AJAX!");

  return;

  } 

var comment_mail=document.getElementById("comment_mail").value;


var url=city+"sendmailto_friend.php";

url=url+"?comment_mail="+comment_mail+"&email_mail="+email_mail+"&eatzId="+eatzId;

xmlHttp_mail.onreadystatechange=comment_test_post_vote_mail;

xmlHttp_mail.open("GET",url,true);

xmlHttp_mail.send(null);
if(xmlHttp_mail.readyState<4)
{
document.getElementById("Successmail_rext").innerHTML="&nbsp<img src='"+city+"images/loading.gif' /> Sending Mail.....";
}
}
}
}

function comment_test_post_vote_mail() 

{ 

if (xmlHttp_mail.readyState==4)

{ 


document.getElementById("email_mail").value='';
var test_post_mail=xmlHttp_mail.responseText;

var array_textmail=test_post_mail.split("@eatzsendmail@");

document.getElementById("Successmail_rext").innerHTML=array_textmail[0];

document.getElementById("comment_mail").value=array_textmail[1];
 timedCount_mail();
}
}
function GetXmlHttpObject()

{

var xmlHttp=null;

try

  {

 

  xmlHttp=new XMLHttpRequest();

  }

catch (e)

  {

 

  try

    {

    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

    }

  catch (e)

    {

    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

    }

  }

return xmlHttp;

}
///////////////////////////////////////////end//////////////////////////////////////////////////////////
