function val_EmptyTxt(txtControl,mailUrl,profileid)
{	
	//alert("dgfdgdg");
	var ctrl=document.getElementById(txtControl).value;
	if(ctrl=="")
	{
		document.getElementById('emailError').innerHTML="Please Enter the Email ID";
		return false;
	}
	if(ctrl!="")
	{
			var email = ctrl;			
		  	var arr=email.split(",");
			for(var i=0;i<arr.length;i++)
			{
				var email1=arr[i];
				if(!validation_email(email1))
				{
					return false;
				}	
				
			}
			document.getElementById('emailError').innerHTML="";
			SendMultiMail(email,mailUrl,profileid);
			document.getElementById('divloader').style.display = 'block';
			//return true;
	}
}

function validation_email(email)
{
    var RegExp = /^([a-zA-Z0-9_\-\.])+@(([0-2]?[0-5]?[0-5]\.[0-2]?[0-5]?[0-5]\.[0-2]?[0-5]?[0-5]\.[0-2]?[0-5]?[0-5])|((([a-zA-Z\-])+\.)+([a-zA-Z\-])+))$/
    if(RegExp.test(email))
	{
    	return true;
    }
	else
	{
		document.getElementById('emailError').innerHTML="Invalid Email ID...";
        return false;
    }
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	  }
	return xmlHttp;
}

function SendMultiMail(str,mailUrl,profileid)
{		
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	  
	var url=mailUrl;
	url=url+"?mail="+str+"&profileid="+profileid;
	//alert(url);
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange=MailSend;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function MailSend()
{ 		
	if (xmlHttp.readyState==4)	
	{
		var msg=xmlHttp.responseText;	
		//alert(msg);
		document.getElementById('divloader').style.display = 'none';
		document.getElementById('contentArea').innerHTML = msg;		
	}
}
