
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) version = "n3";
else version = "n2";
if (version == "n2" && browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "n3";
if (version == "n3") {
	enteron = new Image(140, 80);
	enteron.src = "pics/enter_on.gif";

	enteroff = new Image(140, 80);
	enteroff.src = "pics/enter_off.gif";
}
function img_act(imgName) {
  if (version == "n3") {
	imgOn = eval(imgName + "on.src");
	document[imgName].src = imgOn;
  }
}
function img_inact(imgName) {
  if (version == "n3") {
	imgOff = eval(imgName + "off.src");
	document[imgName].src = imgOff;
  }
}

function check_email() {
  var valid = 1;

  if (document.form1.email.value.indexOf("@") == -1) {
	valid=0; mes = ' All e-mail addresses must contain a "@"!';
  }
  if (document.form1.email.value.indexOf(" ") != -1) {
	valid=0; mes = " E-mail addresses cannot contain spaces!";
  }
  if (document.form1.email.value.length <= 6) {
	valid=0; mes = " This is too short to be a valid e-mail address!";
  }
  if (document.form1.email.value.indexOf("@.") != -1 ||  document.form1.email.value.indexOf(".@") != -1) {
	valid=0; mes = ' Dot punctuation cannot be adjacent to the "@"!';
  }

  if (valid == 0 && document.form1.email.value.length > 0) {
	alert('"' + document.form1.email.value + '"' + " is not a valid e-mail address." +  "\n" + mes + "\n" + " Please try again.");
	document.form1.email.value = "";
	document.form1.email.focus();
  }
}

function checkForm() {
  if (document.form1.Name.value == "" || document.form1.email.value == "") { alert("Please fill in your name and e-mail address to send the message. "); return false; }

  else { return true; }
}

function eventWindow() {
window.open("/feature.html","feature","toolbar=no,width=599,height=455,directories=no,location=no,status=no,scrollbars=no,resizable=no,menubar=no");
}
function friendWindow() {
window.open("../sendtofriend.html","friend","toolbar=no,width=380,height=455,directories=no,location=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function createWindow(target,width,height,scroll,resize) {
  targetName = target;
  targetName = target.substring(0, target.lastIndexOf('.'));
  if (target.indexOf('/') != -1) { targetName = targetName.substring(targetName.lastIndexOf('/')+1, length.targetName); }
  scrollbars = "no"; if (scroll == "scroll") { scrollbars = "yes"; }
  resizable = "yes"; if (resize == "noresize") { resizable = "no"; }
  if (targetName == "form1") { height -= 1; }
//  params = "toolbar=no,width=" + width + ",height=" + height + ",directories=no,location=no,status=no,scrollbars=" + scrollbars + ",resizable=" + resizable + ",menubar=no";
//  alert("x" + targetName + "x");

  window.open(target, targetName, "toolbar=no,width=" + width + ",height=" + height + ",directories=no,location=no,status=no,scrollbars=" + scrollbars + ",resizable=" + resizable + ",menubar=no");
//var popupWin = 
//  if (popupWin) { popupWin.focus(); }
}

function setCookie(product) {
  document.cookie = "Product=" + product + "; path=/";
  createWindow('../requestinfo.html',380,455);
}

function getCookie(cookieHeader) {
  var search = cookieHeader + "=", cookieString = "";
  if (document.cookie.length > 0) {
	findNameIndex = document.cookie.indexOf(search);
	if (findNameIndex != -1) {
		findNameIndex += search.length;
		endIndex = document.cookie.indexOf(";", findNameIndex);
		if (endIndex == -1) endIndex = document.cookie.length;
		cookieString = document.cookie.substring(findNameIndex, endIndex);
	}
  }
  return (cookieString);
}

function message(txt) { window.status = txt; }
function remove_message() { window.status = ""; }
