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


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



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.";
    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.vSubject.value)=="")
   {msg="Please choose a subject for the message you want to send to us.";
    obj=form.vSubject;
   }
 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 and make sure it is correct.\nThe invitation will appear to be sent from this address.\nIt is also useful if your partner wants to reply to you.";
    obj=form.vFromEmail;
   }
 else if(trim(form.vToName.value)=="")
   {msg="Please specify your partner's name.\nThe invitation will be addressed to this name.";
    obj=form.vToName;
   }
 else if(!emailCheck(form.vToEmail.value))
   {msg="Please specify your partner's e-mail address and make sure it is correct.\nThe invitation will be sent to this address.";
    obj=form.vToEmail;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    return false;
   }
 return true;
}

function vEmploymentForm()
{var msg="";
 var obj;
 var form=document.f_employment;
 form.submit.disabled=true;
 if(trim(form.vName.value)=="")
   {msg="Please tell us your name.";
    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;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vTradesForm()
{var msg="";
 var obj;
 var form=document.f_trades;
 form.submit.disabled=true;
 if(trim(form.vName.value)=="")
   {msg="Please tell us your name.";
    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;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}

function vNewDealersForm()
{var msg="";
 var obj;
 var form=document.f_newDealers;
 form.submit.disabled=true;
 if(trim(form.vName.value)=="")
   {msg="Please tell us your name.";
    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;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    form.submit.disabled=false;
    return false;
   }
 return true;
}


function vMapDirForm()
{var msg="";
 var obj;
 var form=document.f_mapdir;
 if(trim(form.vAddress.value)=="")
   {msg="Please specify a street address to get directions from or to.";
    obj=form.vAddress;
   }
 else if(trim(form.vCity.value)=="")
   {msg="Please specify the city/town for the address to get directions from or to.";
    obj=form.vCity;
   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    return false;
   }
 return true;
}


function clearField(o,t)
{if(typeof(o)=='undefined'||o==null) return;
 if(typeof(o.value)=='undefined') return;
 if(typeof(t)=='undefined'||o.value==t) o.value='';
}



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=/^(.+)@(.+)\.(.{2,})$/;
var matchArray=emailStr.match(emailPat);
if (matchArray==null) return false;
return true;
}

var eqhGroups=new Array();
var idUnique=1;

function setEqH()
{var i,idx,objH,maxH,padH,eqhGroup;
 for(idx=0;idx<eqhGroups.length;idx++)
   {eqhGroup=eqhGroups[idx];
    if(eqhGroup&&eqhGroup.length)
      {maxH=0;minPad=-1;
       for(i=3;i<eqhGroup.length;i+=3)
          {eqhGroup[i].style.paddingBottom='';
          }
       for(i=2;i<eqhGroup.length;i+=3)
          {objH=eqhGroup[i].offsetHeight;
           maxH=(objH>maxH)?objH:maxH;
           minPad=(minPad<0||eqhGroup[i+2]<minPad)?eqhGroup[i+2]:minPad;
          }
       maxH=maxH-minPad;
       if(maxH<eqhGroup[1]) maxH=eqhGroup[1];
         else eqhGroup[1]=maxH;
       for(i=2;i<eqhGroup.length;i+=3)
          {objH=eqhGroup[i].offsetHeight;
//           if(objH<maxH)
             {padH=maxH-objH;
//               eqhGroup[i+2]=eqhGroup[i+2]+padH;
              if(eqhGroup[0]==1)
                {animEqH(eqhGroup[i+1].id,0,eqhGroup[i+2]+padH);}
              else{eqhGroup[i+1].style.paddingBottom=(eqhGroup[i+2]+padH)+"px";}
             }
          }
      }
   }
 document.eqhTH=document.body.offsetHeight;
 document.eqhTW=document.body.offsetWidth;
}
function checkEqH()
{if(document.eqhTH!=document.body.offsetHeight||document.eqhTW!=document.body.offsetWidth){setEqH();}
}
function mkEqualHeight()
{var c,e,el,i,idx;
 if(document.getElementById)
   {idx=eqhGroups.length;
    eqhGroups[idx]=new Array();
    eqhGroups[idx][0]=arguments[0];
    eqhGroups[idx][1]=0;
    for(i=1;i<arguments.length;i+=3)
      {el=null;
       c=document.getElementById(arguments[i]);
       if(c)
         {e=c.getElementsByTagName(arguments[i+1].toUpperCase());
          if(e)
             {el=e.length>0?e[e.length-1]:c;if(!el.id){el.id="eqh"+idUnique;idUnique++;}
             }
         }
       if(c&&el)
         {eqhGroups[idx][eqhGroups[idx].length]=c;eqhGroups[idx][eqhGroups[idx].length]=el;
          eqhGroups[idx][eqhGroups[idx].length]=arguments[i+2];
         }
      }
    setInterval("checkEqH()",10);
   }
}
function animEqH(el,p,pt){
 var sp=10,inc=20,g=document.getElementById(el);np=(p>=pt)?pt:p;
 g.style.paddingBottom=np+"px";if(np<pt){np+=inc;
 setTimeout("animEqH('"+el+"',"+np+","+pt+")",sp);}
}
