function echomail(acc,dom){document.write(acc+"@"+dom)}
function mail2(acc,dom){location.href="mailto:"+acc+"@"+dom}


function showWin(u,n)
{f=(n=="CompOWom2"?"top=20,left=20":"top=0,left=0")
  +",width=620,height=580,location=no,menubar=no,titlebar=no,status=no,toolbar=no,"
  +"scrollbars=yes,"
  +"resizable=no";
// if(n==undefined) n="CompOWom";
 hwnd=window.open(u,n,f);
 //hwnd.focus();
}
function popup(url){showWin(url,"CompOWom")}


function vContactForm()
{var msg="";
 var obj;
 var form=document.f_contact;
 form.submit.disabled=true;
 if(trim(form.vName.value)=="")
   {msg="Please tell us your name, the way you want us to address you!";
    obj=form.vName;
   }
 else if(!emailCheck(form.vEmail.value))
   {msg="Please specify a valid e-mail address where you want to receive the reply!";
    obj=form.vEmail;
   }
 else if(trim(form.vMsg.value)=="")
   {msg="Please type in the message you want to send to us!";
    obj=form.vMsg;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vTellafriendForm()
{var msg="";
 var obj;
 var form=document.f_tellafriend;
 if(trim(form.vFromName.value)=="")
   {msg="Please specify your name.\nThe invitation will be signed using this name.";
    obj=form.vFromName;
   }
 else if(!emailCheck(form.vFromEmail.value))
   {msg="Please specify your e-mail address.\nThe invitation will appear to be sent from this address.\nIt is also useful if your friend wants to reply to you.";
    obj=form.vFromEmail;
   }
 else if(trim(form.vToName.value)=="")
   {msg="Please specify your friend's name.\nThe invitation will be addressed to this name.";
    obj=form.vToName;
   }
 else if(!emailCheck(form.vToEmail.value))
   {msg="Please specify your friend's e-mail address.\nThe invitation will be sent to this address.";
    obj=form.vToEmail;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    return false;
   }
 return true;
}

function vSubscribeForm()
{var msg="";
 var obj;
 var form=document.f_subscribe;
 form.submit.disabled=true;
 if(trim(form.vName.value)=="")
   {msg="Please tell us your name, the way you want us to address you!";
    obj=form.vName;
   }
 else if(!emailCheck(form.vEmail.value))
   {msg="Please specify a valid e-mail address where you want to receive our e-bulletin";
    obj=form.vEmail;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vUnsubscribeForm()
{var msg="";
 var obj;
 var form=document.f_unsubscribe;
 form.submit.disabled=true;
 if(!emailCheck(form.vEmail.value))
   {msg="Please specify the e-mail address where you are currently receiving our e-bulletin!";
    obj=form.vEmail;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vSendartForm()
{var msg="";
 var obj;
 var form=document.f_sendart;
 form.submit.disabled=true;
 if(trim(form.vMsg.value)=="")
   {msg="Please type in the article you want to send to us!";
    obj=form.vMsg;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vPaymentForm()
{var msg="";
 var obj;
 var form=document.f_pay;
 form.submit.disabled=true;
 now = new Date();
 cy=now.getYear();
 if(cy<1000) cy+=1900;
 cm=now.getMonth()+1;
 vy=parseInt(form.expYear.value,10);
 vm=parseInt(form.expMonth.value,10);
 if(isNaN(vy)||isNaN(vm)) vy=0;
  else vy+=2000;
 form.cc_num.value=trim(form.cc_num.value);
 if(form.cc_num.value.length!=16)
   {msg="Please specify a valid credit card number - 16 digits, without spaces or other separators.";
    obj=form.cc_num;
   }
 else if(vy<cy||(vy==cy&&vm<cm))
   {msg="The credit card expiration date ("+vm+"/"+vy+") is in the past!";
    obj=form.expMonth;
   }
 else if(trim(form.cardholder.value)=="")
   {msg="Please specify the cardholder's name exactly as it apears on the credit card.";
    obj=form.cardholder;
   }
 else if(!emailCheck(form.email.value))
   {msg="Please specify a valid e-mail address where you want to receive the receipt!";
    obj=form.email;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vOrderBookForm()
{var msg="";
 var obj;
 var form=document.f_order_book;
 form.submit.disabled=true;
 if(isNaN(form.vQuantity.value)
  ||isNaN(parseInt(form.vQuantity.value))
  ||parseInt(form.vQuantity.value)<=0
   )
   {msg="Please specify a valid quantity!";
    obj=form.vQuantity;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vDinnerRegisterForm()
{var msg="";
 var obj;
 var form=document.f_dinner_register;
 form.submit.disabled=true;
 if(form.vJoin[2].checked
  &&form.vJoinType.selectedIndex==0
   )
   {msg="Please choose a type of membership!";
    obj=form.vJoinType;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}



function trim(str)
{var first,last;
 for (first=0; first<str.length&&str.charCodeAt(first)==32; first++);
 for (last=str.length; last>first&&str.charCodeAt(last-1)==32; last--);
 return (last>first?str.substr(first,last-first):'');
}

function emailCheck(emailStr) {
emailStr=trim(emailStr);
if(emailStr=='')return false;
var emailPat=/^(.+)@(.+)$/;
var matchArray=emailStr.match(emailPat);
if (matchArray==null) return false;
return true;
}

