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


function showWin(u,n)
{f=(n=="urb2"?"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(typeof(n)=="undefined") n="urb";
 hwnd=window.open(u,n,f);
 //hwnd.focus();
}
function popup(url){showWin(url,"urb")}


var processingForm=false;

function vContactForm()
{var msg="";
 var obj;
 var form=document.f_contact;
 if(processingForm)
   {alert('The form is being processed.');
    return false;
   }
 processingForm=true;
 if(trim(form.vName.value)=="")
   {msg="Please tell us your name!";
    obj=form.vName;
   }
 else if(!emailCheck(form.vEmail.value))
   {msg="Please provide a valid e-mail address where you want to receive the reply!";
    obj=form.vEmail;
   }
 else if(trim(form.vSubject.value)==""||form.vSubject.value[0]=="-")
   {msg="Please choose a subject for your message!";
    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();
    processingForm=false;
    return false;
   }
 return true;
}


function vReqEstimateForm()
{var msg="";
 var obj;
 var form=document.f_reqEstimate;
 if(processingForm)
   {alert('The form is being processed.');
    return false;
   }
 processingForm=true;
// if(msg=="")
//   {
     if(trim(form.vProjBusinessType.value)=="")
       {msg="Please let us know what is your business.";
        obj=form.vProjBusinessType;
       }
     else if(trim(form.vProjBusinessGeo.value)=="")
       {msg="Please let us know what geographic area you serve.";
        obj=form.vProjBusinessGeo;
       }
     else if(trim(form.vProjBusinessProd.value)=="")
       {msg="Please describe your business (product/service) for which the new visual identity will be developed.";
        obj=form.vProjBusinessProd;
       }
     else if(trim(form.vProjBusinessPers.value)=="")
       {msg="Please describe the personality of your business (product/service).";
        obj=form.vProjBusinessPers;
       }
     else if(trim(form.vProjTargCust.value)=="")
       {msg="Please let us know who are your customers.";
        obj=form.vProjTargCust;
       }
     else if(trim(form.vProjTargSol.value)=="")
       {msg="Please describe how do you help your customers.";
        obj=form.vProjTargSol;
       }
     else if(trim(form.vProjTargComp.value)=="")
       {msg="Please list your competition.";
        obj=form.vProjTargComp;
       }
     else if(trim(form.vProjTargSW.value)=="")
       {msg="Please let us know how are you better or worse than your competitors.";
        obj=form.vProjTargSW;
       }
     else if(trim(form.vProjIdName.value)=="")
       {msg="Please state the exact name of the business (product/service) to be used in your logo.";
        obj=form.vProjIdName;
       }
     else if(trim(form.vProjBudget.value)=="")
       {msg="Please select the budget range for your project.";
        obj=form.vProjBudget;
       }
     else if(trim(form.vContFirstName.value)=="")
       {msg="Please tell us your name.";
        obj=form.vContFirstName;
       }
     else if(trim(form.vContLastName.value)=="")
       {msg="Please tell us your name.";
        obj=form.vContLastName;
       }
     else if(!emailCheck(form.vContEmail.value))
       {msg="Please provide a valid e-mail address where we can contact you.";
        obj=form.vContEmail;
       }
     else if(trim(form.vContPhone.value)=="")
       {msg="Please provide a phone number where we can contact you.";
        obj=form.vContPhone;
       }
     else if(trim(form.vContOrgName.value)=="")
       {msg="Please tell us the name of your organization.";
        obj=form.vContOrgName;
       }
     else if(trim(form.vContPosition.value)=="")
       {msg="Please tell us what is your position within the organization.";
        obj=form.vContPosition;
       }
     else if(trim(form.vContIndustry.value)=="")
       {msg="Please tell us what industry is your organization mainly active in.";
        obj=form.vContIndustry;
       }
     else if(trim(form.vContProv.value)=="")
       {msg="Please tell us where are you located.";
        obj=form.vContProv;
       }
     else if(trim(form.vContCity.value)=="")
       {msg="Please tell us where are you located.";
        obj=form.vContCity;
       }
//      else if(form.vAccepted.checked==false)
//        {msg="You have to confirm that you read, understood and accepted the Terms of Use and the Privacy Policy, before continuing.";
//         obj=form.vAccepted;
//        }
//   }
 if(msg!="")
   {alert(msg);
    obj.focus();
    processingForm=false;
    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 fillField(o,t)
{if(typeof(o)=='undefined'||o==null) return;
 if(typeof(o.value)=='undefined') return;
 if(typeof(t)!='undefined'&&o.value=='') o.value=t;
}

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;
}



function getObj(id,d)
{var i,o,d; if(!d) d=document;
 if(!(o=d[id])&&d.all) o=d.all[id];
 if(!o&&d.getElementById) o=d.getElementById(id);
 for(i=0;!o&&i<d.forms.length;i++) o=d.forms[i][id];
 for(i=0;!o&&d.layers&&i<d.layers.length;i++) o=getObj(id,d.layers[i].document);
 return o;
}

function preloadImages()
{var d=document;
 if(d.images)
   {if(!d._pi) d._pi=new Array();
    var i,j=d._pi.length,a=preloadImages.arguments;
    for(i=0;i<a.length;i++)
      {d._pi[j]=new Image; d._pi[j++].src=a[i];
      }
   }
}

function swapImages()
{var i,j=0,io,a=swapImages.arguments; document._soi=new Array;
 for(i=0;i<(a.length-1);i+=2)
   if((io=getObj(a[i]))!=null)
     {document._soi[j++]=io; if(!io.oSrc) io.oSrc=io.src; io.src=a[i+1];}
}

function restoreSwapImages()
{var i,io,a=document._soi;
 for(i=0;a&&i<a.length&&(io=a[i])&&io.oSrc;i++) io.src=io.oSrc;
}


