/**=================================================
NAME: GLOBAL JAVASCRIPT FUNCTIONS
AUTHOR: Michael Lovitt (mlovitt@oaksanderson.com)
REVISED: 05.02.2002
=================================================**/	

function radioValue(obj) {
  var value = null;
  for(var i=0; i < obj.length; i++) {
    if(obj[i].checked) {
      value = obj[i].value;
      break;
    }
  }
  return value;
}

function rollIn(imgName,imgSpot) {
    if (document.images) {
        document[imgName + imgSpot].src = eval(imgName + "on.src");
    }
}

function rollOut(imgName) { 
    if (document.images) {
        document[imgName].src = eval(imgName + "off.src");
    }
}

function openDialogWindow (strFile,intWidth,intHeight,strName,strScroll) {
	var strOptions = 'width=' + intWidth + ',height=' + intHeight + ',location=0,scrollbars=' + strScroll + ',left=50,top=50';
	objWin = window.open(strFile,strName,strOptions);	
	//if (objWin.opener == null) objWin.opener = self;
}


function switchTask (strImage,strImageName,strSwitchType) {
	if (strSwitchType == 'on') {
		if (document.images) {
				document[strImageName].src = eval(strImage + "on.src");
		}
	}
	
	if (strSwitchType == 'off') {
		if (document.images) {
				document[strImageName].src = eval(strImage + "off.src");
		}
	}
}

function boxClick(strFieldName, objThisField) {
	var objField = document.forms["createreport"].elements[strFieldName];
	if (objThisField.checked && !objField.checked) {
		objField.click();
	}	
}

function radioSet(strFieldName, strFieldValue, objThisField) {
	var arrField = document.forms["createreport"].elements[strFieldName];
	if (objThisField.checked) {
		for (i = 0; i < arrField.length; ++i) {
			if (arrField[i].value == strFieldValue) 
				arrField[i].click();
		}
	}
}

/* 
Made by Martial Boissonneault © 2002 http://getElementById.com/
May be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

function show(id){
// Netscape 4
if(ns4){
document.layers[id].visibility = "show";
}
// Explorer 4
else if(ie4){
document.all[id].style.visibility = "visible";
}
// W3C - Explorer 5+ and Netscape 6+
else if(ie5 || ns6){
document.getElementById(id).style.visibility = "visible";
}
}

function hide(id){
// Netscape 4
if(ns4){
document.layers[id].visibility = "hide";
}
// Explorer 4
else if(ie4){
document.all[id].style.visibility = "hidden";
}
// W3C - Explorer 5+ and Netscape 6+
else if(ie5 || ns6){
document.getElementById(id).style.visibility = "hidden";
}
}

function display_show(id){
// Netscape 4
if(ns4){
document.layers[id].visibility = "show";
}
// Explorer 4
else if(ie4){
document.all[id].style.display = "block";
}
// W3C - Explorer 5+ and Netscape 6+
else if(ie5 || ns6){
document.getElementById(id).style.display = "block";
}
}

function display_hide(id){
// Netscape 4
if(ns4){
document.layers[id].visibility = "hide";
}
// Explorer 4
else if(ie4){
document.all[id].style.display = "none";
}
// W3C - Explorer 5+ and Netscape 6+
else if(ie5 || ns6){
document.getElementById(id).style.display = "none";
}
}
