
imgArray = new Array(           // The images to load are defined here
			'/favicon.ico',
			'/images/clearicon.gif',
			'/images/editicon.gif',
			'/images/icons/send_icon.gif',
			'/images/logo.gif',
			'/images/logo_main.gif',
			'/images/star.gif',
			'/images/ostar.gif',
			'/images/left-arrow.gif',
			'/images/right-arrow.gif',
			'/images/arrow_blue.gif',
			'/images/arrow_green.gif',
			'/images/msn_home/close_up.gif',
			'/images/msn_home/close_ovr.gif',
			'/images/msn_home/res_up.gif',
			'/images/msn_home/res_ovr.gif',
			'/images/msn_home/colapse.gif',
			'/images/msn_home/expand.gif',
			'/images/msn_home/expand_option.gif',
			'/images/msn_home/colapse_option.gif',
			'/images/msn_home/online.gif',
			'/images/msn_home/offline.gif',
			'/images/msn_home/busy.gif',
			'/images/msn_home/away.gif',
			'/images/trans.gif'
			);

imgObjArray = new Array ();

// PRELOAD IMAGES
function preload() {
    for (counter in imgArray) {
        imgObjArray[counter] = new Image();
        imgObjArray[counter].src = imgArray[counter];
    }
}
// CALL THE PRELOAD BEFORE PAGE LOADS
preload();

nn = (document.layers) ? 1:0
ie = (document.all) ? 1:0

function showlayer(object)
	{
	if (nn)
		document.layers[object].visibility = 'show';
	else if (ie)
		document.all[object].style.visibility = 'visible';
	}

function hidelayer(object)
	{
	if (nn)
		document.layers[object].visibility = 'hide';
	else if (ie)
		document.all[object].style.visibility = 'hidden';
	}

function Go(frmObj) {
	frmObj.submit()
	return true;
}

// RIGHT NAV HIGHLIGHT
function HL(element, on) 
{
	if (!on) { 
		element.style.backgroundColor = '#EEEEEE';
		element.style.color = '#000000';
		element.style.borderColor = '#EEEEEE';
		window.status='';
		return true;		
	} else { 
		element.style.backgroundColor = '#cccccc';
		element.style.color = '#000000';
		element.style.borderColor  = '#999999';
		window.status='Main Menu';
		return true;
		//0B79A2
	}
	//67B3CF
	return false;
}

function isChecked(docObj,frmObj) {
	with (docObj) {
		if (frmObj.checked) {
			frmObj.checked=false;
		} 
		else {
			frmObj.checked=true
		}
	}	
}

//configure the two variables below to match yoursite's own info
var bookmarkurl="http://www.ActiveServerPages.ca/"
var bookmarktitle="ActiveServerPages.ca"

function addBookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function validEmail(name) {
	if (name=="")
		return false;
	
	var badchars="<> ;,'!#$%^&*()+=";
	for (var i=0; i < name.length; i++) {
		temp = "" +name.substring(i, i+1);
		if (badchars.indexOf(temp) != -1) {
			return false;
		}
	}
	var arr;
	arr = name.split('@');

	// check for 1 and only 1 @ sign
	if (arr.length != 2)
		return false;
		
	// check for blank before or after @
	if ((arr[0] == "") || (arr[1] == ""))
		return false;
		
	// check for dot at first or last position
	if ((arr[1].charAt(0) == '.') || (arr[1].charAt(arr[1].length-1) == '.'))
			return false;
			
	if ((arr[0].charAt(0) == '.') || (arr[0].charAt(arr[0].length-1) == '.'))
			return false;
			
	// check to make sure top level domain > 1 char					
	if ((arr[1].indexOf('.') > arr[1].length-3) || (arr[1].indexOf('.') == -1))
			return false;
		
	// check for ..
	if (name.indexOf("..") > 0)
		return false;

	return true;
}

var pos = 0;
function findit() {
    if (document.frmFind.mytext.value == '') {
        alert('Nothing to search for');
        return;
    }
    if (document.all) {
        var found = false;
        var text = document.body.createTextRange();
        for (var i=0; i<=pos && (found=text.findText(document.frmFind.mytext.value)) != false; i++) {
            text.moveStart("character", 1);
            text.moveEnd("textedit");
        }
        if (found) {
            text.moveStart("character", -1);
            text.findText(document.frmFind.mytext.value);
            text.select();
            text.scrollIntoView();
            pos++;
        }
        else {
            if (pos == '0')
                alert('"' + document.frmFind.mytext.value +'" was not found on this page.');
            else
                alert('No further occurences of "' + document.frmFind.mytext.value +'" were found.');
            pos=0;
        }
    }
    else if (document.layers) {
        find(document.frmFind.mytext.value,false);
    }
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function ShowMessenger() {
	if (messengerUI.object != null) {
	var MsgrWindow
	if (messengerUI.myStatus == 2) {
		MsgrWindow = messengerUI.window;
		MsgrWindow.show();
	}
	else
		messengerUI.Signin(0,"",""); 
	}
}

function ShowElement(element) {
    element.style.display="";
    document.msn.offline.value="ON";
}
function HideElement(element) {
    //rowShow.style.visibility="hidden";
    element.style.display="none";
    document.msn.offline.value="OFF";
}


//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
if (ie5)
document.getElementById("saver").style.display=''

tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.onmousemove=drag_drop
}

function loadwindow(url,width,height){
if (!ie5&&!ns6)
window.open(url,"","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.width=initialwidth=width
document.getElementById("dwindow").style.height=initialheight=height
document.getElementById("dwindow").style.left=30
document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30 : document.body.scrollTop*1+30
document.getElementById("cframe").src=url
}
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","/images/msn_home/res_up.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20 : document.body.clientWidth
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20 : document.body.clientHeight
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","/images/msn_home/res_up.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight

}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset : document.body.scrollLeft
document.getElementById("dwindow").style.top=ns6? window.pageYOffset : document.body.scrollTop
}

function closeit(){
document.getElementById("dwindow").style.display="none"
}

if (ie5||ns6)
document.onmouseup=new Function("dragapproved=false;document.onmousemove=null;document.getElementById('saver').style.display='none'")



/*
function ShowHide(element) {
	if (document.msn.offline.value=="ON") {
		HideElement(element);
	}
	else {
		ShowElement(element);
	}
	
}
*/

/* 2009.05.18 add by CharlesC */
function WindowsOpen(loc)
{
 window.open(loc,"SFX","height=600,width=500,location=no,menubar=no,status,scrollbars,resizable");
}
