// JavaScript Document

var CMisDHTML = 0;
var CMisLayers = 0;
var CMisALL = 0;
var CMisID = 0;

if (document.getElementById) { CMisID = 1; CMisDHTML = 1; }
else {
	if (document.all) { CMisALL = 1; CMisDHTML = 1; }
	else {
		browserVersion = parseInt(navigator.appVersion);
	if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) { CMisLayers = 1; CMisDHTML = 1;}
	}
}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (CMisID) { return (document.getElementById(objectID).style); }
		else {
			if (CMisALL) { return (document.all[objectID].style); }
		else {
			if (CMisLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (CMisID) { return (document.getElementById(objectID)); }
		else {
			if (CMisALL) { return (document.all[objectID]); }
		else {
			if (CMisLayers) { return (document.layers[objectID]); }
		};}
	}
	return false;
} // end of function

function autoFocus() {
	var dom = findDOM('autoFocus','0')
	dom.focus();
} // end of function

function vis(objectID,state) {
	var domStyle = findDOM(objectID,1);
	if (state=='none'||state=='block') domStyle.display = state;
	else if (state=='hidden'||state=='visible') domStyle.visibility = state;
} // end of function

function visSwitch(objectID,switchID,switchOptions) {
	var domStyle = findDOM(objectID,1);
	var switchButton = findDOM(switchID,0);
	var optionsArray = new Array();
	optionsArray = switchOptions.split('|');
	
		if(optionsArray[2]) {
			
			if (domStyle.visibility == 'visible') {
				var state = 'hidden';
				var buttonState = optionsArray[0];
			} else {
				var state = 'visible';
				var buttonState = optionsArray[1];
			} // end if
	
		} else {
			
			if (domStyle.display == 'block') {
				var state = 'none';
				var buttonState = optionsArray[0];
			} else {
				var state = 'block';
				var buttonState = optionsArray[1];
			} // end if
		} // end if
		
		vis(objectID,state);
		switchButton.innerHTML = buttonState;
} // end of function

