function addtofavourites(url, title)
{
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "");
}
var phpscript_STF = 'ajax_sendtofriend.php';
var phpscript_STF2 = 'ajax_newsletter.php';
function createRequestObject_STF() {	
	var req;
	if(window.XMLHttpRequest){req = new XMLHttpRequest();} else if(window.ActiveXObject) {req = new ActiveXObject("Microsoft.XMLHTTP");} else {alert('There was a problem creating the XMLHttpRequest object');}
	return req;
}
function createRequestObject_STF2() {
	var req2;
	if(window.XMLHttpRequest){req2 = new XMLHttpRequest();} else if(window.ActiveXObject) {req2 = new ActiveXObject("Microsoft.XMLHTTP");} else {alert('There was a problem creating the XMLHttpRequest object');}
	return req2;
}
// Make the XMLHttpRequest object
var http_STF = createRequestObject_STF();
var http_STF2 = createRequestObject_STF2();
function sendRequestPost_STF() 
{
	var txtEmail = document.getElementById('txtEmail').value;
	var txtName = document.getElementById('txtName').value;
	var txtSenderEmail = document.getElementById('txtSenderEmail').value;
	var TxtComments = document.getElementById('TxtComments').value;
	http_STF.open('post', phpscript_STF);
	http_STF.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http_STF.onreadystatechange = handleResponsePost_STF;
	TxtComments=TxtComments.replaceAll('&',"RRRRRR_RRRRRR");
	http_STF.send('txtEmail='+ txtEmail +'&txtName='+ txtName +'&txtSenderEmail='+ txtSenderEmail +'&TxtComments='+ TxtComments +'&rrrridd=1');
}
function sendRequestPost_STF2() 
{
	var txtEmail = document.getElementById('joinemail').value;
	http_STF2.open('post', phpscript_STF2);
	http_STF2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http_STF2.onreadystatechange = handleResponsePost_STF2;
	http_STF2.send('txtEmail='+ txtEmail);
}
function handleResponsePost_STF() 
{
	if(http_STF.readyState == 1)
	{ 
		document.getElementById("pppppp_send").innerHTML = "Please wait, loading..." ;
	} else if(http_STF.readyState == 4 && http_STF.status == 200){
	var praful_STF = http_STF.responseText;		
		  if(praful_STF==2)
		  {					
				document.getElementById('txtEmail').value="";
				document.getElementById('txtName').value=""
				document.getElementById('txtSenderEmail').value=""
				document.getElementById('TxtComments').value=""
				document.getElementById("pppppp_send").innerHTML = "Your email has been sent.";		
		  }			   
		  else
		  {		
				document.getElementById("pppppp_send").innerHTML = "";
				return true;				
		  }		 
	}
}
function handleResponsePost_STF2() 
{
	if(http_STF2.readyState == 1){document.getElementById("pppppp_send2").innerHTML = "Please wait, loading..." ;} 
	else if(http_STF2.readyState == 4 && http_STF2.status == 200)
	{
		  var praful_STF2 = http_STF2.responseText;		
		  if(praful_STF2==2)
		  {					
				document.getElementById('joinemail').value="";
				document.getElementById("pppppp_send2").innerHTML = "Your email has been added to our eletter list.";		
		  }			   
		  else
		  {		
				document.getElementById("pppppp_send2").innerHTML = http_STF2.responseText;
				return true;				
		  }		 
	}
}
function check(){
	var emailID=document.frmMail.txtEmail;
	var emailSendID=document.frmMail.txtSenderEmail;
	var hide_count=document.frmMail.hide_count;
	var txtName=document.frmMail.txtName
	
	if ((emailID.value==null)||(emailID.value==""))
	{
		alert("Please Enter Friend/co-worker's Email ID")
		emailID.focus()
		return false;
	}
	if(emailID.value!="")
	{
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailID.value)))
		{
			alert("Please enter a proper email address.");
			emailID.focus();
			return false;
		}
	}
	if (txtName.value==''){
		alert("Please Enter Your Name")
		txtName.focus()
		return false;
	}
	if ((emailSendID.value==null)||(emailSendID.value==""))
	{
		alert("Please Enter Your Email ID")
		emailSendID.focus()
		return false;
	}
	if(emailSendID.value!="")
	{
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailSendID.value)))
		{
			alert("Please enter a proper email address.");
			emailSendID.focus();
			return false;
		}
	}
	sendRequestPost_STF();
	return true;
 }
function check2()
{
	var emailID=document.frmMail2.joinemail;
	if ((emailID.value==null)||(emailID.value==""))
	{
		alert("Please enter email address.")
		emailID.focus()
		return false;
	}
	if(emailID.value!="")
	{
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailID.value)))
		{
				alert("Please enter a proper email address.");
				emailID.focus();
				return false;
		}
	}
	sendRequestPost_STF2();
	return true;
 }
