function bookmarksite(title, url)
{
	if(document.all)											// ie
		window.external.AddFavorite(url, title);
	else
		alert("Press CTRL+D to bookmark this site.");
}
function tellafrnd()
{
	if(trim(document.tellafriend.sender_name.value, " ") == '')										
	{
		alert('Please Enter Your Name');
		document.tellafriend.sender_name.focus();
		return false;
	}
	else if(trim(document.tellafriend.sender_email.value, " ") == '')										
	{
		alert('Please Enter Your Email');
		document.tellafriend.sender_email.focus();
		return false;
	}
	else if(echeck(document.tellafriend.sender_email.value) ==  'invalid')
	{
		alert('Please Enter Valid Email');
		document.tellafriend.sender_email.focus();
		return false;
	}
	else if(trim(document.tellafriend.friendemail1.value, " ") == '')										
	{
		alert("Please Enter Your Friend's Email");
		document.tellafriend.friendemail1.focus();
		return false;
	}
	else if(echeck(document.tellafriend.friendemail1.value) ==  'invalid')
	{
		alert('Please Enter Valid Email');
		document.tellafriend.friendemail1.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return "invalid";
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return "invalid";
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return "invalid";
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return "invalid";
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return "invalid";
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return "invalid";
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return "invalid";
		 }

 		 return "valid";					
	}
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

