<!--
function PopupWindow(address, winwidth, winheight)
{
	if (window.remote!=null)
		{
		parent.remote.close()
		}
	self.name = "opener";
	remote = open(address, "remote", "width=" + winwidth + ",height=" + winheight + ",location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes,fullscreen=no");
}

function isAlphanumeric(s, valid_chars) {
  var allValid = true;
  var ch = '';
  for (i = 0;  i < s.length;  i++) {
    ch = s.charAt(i);
    for (j = 0;  j < valid_chars.length;  j++)
      if (ch == valid_chars.charAt(j))
        break;
    if (j == valid_chars.length) {
      allValid = false;
      break;
    }
  }
  return allValid;
}

function isValidEmail(s){
  // there must be >= 1 character before @, so we start looking at 
  // character position 1 (i.e. second character)
  var i = 1;
  var sLength = s.length;

  // look for @
  while ((i < sLength) && (s.charAt(i) != "@")) {
    i++
  }
  if((i >= sLength) || (s.charAt(i) != "@"))
    return false;
  else
    i += 2;

  // look for .
  while ((i < sLength) && (s.charAt(i) != ".")) {
    i++
  }
  // there must be at least one character after the .
  if ((i >= sLength - 1) || (s.charAt(i) != "."))
    return false;
  else
    return true;
}

var alphachars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒšœŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";

function ValidateNewsletterForm(form) {
  if(form.email != null) {
    str = form.email.value;
    if(!isAlphanumeric(str.toLowerCase(), 'abcdefghijklmnopqrstuvwxyz0123456789@._-')) {
      alert('Invalid character in e-mail address.');
      form.email.focus();
      return false;    
    }
    if(str == '' || !isValidEmail(str)) {
      alert('You must supply a valid e-mail address.');
      form.email.focus();
      return false;
    }
  }
  
  return true;
}

function license(url)
		{
		var agree=confirm("MetaTraffic is not freeware. By pressing OK, you agree to be bound to the terms of the license agreement.");
		
		if (agree)
			window.location=url;
		}

//-->
