//*-------------------------------------------------------------------------
//* Handle setting up of the preloading button images
//* This file includes the login form validation and some other misc functions.
//*-------------------------------------------------------------------------
      
   var homepage = 0; // default to not the home page
   var homepg = 0; // This is checked in footer.js
    
// Dynamically get the file name of the displayed page.
// Hence the "file" argument is not needed.
    
	var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
//	alert(dir)
	var filenm = location.href.substring(dir.length,location.href.length+1);
	var thefile = filenm;
 	var DHTML = (document.getElementById || document.all || document.layers);
//    var urlname = "www.midrange.ca";  //* Just used to set homepage flag.
 
 	var imagedir = "../images";

if(document.images){
//	conton 		= new Image(); conton.src= imagedir + "/b-continueon.gif";
//	contoff 	= new Image(); contoff.src= imagedir + "/b-continueoff.gif"; 	
}

 
 
function NewWindow(mypage, myname, w, h, scroll)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}   

function showAddr(part1, part2){
//*******************************************************************************
//	Display mailto link, hide from spam miners.
//*******************************************************************************
//alert(part2);	
  if (part2 == undefined) part2 = "midrange.ca";	
  var addr = part1 + "@" + part2;
  var result = ("<a href='" + "mail" + "to:" + addr + "'>" + addr + "</a>")
  return result;
}