/*
alert(navigator.appName == "Microsoft Internet Explorer");
alert("Agente: " + navigator.userAgent);
alert(navigator.appVersion.substr(0,1));
*/
 
/*sfHover = function() {
		
	$$('#nav .item').each(function(sfEls){
		sfEls.onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls.onmouseout=function() {			
			sfEls[i].style.display = "none";
		}
	});
	
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
*/

function popupAnimate(id)
{
	$('alerta-titulo').innerHTML = $(id+"_titulo").innerHTML;  
  $('alerta-content').innerHTML = $(id+"_content").innerHTML;
  
  if($(id+"_img") != null){
  	$('alerta-img').src = $(id+"_img").src;
  }else{
  	$('alerta-img').hide();
  }
	
	Effect.Center('alertas');
	Effect.Appear('alertas');
	showDisable();
}

function highlightItem( e ){

	if( ! ( $( this ).hasClassName( 'itemSelected' ) ) ) {
		$( this ).toggleClassName( 'itemSelected' );
		if( this.tagName.substring(0,2) == 'LI' ) {
			$( this ).firstDescendant().style.color = '#FFFFFF';
		}
	}
	
}

//Gracias tute por el nombre de la funcion
function dehighlightItem( e ){
	
	if( $( this).hasClassName( 'itemSelected' ) ) {
		$( this ).removeClassName( 'itemSelected' );
		if( this.tagName.substring(0,2) == 'LI' ) { 
			$( this ).firstDescendant().style.color = '#030280';
		}
	}
	
}


function init_menues(){

	$$('li.itemMenu').each(function( s ){
		if( Object.isElement( s ) ) {
			Event.observe(s, "mouseover", highlightItem);
			Event.observe(s, "mouseout", dehighlightItem);
		}
	});
	
}

function RecuperarPass(){
	
	$('tdInfo').update( "Chequeando datos..." );

	$('frmRecuperar').request({
		onComplete: function(res){
			$('tdInfo').update( res.responseText );
		}
	});

}

function toggleFechaExp(){

	if( $('chkFecha').checked ){
		$('trFecha').style.display = "";
		$('chkFecha').value = "on";
	} else {
		$('trFecha').style.display = "none";
		$('chkFecha').value = "off";
	}
}

function IsChecked(el) {
    return $$('#' + el + ' input').find(
        function(e) {return e.checked;}); 
};