var currentlyActiveInputRef = false;
var currentlyActiveInputClassName = false;

function highlightActiveInput(){
	if(currentlyActiveInputRef){
		currentlyActiveInputRef.className = currentlyActiveInputClassName;
	}
	currentlyActiveInputClassName = this.className;
	this.className = currentlyActiveInputClassName+'_highlighted';
	currentlyActiveInputRef = this;
}

function blurActiveInput(){
	this.className = currentlyActiveInputClassName;
}


function initInputHighlightScript(){
	var tags = ['INPUT'];

	for(tagCounter=0;tagCounter<tags.length;tagCounter++){
		var inputs = document.getElementsByTagName(tags[tagCounter]);
		for(var no=0;no<inputs.length;no++){
			if(inputs[no].className && inputs[no].className=='doNotHighlightThisInput'){
              continue;
            }
			if(inputs[no].tagName.toLowerCase()=='input' && (inputs[no].type.toLowerCase()=='text'||inputs[no].type.toLowerCase()=='password')){
				inputs[no].onfocus = highlightActiveInput;
				inputs[no].onblur = blurActiveInput;
			}
		}
	}
}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function OpenMaxWindow(URL) {
	var theParams=window.location.search;
	var wf = "";
	wf = wf + "width=" + screen.availWidth;
	wf = wf + ",height=" + screen.availHeight;
	wf = wf + ",top=" + screen.availTop;
	wf = wf + ",left=" + screen.availLeft;
	wf = wf + ",resizable=" + 1;
	wf = wf + ",scrollbars=" + 0;
	wf = wf + ",menubar=" + 0;
	wf = wf + ",toolbar=" + 0;
	wf = wf + ",directories=" + 0;
	wf = wf + ",location=" + 0;
	wf = wf + ",status=" + 0;
	wf = wf + ",channelmode=" + 1;
	if(theParams!=""){
		window.open(URL+theParams,"",wf);
	}
	else{
		window.open(URL,"",wf);
	}
}
