var AgntUsr=navigator.userAgent.toLowerCase();
var AppVer=navigator.appVersion.toLowerCase();
var DomYes=document.getElementById?1:0;
var NavYes=AgntUsr.indexOf("mozilla")!=-1&&AgntUsr.indexOf("compatible")==-1?1:0;
var ExpYes=AgntUsr.indexOf("msie")!=-1?1:0;
var ExpVer7=AgntUsr.indexOf("msie 7")!=-1?1:0;
var ExpVer8=AgntUsr.indexOf("msie 8")!=-1?1:0;
var Opr=AgntUsr.indexOf("opera")!=-1?1:0;
if(Opr){
	NavYes=1;
	ExpYes=0;
}
var DomNav=DomYes&&NavYes?1:0;
var DomExp=DomYes&&ExpYes?1:0;
if (NavYes&&!DomYes&&document.layers || ExpYes&&!DomYes&&document.all) alert("We are sorry, but this web site is only available to users of modern web browsers such as Microsoft Internet Explorer v5.5+, Netscape v6+, Mozilla v1.5+, Firefox v1.0+, Opera v6+, and Safari v1.3+, and Camino 0.8.3+.  Please try again using another web browser.");
if (AppVer.indexOf("msie 5.0")!=-1) window.status="Warning! - Some aspects of this website may not work in your browser";
var offSetLeft=0;
var offSetTop=0;
var topBoundary=0;
var leftBoundary=0;
var rightBoundary=0;
var bottomBoundary=0;
var scnHeight=0;
var scnWidth=0;
var divList = new Array(0);
var targetAction = new Object;
var sgTargetAction = new Object;
var activeMouseCount=-1;
var scrollBarsActive = false;
var fdShowRolloversFlag = 0;
var navPX = NavYes ? "px":"";
var EOL="\n";

function findObj(name){
	return document.getElementById(name);
}

function getScreen(){
 if (DomNav){
  scnHeight = window.innerHeight;
  scnWidth = window.innerWidth;
 } else {
  scnHeight=document.documentElement.clientHeight;
  scnWidth=document.documentElement.clientWidth;
 }
}

function setPosition(){
 if (useCentering == 0) return;
 getScreen();
 if (useCentering ==1 || useCentering == 2){
 	offSetLeft=Math.ceil((scnWidth-pageWidth)/2);
 	if (offSetLeft<0) offSetLeft=0;
 	rightBoundary=offSetLeft+pageWidth;
 } else {
 	offSetLeft=0;
 	rightBoundary=scnWidth;
 }
 if (useCentering ==1 || useCentering == 3){
 	offSetTop=Math.ceil((scnHeight-pageHeight)/2);
  if (offSetTop<0) offSetTop=0;
  bottomBoundary=offSetTop+pageHeight;
 } else {
	offSetTop=0;
	bottomBoundary=scnHeight;
 }
}

function rePosition(){
 if (DomExp){
  divList = document.all.tags('div');
 }else{
  divList = document.getElementsByTagName('div');
 }
 getScreen();
 if (useCentering ==1 || useCentering == 2){
  newOffSetLeft=Math.ceil((scnWidth-pageWidth)/2);
 	if (newOffSetLeft<0) newOffSetLeft=0;
 	rightBoundary=newOffSetLeft+pageWidth;
	} else {
		newOffSetLeft=0;
		rightBoundary=scnWidth;
 }
	if (useCentering ==1 || useCentering == 3){
		newOffSetTop=Math.ceil((scnHeight-pageHeight)/2);
 	if (newOffSetTop<0) newOffSetTop=0;
 	bottomBoundary=newOffSetTop+pageHeight;
	} else {
		newOffSetTop=0;
		bottomBoundary=scnHeight;
 }
 diffSetLeft=newOffSetLeft-offSetLeft;
	diffSetTop=newOffSetTop-offSetTop;
 for (i=0;i<divList.length;i++){
		itmName=divList[i].id;
  if (itmName != ""){
		 itm = findObj(itmName);
 		if (DomExp){
		  newTop=itm.style.pixelTop + diffSetTop;
	  	itm.style.pixelTop = newTop;
	 		if (itmName.indexOf("fpDiv_")==-1){
	 		 newLeft=itm.style.pixelLeft + diffSetLeft;
	 	 	itm.style.pixelLeft = newLeft;
	 		}
		 } else {
	   newTop=parseInt(itm.style.top,10) + diffSetTop;
	  	itm.style.top = newTop+"px";
	 		if (itmName.indexOf("fpDiv_")==-1){
		 	 newLeft=parseInt(itm.style.left,10) + diffSetLeft;
	   	itm.style.left = newLeft+"px";
	 		}
	  }
	  if (itm.hasScroller) scrollerReposition(itmName.substring(3),newOffSetTop);
 	}
	}
 offSetLeft=newOffSetLeft;
 offSetTop=newOffSetTop;
 if (loadNavigationScript == 1) RePos();
 if (activeMouseCount>-1) resetRegisterObjectTracking();
}

