function switchdiv(div_1, div_2)
{
	if (document.getElementById)	{
	    if(!document.getElementById(div_1)) return ;
	    if(!(document.getElementById(div_1).style)) return ;
	    if(!(document.getElementById(div_1).style.display)) return ;

		var state_1 = document.getElementById(div_1).style.display;
		if(state_1=="none") {
        		document.getElementById(div_1).style.display="block";
        		document.getElementById(div_2).style.display="none";
	     }
	    if(state_1=="block") {
        		document.getElementById(div_2).style.display="block";
        		document.getElementById(div_1).style.display="none";
	     }
	}
	else if (document.all)	{
	    if(!document.all[div_1]) return ;
	    if(!(document.all[div_1].style)) return ;
	    if(!(document.all[div_1].style.display)) return ;

		var state_1 = document.all[div_1].style.display;
		if(state_1=="none") {
		        document.all[div_1].style.display = "block";
		        document.all[div_2].style.display = "none";
		}
		if(state_1=="block") {
        		document.getElementById(div_1).style.display="none";
        		document.getElementById(div_2).style.display="block";
	     }
    }
}

function showhide(div)
{
	state = document.getElementById(div).style.display;
	obj = document.getElementById(div);
	
	if(state == "none") { obj.style.display="block";}
	else { obj.style.display = "none";}
	obj.style.visibility = 'visible';
}

function LightItemOn(n,col)
{
  document.getElementById("listItem_"+n).style.backgroundColor = col;
  
  document.getElementById("r1t_"+n).style.backgroundColor = col;
  document.getElementById("r2t_"+n).style.backgroundColor = col;
  document.getElementById("r3t_"+n).style.backgroundColor = col;
  document.getElementById("r4t_"+n).style.backgroundColor = col;
  
  document.getElementById("r1b_"+n).style.backgroundColor = col;
  document.getElementById("r2b_"+n).style.backgroundColor = col;
  document.getElementById("r3b_"+n).style.backgroundColor = col;
  document.getElementById("r4b_"+n).style.backgroundColor = col;
}

function LightItemOff(n,col)
{
  document.getElementById("listItem_"+n).style.backgroundColor = col;
  
  document.getElementById("r1t_"+n).style.backgroundColor = col;
  document.getElementById("r2t_"+n).style.backgroundColor = col;
  document.getElementById("r3t_"+n).style.backgroundColor = col;
  document.getElementById("r4t_"+n).style.backgroundColor = col;
  
  document.getElementById("r1b_"+n).style.backgroundColor = col;
  document.getElementById("r2b_"+n).style.backgroundColor = col;
  document.getElementById("r3b_"+n).style.backgroundColor = col;
  document.getElementById("r4b_"+n).style.backgroundColor = col;
}

function infoBoxOn(elid)
{
  document.getElementById(elid).style.display = "block";
}

function infoBoxOff(elid)
{
  document.getElementById(elid).style.display = "none";
}

function popUp(URL)
{
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width="+screen.width+",height="+screen.height+",left = 0,top = 0');");
}

function prepareInputsForHints_()
{
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			}
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";
			}
		}
	}
	// repeat the same tests as above for selects
	var selects = document.getElementsByTagName("select");
	for (var k=0; k<selects.length; k++){
		if (selects[k].parentNode.getElementsByTagName("span")[0]) {
			selects[k].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			}
			selects[k].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";
			}
		}
	}
}