function click(e) 
{
  if (document.all) 
  {
    if (event.button == 2) 
    {
      alert("Copyright Yarak.");
      return false;
    }
  }
}

document.onmousedown=click;

function openNewWindow(newURL,winName,features) 
{ 
  window.open(newURL,winName,features);
}

function checkEmailDataNL()
{
  if (isEmpty(document.email.name.value)) 
  {
    alert("Naam is niet ingevuld.");
    document.email.name.focus();
    return false;
  }
  else
  {
    if (isEmpty(document.email.email.value)) 
    {
      alert("E-mail adres is niet ingevuld.");
      document.email.mail-from.focus();
      return false;
    }
    else
    {
      if (isEmpty(document.email.remarks.value)) 
      {
        alert("Geen vraag/opmerking/etc. ingevuld.");
        document.email.remarks.focus();
        return false;
      }
      else
      {
        if (isEmpty(document.email.captcha_code.value)) 
        {
          alert("Verkeerde anti-spam code.");
          document.email.captcha_code.focus();
          return false;
        }
        else
        {
          return true;
        }
      }
    }
  }
}

function checkEmailDataCOM()
{
  if (isEmpty(document.email.name.value)) 
  {
    alert("Name not filled in.");
    document.email.name.focus();
    return false;
  }
  else
  {
    if (isEmpty(document.email.email.value)) 
    {
      alert("E-mail adress not filled in.");
      document.email.mail-from.focus();
      return false;
    }
    else
    {
      if (isEmpty(document.email.remarks.value)) 
      {
        alert("Comments/remarks not filled in.");
        document.email.remarks.focus();
        return false;
      }
      else
      {
        if (isEmpty(document.email.captcha_code.value)) 
        {
          alert("Wrong anti-spam code.");
          document.email.captcha_code.focus();
          return false;
        }
        else
        {
          return true;
        }
      }
    }
  }
}

function checkOrderDataNL()
{
  if (isEmpty(document.order.naam.value)) 
  {
    alert("Naam is niet ingevuld.");
    document.order.naam.focus();
    return false;
  }
  else
  {
    if (isEmpty(document.order.adres.value)) 
    {
      alert("Adres is niet ingevuld.");
      document.order.adres.focus();
      return false;
    }
    else
    {
      if (isEmpty(document.order.postcode.value)) 
      {
        alert("Postcode is niet ingevuld.");
        document.order.postcode.focus();
        return false;
      }
      else
      {
        if (isEmpty(document.order.plaats.value)) 
        {
          alert("Plaats is niet ingevuld.");
          document.order.plaats.focus();
          return false;
        }
        else
        {
          if (isEmpty(document.order.telefoon.value)) 
          {
            alert("Telefoon is niet ingevuld.");
            document.order.telefoon.focus();
            return false;
          }
          else
          {
            if (isEmpty(document.order.email.value)) 
            {
              alert("E-mail adres is niet ingevuld.");
              document.order.email.focus();
              return false;
            }
            else
            {
              if (isEmail(document.order.email.value))
              {
                return true;
              }
              else
              {
                alert("Ongeldig e-mail adres.");
                document.order.email.focus();
                return false;
              }
            }
          }
        }
      }
    }
  }
}

function checkOrderDataCOM()
{
  if (isEmpty(document.order.naam.value)) 
  {
    alert("Name not filled in.");
    document.order.naam.focus();
    return false;
  }
  else
  {
    if (isEmpty(document.order.adres.value)) 
    {
      alert("Address not filled in.");
      document.order.adres.focus();
      return false;
    }
    else
    {
      if (isEmpty(document.order.postcode.value)) 
      {
        alert("Zipcode not filled in.");
        document.order.postcode.focus();
        return false;
      }
      else
      {
        if (isEmpty(document.order.plaats.value)) 
        {
          alert("City not filled in.");
          document.order.plaats.focus();
          return false;
        }
        else
        {
          if (isEmpty(document.order.telefoon.value)) 
          {
            alert("Telephone not filled in.");
            document.order.telefoon.focus();
            return false;
          }
          else
          {
            if (isEmpty(document.order.email.value)) 
            {
              alert("E-mail addrees not filled in.");
              document.order.email.focus();
              return false;
            }
            else
            {
              if (isEmail(document.order.email.value))
              {
                return true;
              }
              else
              {
                alert("Wrong e-mail address.");
                document.order.email.focus();
                return false;
              }
            }
          }
        }
      }
    }
  }
}

function isEmpty(s)
{
  return ((s == null) || (s.length == 0))
}


function isEmail(s)
{
  var reEmail = /^.+\@.+\..+$/;
  return reEmail.test(s);
}

function CheckPrint()
{
  if ( checkOrderData() )
    self.print();
}

function testCookie()
{
  var today = new Date();
  var expire = new Date();
  cookieValue=Math.floor(1000*Math.random());

  expire.setTime(today.getTime() + 3600000*24);
  document.cookie = 'AreYarakCookiesEnabled'+"="+escape(cookieValue) 
                  + ";expires="+expire.toGMTString();

  var theCookie=""+document.cookie;
  var ind=theCookie.indexOf('AreYarakCookiesEnabled');
  if (ind==-1 || 'AreYarakCookiesEnabled'=="") testValue = "";
  var ind1=theCookie.indexOf(';',ind);
  if (ind1==-1) ind1=theCookie.length; 
  testValue=unescape(theCookie.substring(ind+'AreYarakCookiesEnabled'.length+1,ind1));
  if (testValue != cookieValue) alert("Cookies moeten ingeschakeld zijn om on-line te kunnen bestellen!");
}

function poppic(apic,apictitel,apicwidth,apicheight)
{
  PositionX = (screen.width/2)-(apicwidth/2);
  PositionY = (screen.height/2)-(apicheight/2);
  opties = 'scrollbars=no,width='+apicwidth+',height='+apicheight+',left='+PositionX+',top='+PositionY;

  imgWin = window.open('about:blank','',opties);
  imgWin.document.writeln('<html><head><title>'+apictitel+'</title><style>body{margin:0px;}</style>');
  imgWin.document.writeln('<sc'+'ript>function click(e){if (document.all){if (event.button == 2){alert("Copyright Yarak, alle rechten voorbehouden.");return false;}}}');
  imgWin.document.writeln('document.onmousedown=click;</sc'+'ript>');
  imgWin.document.writeln('</head><body bgcolor="#FFFFFF" scroll="no" onload="self.focus()" onblur="self.close()">');
  imgWin.document.writeln('<img name="ZS" src='+apic+' style="display:block"></body></html>');
  imgWin.document.close();		
}

function startTranslation(translateFrom,translateTo){
  jQuery('body').translate(translateFrom,translateTo, {
    not: 'select',
    start: function(){   jQuery('#loading').show() },
    complete: function(){   jQuery('#loading').hide()   },
    error: function(){   jQuery('#loading').hide()   }
  });
  jQuery.cookie("translateFrom", translateFrom);
  jQuery.cookie("translateTo", translateTo);  
}

var translateFrom = jQuery.cookie('translateFrom');
var translateTo = jQuery.cookie('translateTo');

if (translateFrom != translateTo) {
  if (translateFrom || translateTo) {
    jQuery(document).ready(function(){startTranslation( translateFrom,translateTo );});
  }
}