function urlReplace(newURL){
 document.location=newURL;
}
function loadURL(targetScript,targetParameters, targetType, targetWindow){
 if (targetType == 0){
	 urlReplace(targetScript);
 } else if (targetType ==1){
  newWin = window.open(targetScript, targetWindow, targetParameters);
 }
 return false;
}

function loadPage(targetPageNumber,SSL){
	if (SSL == 1){
 		newURL = sslSiteReference + '?dpl=' + targetPageNumber;
	} else {
		newURL = siteReference + '?dpl=' + targetPageNumber;
	}
	urlReplace(newIRL);
 }

function runJavaScript(targetScript){
 eval(targetScript);
}

function swapImage(imageID) {
 if (fdShowRolloversFlag == 0){
 	return false;
 } else {
 	if ((x=findObj(imageID))!=null){
  	if (!x.oSrc) {
    	x.oSrc=x.src;
    	tmp=swpImg[imageID];
  	} else {
  		tmp=x.oSrc;
  		x.oSrc=x.src;
  	}
  	x.src=tmp;
 	}
 }
}

function submitITSearch(opt,optForm){
	if ((x=findObj('submitTypeSearch'))!=null) x.value=opt;
	if ((x=findObj(optForm))!=null) x.submit();
}

function submitIT(opt,optForm){
	if ((x=findObj('submitType'))!=null) x.value=opt;
	if ((x=findObj(optForm))!=null) x.submit();
}

function resetIT(optForm){
	if ((x=findObj(optForm))!=null) x.reset();
}

function submitITEditor(opt,optForm){
	if ((x=findObj('submitType'))!=null) x.value=opt;
	if ((x=findObj(optForm))!=null){
		x.onsubmit();
		x.submit();
	}
}

function setFieldFocus(fieldName){
	if ((x=findObj(fieldName))!=null){
		x.focus();
		x.select();
	}
}

function getPage(){
 submitIT('getPage','pageManager');
}

function swapColour(objectID, menuLevel) {
 if ((x=findObj(objectID))!=null){
  if (!x.oColour) {
   x.oColour=x.style.backgroundColor;
   tmp=swpMenuColour[menuLevel];
  } else {
   tmp=x.oColour;
   x.oColour=x.style.backgroundColor;
  }
  x.style.backgroundColor=tmp;
 }
}

function Dummy(){return;}

function positioning(){
// Dummy();
 if (loadNavigationScript == 1) makeMenu();
 Trigger.onresize=reDrawScreen;
}

function reDrawScreen(){
 rePosition();
 if (loadNavigationScript == 1) RePos;
}

function toggleBlock(blockID,displayState){
 if ((x=findObj(blockID))!=null){
  listElementStyle=x.style;
  listElementStyle.display=displayState;
 }
}
function toggleVisibility(blockID,displayState){
 if ((x=findObj(blockID))!=null){
  listElementStyle=x.style;
  listElementStyle.visibility=displayState;
 }
}

function checkHeight(container,minHeight){
	if ((x=findObj(container))!=null){
		divHeight=x.offsetHeight;
		if (divHeight<minHeight) x.style.height=minHeight+'px';
	}
}

