// JavaScript Document

function tell_a_friend_popup(mylink, windowname){
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=310,height=400,scrollbars=no');
return false;
}

/* validation begin */
function setFocus ()
{
document.tellafriend.name.focus();
}

function reset() {
document.tellafriend.name.value="";
document.tellafriend.email.value="";
document.tellafriend.friendmail1.value="";
}

function validate() {

var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;

if (document.tellafriend.name.value.length==0) {
alert("please enter your name");
document.tellafriend.name.select();
return false;
}

else if (!isNaN(document.tellafriend.name.value)) {
alert("please check your name");
document.tellafriend.name.select();
return false;
}

else if (document.tellafriend.email.value.length==0) {
alert("please enter your email address");
document.tellafriend.email.select();
return false;
}

else if (!(document.tellafriend.email.value.match(re))) {
alert ("please check your email");
document.tellafriend.email.select();
return false;
}

else if (document.tellafriend.friendmail1.value.length==0) {
alert("please enter your friend's email address");
document.tellafriend.friendmail1.select();
return false;
}

else if (!(document.tellafriend.friendmail1.value.match(re))) {
alert ("please check your friend's email");
document.tellafriend.friendmail1.select();
return false;
}

document.tellafriend.submit()
return true;
}
/* validation end */
