 var http = createRequestObject();
 function createRequestObject() 
     {
           var xmlhttp;
	 try 
                 { 
                    xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
                 }
	  catch(e) 
                 {
	    try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	    catch(f) { xmlhttp=null; }
	    }
	        if(!xmlhttp&&typeof XMLHttpRequest!="undefined") 
                        {
	  	   xmlhttp=new XMLHttpRequest();
	           }
		   return  xmlhttp;
 }
 
 
function emailSMS(idnun)

  {
	var ymail=document.getElementById('ye'+idnun).value;
	var fmail=document.getElementById('fe'+idnun).value;
	alert("Your Email : " + ymail + '\n' + "Friends Email : " + fmail);
	var sndelement = document.getElementById('snd'+idnun);
             sndelement.innerHTML = "<img src='sndprogress.gif'>";
            try
              {
                 http.open('GET', 'sendsms.asp?id='+idnun+'&ymail='+ymail+'&fmail='+fmail);
                 http.onreadystatechange = handleResponsesms;
	    http.send(null);
	 }
	    catch(e){}
	    finally{}
 }
 
 function handleResponsesms() 
  {
     try
         {
             if((http.readyState == 4)&& (http.status == 200))
                {
    	          var response = http.responseText;
                       var update = new Array();

                    if(response.indexOf('|') != -1) 
                       {
                          update = response.split('|');
                          var sdrelement = document.getElementById('snd'+update[0]);
                          var sended = document.getElementById('sd'+update[0]);
                          sdrelement.style.display ='none';
                          sended.style.display ='block';
             }
	        }
        }
	catch(e){alert("an error occured");}
	finally{}
}