function adjustHeight(sourceContainer,targetContainer){
	if ((x=findObj(sourceContainer))!=null){
		divHeight=x.offsetHeight;
		if ((y=findObj(targetContainer))!=null){
			y.style.height=divHeight+'px';
		}
	}
}

function adjustTop(sourceContainer,targetContainer, topMargin){
	if ((x=findObj(sourceContainer))!=null){
		zz1=x.style.height;
		if (zz1=='auto'){
			divHeight=x.offsetHeight;
		} else {
			divHeight=zz1.substring(0,zz1.indexOf('px'));
		}
		zz2=x.style.top;
		divTop=zz2.substring(0,zz2.indexOf('px'));
		newTop=Number(divTop)+Number(divHeight)+Number(topMargin);
		toggleBlock(targetContainer,'none');
		if ((y=findObj(targetContainer))!=null){
			if (DomExp){
				zz3=y.style.height;
				if (zz3=='auto'){
					yHeight=y.offsetHeight;
				} else {
					yHeight=zz3.substring(0,zz3.indexOf('px'));
				}
				newBottom=Number(newTop)+Number(yHeight);
				if (document.body.style.height<newBottom)	document.body.style.height=newBottom;
				y.runtimeStyle.top=newTop;
			} else {
				y.style.top=newTop+"px";
			}
		}
		toggleBlock(targetContainer,'block');
		toggleVisibility(targetContainer,'visible');
	}
}

function pictureFullScreen(picURL,picTitle,picWidth,picHeight){
	indexDisplayOptions="toolbars=no,titlebar=no,width=" + picWidth + "px,height=" + picHeight + "px";
	fullSizeWin=window.open("","",indexDisplayOptions);
	fullSizeWin.document.write("<html><head><title></title></head><body style='margin:0px;padding:0px;'>");
	fullSizeWin.document.write('<img width="' + picWidth + 'px",height="' + picHeight + 'px" src="'+picURL+'" alt="'+picTitle+'">');
	fullSizeWin.document.write("</body></html>");
	fullSizeWin.focus();
}

document.onmousemove = mouseMoveCheck;
document.onmouseout = mouseOutCheck;
document.onmouseup = mouseUpCheck;
function mouseMoveCheck(e){
	if (scrollThumbFlag && scrollBarsActive){
		scrThumbMove(e);
	} else if (mousePositionTracking && mousePositionFlag){
		trackMouse(e);
	}
}

function mouseOutCheck(e){
	if (mousePositionTracking && mousePositionFlag){
		trackMouseOut(e);
	}
}

function mouseUpCheck(e){
	if (scrollThumbFlag && scrollBarsActive){
		scrThumbUp(e);
	}
}

function resetWindowSize(wdt,hgt){
 if (window.innerWidth){
  frameWidth = window.innerWidth;
  frameHeight = window.innerHeight;
 } else if (document.documentElement && document.documentElement.clientWidth) {
  frameWidth = document.documentElement.clientWidth;
  frameHeight = document.documentElement.clientHeight;
 } else if (document.body) {
  frameWidth = document.body.clientWidth;
  frameHeight = document.body.clientHeight;
 } else {
  return;
 }
 newWidth = (wdt-frameWidth);
 newHeight = (hgt-frameHeight);
 window.resizeBy(newWidth,newHeight);
}

var rowHLU = "#FFFFFF";
var rowHLS = "#E0E0E0";
function rowHigh(row,cols,rowHLS){
	for (j = 0; j <= cols; j++){
		row.cells[j].style.backgroundColor=rowHLS;
	}
}
function rowLow(row,cols,rowHLU){
	for (j = 0; j <= cols; j++){
		row.cells[j].style.backgroundColor=rowHLU;
	}
}
function hideFrame(frm){
	if ((x=findObj("frm_"+frm)) != null){
		x.style.display = "none";
	}
}
function showFrame(frm){
	if ((x=findObj("frm_"+frm)) != null){
		x.style.display = "block";
	}
}
