// JavaScript Document
function hovertr()
{
	var rows = document.getElementsByTagName('tr');
	for (var i = 0; i < rows.length; i++) 
	{
		rows[i].onmouseover = function() 
		{
		this.className += ' hilite';
	}
		rows[i].onmouseout = function() 
		{
			this.className = this.className.replace('hilite', '');
		}
	}
}
function ver(id)
{
	xajax.$('detalle').style.display='none';
	xajax.$('saldos').style.display='none';
	xajax.$('detalle_ingresos').style.display='none';
	xajax.$('detalle_retiros').style.display='none';
	xajax.$(id).style.display='block';	
}

function select_option_menu(id)
{
	selects=document.body.getElementsByTagName("A");

	counter=selects.length;

	for(var i=0;i<counter;i++)
    {
		if(selects[i].className=="selected")
		{ 
			selects[i].className="";
		}
	}
	xajax.$(id).className="selected";	
}


function addgroup(selectId,  label)
{
	optGroup = document.createElement('optgroup')
	optGroup.label = label;
    document.getElementById(selectId).appendChild(optGroup);
}
function addOption(selectId,  txt, val)
{
    var objOption = new Option(txt,val);

//    objOption.id = optionId;
    document.getElementById(selectId).options.add(objOption);
}
function selOption(selectId,valor)
{
    obj = document.getElementById(selectId);
	contador=0;
	for(n=0;n<obj.length;n++)
	{
		if(obj[n].value==valor)
		{
			document.getElementById(selectId).selectedIndex=contador;	
			break;
		}
		contador++;
	}
}

function subOption(selectId,valor)
{
    obj = document.getElementById(selectId);
	for(n=0;n<obj.length;n++)
	{
		if(obj[n].value==valor) obj[n].removeNode();
	}
}

function addOptionSELECTED(selectId,  txt, val)
{
	
	indice=document.getElementById(selectId).length;
	var objOption = new Option(txt,val);
    document.getElementById(selectId).options.add(objOption);
	document.getElementById(selectId).selectedIndex=indice;	
}

function emptryDropdown(selectId)
{
    obj = document.getElementById(selectId);
    while(obj.hasChildNodes() == true)
    {
        obj.removeChild(obj.childNodes[0]);
    }
}
