
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") {
	homeon = new Image(100, 36);
	homeon.src = "pics/buttons/home_on.gif";
	abouton = new Image(100, 36);
	abouton.src = "pics/buttons/about_on.gif";
	serviceson = new Image(100, 36);
	serviceson.src = "pics/buttons/services_on.gif";
	projectson = new Image(100, 36);
	projectson.src = "pics/buttons/projects_on.gif";
	galleryon = new Image(100, 36);
	galleryon.src = "pics/buttons/gallery_on.gif";
	renovationson = new Image(100, 36);
	renovationson.src = "pics/buttons/renovations_on.gif";
	contacton = new Image(100, 36);
	contacton.src = "pics/buttons/contact_on.gif";
	employmenton = new Image(100, 36);
	employmenton.src = "pics/buttons/employment_on.gif";

	homeoff = new Image(100, 36);
	homeoff.src = "pics/buttons/home_off.gif";
	aboutoff = new Image(100, 36);
	aboutoff.src = "pics/buttons/about_off.gif";
	servicesoff = new Image(100, 36);
	servicesoff.src = "pics/buttons/services_off.gif";
	projectsoff = new Image(100, 36);
	projectsoff.src = "pics/buttons/projects_off.gif";
	galleryoff = new Image(100, 36);
	galleryoff.src = "pics/buttons/gallery_off.gif";
	renovationsoff = new Image(100, 36);
	renovationsoff.src = "pics/buttons/renovations_off.gif";
	contactoff = new Image(100, 36);
	contactoff.src = "pics/buttons/contact_off.gif";
	employmentoff = new Image(100, 36);
	employmentoff.src = "pics/buttons/employment_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 check_phone() {
  if (document.form1.Phone.value.length < 10 && document.form1.Phone.value.length > 0) {
	alert(" Please don't forget to enter your phone number area code.");
	newValue =  "(area code) " + document.form1.Phone.value;
	document.form1.Phone.value = newValue;
	document.form1.Phone.focus();
  }
}

function check_fax() {
  if (document.form1.Fax.value.length < 10 && document.form1.Fax.value.length > 0) {
	alert(" Please don't forget to enter your fax number area code.");
	newValue =  "(area code) " + document.form1.Fax.value;
	document.form1.Fax.value = newValue;
	document.form1.Fax.focus();
  }
}

function checkForm() {
  if (document.form1.email.value == "") {
	alert("Please fill in your e-mail address to proceed! ");
	return false;
  }
  else {
//	alert("Name: " + document.form1.Name.value); return false;
	document.form1.submit();
  }
}


function createWindow(target,width,height,scroll,resize) {
  targetName = target;
  if (target.indexOf('/') != -1) { targetName = targetName.substring(targetName.lastIndexOf('/')+1, length.targetName); }

  if (target.indexOf("pics") == -1) {
	target = "cgi-bin/enlarge.pl?" + target + "+" + width + "+" + height;
	newHeight = width + 20; newWidth = height + 20;
	height = newHeight; width = newWidth;
  }
  else {
	targetName = target.substring(0, target.lastIndexOf('.'));
	if (target.indexOf('/') != -1) { targetName = targetName.substring(targetName.lastIndexOf('/')+1, length.targetName); }
 }

//  alert(target + " + " + targetName + " + " + target.indexOf('/'));
  scrollbars = "no"; if (scroll == "yes") { scrollbars = "yes"; }
  resizable = "yes"; if (resize == "no") { resizable = "no"; }
  window.open(target, targetName, "toolbar=no,width=" + width + ",height=" + height + ",directories=no,location=no,status=no,scrollbars=" + scrollbars + ",resizable=" + resizable + ",menubar=no");
}

function jumpLink() {
  thisOption = document.menu.links.selectedIndex;
  if (thisOption > 0) {
	locName = document.menu.links.options[thisOption].value;
	parent.location = locName;
  }
}

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

