var activeSub=0;
var SubNum=0;
var loaded=0;
//*

function preloadImages() {    
  var d=document; 
	if(d.images){ 
		if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; 
		for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ 
				d.p[j]=new Image; 
				d.p[j++].src=a[i];
			}
	}
    loaded=1;
}
//*
function swapImage() {
  var i,j=0,x,a=swapImage.arguments;
    if (loaded==1) { 
	  document.sr=new Array; 
	  for(i=0;i<(a.length-2);i+=3)
        if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
}
//*
function swapImgRestore() {
  var i,x,a=document.sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}
//*
function findObj(n, d) {
  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=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); 
	return x;
}
//*
function reDo(){ window.location.reload() }
//*
//Define global variables
var timerID = null;
var timerOn = false;
var timecount = 800;
var what = null;
var newbrowser = true;
var check = false;
//*
function init(){
	if(document.all){
		//  IE
		layerRef="document.all";
		styleSwitch=".style";
		visibleVar="visible";
		screenSize = document.body.clientWidth + 18;
		what ="ie";
	}
	else if (document.layers) {
		//  Netscape 4
		layerRef="document.layers";
		styleSwitch="";
		visibleVar="show";
		screenSize = window.innerWidth;
		what ="ns4";
	}
	else if(document.getElementById){
		//  Netscape 6
		layerRef="document.getElementByID";
		styleSwitch=".style";
		visibleVar="visible";
		what="moz";
	}
	else{
		// Older than 4.0 browser
		what="none";
		newbrowser = false;
	}
	check = true;
} // init
//*
function showLayer(layerName){
	if(check && loaded == 1){
		if (what =="none"){
			return;
		}
		else if (what == "moz"){
			document.getElementById(layerName).style.visibility="visible";
		}
		else{
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
	else {
		return;
	}
} // showLayer
//*
function hideLayer(layerName){
	if(check){
		if (what =="none"){
			return;
		}
		else if (what == "moz"){
			document.getElementById(layerName).style.visibility="hidden";
		}
		else{
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
	else {// alert ("Please wait for the page to finish loading.");
		return;
	}
} // hideLayer
//*
function hideAll(){
	hideLayer('servprods');
    hideLayer('about');
    hideLayer('news');
} // hideAll
//*
function nop() {} 
//*
function startTime() {
	if (timerOn == false) {
		timerID=setTimeout( "hideAll()" , timecount);
		timerOn = true;
	}
} // startTime
//*
function stopTime() {
	if (timerOn) {
		clearTimeout(timerID);
		timerID = null;
		timerOn = false;
	}
} // stopTime
//*
function onLoad() {
	init();
} // onLoad
//*
function reDo() {
    window.location.reload();
} // reDo for NS4 resize
//*
function openWindow(myURL) {
    window.open(myURL,'_blank','height=600,width=740,title=yes,resizable=yes,scrollbars=yes');
}
function openMap(myURL) {
    window.open(myURL,'_blank','height=500,width=800,title=yes,resizable=yes,scrollbars=yes');
}
function openSector(mySector) {
    var mywin = window.open('sectors.asp?ShowLayer=' + mySector,'Sectors','height=380,width=510,title=yes,resizable=no,scrollbars=no');
    mywin.focus()
}
//title=yes,resizable=yes,scrollbars=yes

loaded=1; // Set loaded=1 now that all nav images have been removed and no longer need to be preloaded




