// JavaScript Document
<!--
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();
}

function userPrefs(){
	toggleBackground();
}

function bgFadeLevel(fadeLevel){
	var bgFiles = new Array(5);
	bgFiles[0]="none";
	bgFiles[1]="url(backgrounds/bgFadeLevel1.jpg)";
	bgFiles[2]="url(backgrounds/bgFadeLevel2.jpg)";
	bgFiles[3]="url(backgrounds/bgFadeLevel3.jpg)";
	bgFiles[4]="url(backgrounds/bgFadeLevel4.jpg)";
	document.getElementById("thisBody").style.backgroundImage=bgFiles[fadeLevel];
	for (i=0;i<=4;i++){
		setColor="white";
		if (i==fadeLevel){
			setColor="black";
		}
		document.getElementById("controlFade").getElementsByTagName("td")
		[i].style.backgroundColor=setColor;	

	}
}

function bgPanelDisplay(fadeLevel,newStatus){
	var bgPanels = new Array(5);
	bgPanels[0]="none";
	bgPanels[1]="url(backgrounds/panelFadeLevel1.jpg)";
	bgPanels[2]="url(backgrounds/panelFadeLevel2.jpg)";
	bgPanels[3]="url(backgrounds/panelFadeLevel3.jpg)";
	bgPanels[4]="url(backgrounds/panelFadeLevel4.jpg)";
	if  (newStatus=="on"){
		document.getElementById("panelControl").style.backgroundImage=bgPanels[fadeLevel];
	}
	else{
		document.getElementById("panelControl").style.backgroundImage="none";
	}
	
}

function toggleBackground(){
	if (document.getElementById("thisBody").style.backgroundImage=="none"){
		document.getElementById("thisBody").style.backgroundImage="url(backgrounds/logoWide6.jpg)";
	}
	else {
		document.getElementById("thisBody").style.backgroundImage="none";
	}
}

function highlightMenuCell(refCell){
	//refCell.style.backgroundColor="#CC3333";
	//scheme 1: refCell.style.backgroundColor="#FFCCCC";
	refCell.style.backgroundColor="#0099FF"; //"#CC0000"; //"#669966";
	refCell.style.borderBottomColor="gold";
	refCell.style.borderRightColor="gold";
	refCell.style.color="#990000";
	refCell.firstChild.style.color="#990000";
	refCell.style.textDecoration="underline";
	refCell.firstChild.style.textDecoration="underline";
	refCell.style.cursor="hand";
		}
function normaliseMenuCell(refCell){
	//scheme 1: refCell.style.backgroundColor="#99CCCC";
	refCell.style.backgroundColor="#CCCCCC"; //"#CCCC99";
	refCell.style.borderBottomColor="#CC0000";
	refCell.style.borderRightColor="#CC0000";
	refCell.style.color="#336666";
	refCell.firstChild.style.color="#336666";
	refCell.style.textDecoration="none";
	refCell.firstChild.style.textDecoration="none";
	refCell.style.cursor="default";
	}
	
function toggleCursor(refElem, cursorStyle){
	if (cursorStyle == 'hand'){
		refElem.style.cursor="hand";
		}
	else{
		refElem.style.cursor="default";
	}
}
	
function transContrast(refElem,direction){
	//alert(direction);
	if (direction == 'more'){		
		refElem.style.backgroundColor="white";
	}
	else{
		refElem.style.backgroundColor="transparent";
	}
}

function toggleControl(bar){

	if (bar.parentNode.style.visibility=="hidden"){
		bar.parentNode.style.visibility="visible";
		//symbol = "&gt;";
		//bar.firstChild.src = "icons/arrowR.gif";
		
		document.iconControlBar.src = "icons/arrowR2.gif"
		
	}
	else{
		bar.parentNode.style.visibility="hidden";
		bar.style.visibility="visible";
		//symbol = "&lt;";
		//bar.firstChild.src = "icons/arrowL.gif";
		document.iconControlBar.src = "icons/arrowL2.gif"		
	}
	//newSymbol = document.createTextNode(symbol);
	//oldSymbol = bar.firstChild;
	//removedSymbol = bar.replaceChild(newSymbol,oldSymbol);	
}

function init(){
	//document.getElementById("panelControl").style.visibility="visible";
	//screenSize();
	displayToday();
}

function screenSize(){
//alert("in");
	var width = 0;
	var large = 829;
	if (window.innerWidth) { // browser supports innerWidth
	 width = window.innerWidth;
	}
	else if (document.all) { // supports document.all (IE 4+)
	 width = document.body.clientWidth;
	}
	 
	if (width >= large) {
			document.getElementById("screenSizeImage").src="screenWide.gif"
	}
	else{
		document.getElementById("screenSizeImage").src="screenMedium.gif"
	}
}

function displayToday(){
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)    
year = year + 1900; 
var insertText=lmonth + " " + date + ", " + year;
var newNode = document.createTextNode(insertText);
document.getElementById("displayToday").appendChild(newNode);
//end function displayToday
}


//Fireworks generated
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/****************************************************
 AntiSpambotMailto() - Documentation and encoder at:
    http://www.kenric.com/AntiSpambotMailto.html
****************************************************/
function AntiSpambotMailto(codelist, description, atagattr) {
	var thiscode, thischar;
	var CodeString = new String(codelist);
	var CodedArray = CodeString.split('|');
	var L = CodedArray.length;
	var AddrDecoded = "";
	for (var x=0; x < L; x++) {
		thiscode = CodedArray[x];
		thischar = String.fromCharCode( thiscode - L );
		AddrDecoded += thischar;
	}
	atagattr = atagattr ? ' ' + atagattr : '';
	if (!description) description = AddrDecoded; // if no description supplied, display email address
	var strOutput = '<a href="mailto:'+AddrDecoded+'"' + atagattr+'>' + description + '</a>';
	document.write(strOutput);
}
/***************************************************************************
Copyright (c) 2002 by Kenric L. Ashe - www.kenric.com - All rights reserved.

Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, 
this list of conditions and the following disclaimer. 

Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following disclaimer in the documentation 
and/or other materials provided with the distribution. 

Neither the name of the Kenric.com nor the names of its contributors may 
be used to endorse or promote products derived from this software without 
specific prior written permission. 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
//-->