function popupTellFriend()
{
    var title = 'Tell a Friend';
    var id = 'Tell';
    var innerHeight_ = window.innerHeight ? window.innerHeight : document.documentElement.offsetHeight;
    win1 = new Window(id, {className: "sandalsnew",
    					   title: title,
    					   width:500,
    					   height:170,
    					   left: document.body.clientWidth / 2 - 500/2 + document.body.scrollLeft,
    					   top: document.documentElement.scrollTop + innerHeight_ / 2 - 170/2 + document.body.scrollTop,
    					   destroyOnClose: true});
    var content = '';
    content += "<form action='' method='post' name='tellFriend'>" + 
    		   "<div id='info'>" +
    		   "Please enter friend's email address" + 
    		   "</div>" +
    		   
			   "    <input type='text' name='email' value='' style='width: 300px;'>" +
			   "    <div>" +
			   "        <input style='cursor: pointer;' type='button' value='Submit' onClick=\"sendEmail(document.tellFriend.email.value)\">" +
			   "    </div>"
			   "</form>";
    win1.getContent().innerHTML = content;
    win1.show();
}

function sendEmail(email) {
	var reg = /(\w+@[a-zA-Z_]+?\.[a-z]{2,4})/;
	var result = reg.test(email);
	if (!result) {
		Ajaxx.go('tellFriend/index.php', {method:"post",
										  data: "&mailFriend=send&email=" + email,
										  eval: "document.getElementById('info').innerHTML = '<div style=\"color: red; font-family: sans-serif;\"> " +
										  													 "    Please enter correct email address" +
										  													 "</div>'"});
	} else {
		Ajaxx.go('tellFriend/index.php', {method:"post",
										  data: "&mailFriend=send&email=" + email,
										  eval: "document.getElementById('info').innerHTML = '<div style=\"font-family: sans-serif;\">" +
										  													 "    Thank you!" +
										  													 "</div>'"});
	}
}