function 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=400,height=200,scrollbars=no');
window.open(href, windowname, 'width=500,height=200,scrollbars=yes,statusbar=no');
return false;
}

function checkFields(contact_form)
{

  if (contact_form.name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    contact_form.name.focus();
    return (false);
  }

  if (contact_form.name.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Name\" field.");
    contact_form.name.focus();
    return (false);
  }

  if (contact_form.name.value.length > 40)
  {
    alert("Please enter at most 40 characters in the \"Name\" field.");
    contact_form.name.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = contact_form.name.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and whitespace characters in the \"Name\" field.");
    contact_form.name.focus();
    return (false);
  }

  if (contact_form.email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    contact_form.email.focus();
    return (false);
  }

  if (contact_form.email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email\" field.");
    contact_form.email.focus();
    return (false);
  }

//  if (contact_form.phone.value == "")
//  {
//    alert("Please enter a value for the \"Phone\" field.");
//    contact_form.phone.focus();
//    return (false);
//  }
if (contact_form.phone.value.length > 0) { 
  if (contact_form.phone.value.length < 10)
  {
    alert("Please enter at least 10 characters in the \"Phone\" field.");
    contact_form.phone.focus();
    return (false);
  }
}
  if (contact_form.phone.value.length > 15)
  {
    alert("Please enter at most 15 characters in the \"Phone\" field.");
    contact_form.phone.focus();
    return (false);
  }

  var checkOK = "0123456789--,/";
  var checkStr = contact_form.phone.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit and \"-,/\" characters in the \"Phone\" field.");
    contact_form.phone.focus();
    return (false);
  }
  
  return (true);
}
