<!--
// Browser sniffer
var ns4 = (document.layers); 
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);
var ie = document.all;

// Attaches objects dependent on browser
function object_attach(id)
{
	var obj;
	if(ns4) obj = document.layers[id];
	else if(ie4) obj = document.all[id];
	else if(ie5 || ns6) obj = document.getElementById(id);
	return obj;
}
// Shows/hides div objects
function div_switch(id, bShow, bBlock)
{
	temp_Obj = object_attach(id);
	if(ns4)
	{
		if(bShow==true)
		{ 
			temp_Obj.display = "block";
			temp_Obj.visibility = "show";
		}
		else
		{ 
			temp_Obj.display = "none";
			temp_Obj.visibility = "hide";
		}
	}
	else
	{
		if(bShow==true)
		{ 
			temp_Obj.style.display = "block";
			temp_Obj.style.visibility = "visible";
		}
		else
		{ 
			temp_Obj.style.display = "none";
			temp_Obj.style.visibility = "hidden";
		}
	}
}
/*function div_switch(id, bShow, bBlock)
{
	temp_Obj = object_attach(id);
	if(ns4)
	{
		if(bShow==true)
		{ if(bBlock==true) { temp_Obj.display = "block"; } else { temp_Obj.visibility = "show"; } }
		else
		{ if(bBlock==true) { temp_Obj.display = "none"; } else { temp_Obj.visibility = "hide"; } }
	}
	else
	{
		if(bShow==true)
		{ if(bBlock==true) { temp_Obj.style.display = "block"; } else { temp_Obj.style.visibility = "visible"; } }
		else
		{ if(bBlock==true) { temp_Obj.style.display = "none"; } else { temp_Obj.style.visibility = "hidden"; } }
	}
}*/
// Clears a text field only if the value matches what is passed in
function clearField(fId, sMatch, sChange)
{
	if(sChange == null) sChange = '';
	if(fId.value == sMatch)
	{ fId.value = sChange; }
}


// Opens a popup window
function openPopupWin(popUrl, popWid, popHgt, popScroll, popResize)
{
	popupWin=window.open(popUrl,"popupWin","width=" + popWid + ",height=" + popHgt + ",left=" + ((screen.width-popWid)/2) + ",top=" + ((screen.height-popHgt)/2) + ",status=yes,toolbar=no,menubar=no,scrollbars=" + popScroll + ",resizable=" + popResize);
	if(!popupWin.opener) popupWin.opener=self;
}

function getSelectedIndexByValue(selfield) {
	for(i=0;i<selfield.length;i++)
	{
		 if(selfield[i].value==iId)
		 { selfield.selectedIndex=i; break; }
	}
}


//	Input Box Character Counter Below --------------------------------------------
/*function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

//Contador de caracteres.
function Contar(entrada,salida,texto,caracteres) {
  var entradaObj=getObject(entrada);
  var salidaObj=getObject(salida);
  var longitud=caracteres - entradaObj.value.length;
  if(longitud <= 0) {
    longitud=0;
    texto='<span class="disable"> '+texto+' </span>';
    entradaObj.value=entradaObj.value.substr(0,caracteres);
  }
  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}*/
//	Input Box Character Counter Above --------------------------------------------
// -->
