function changeClass(id){
  document.getElementById('opcion' + id).className = 'botonLink2';
}

function subMenuOver(id){
  id.style.color = '#EA6116';
}

function subMenuOut(id){
  id.style.color = '';
}

function subMenuFlechitaOver(id){
  document.getElementById(id).style.display = '';
}

function subMenuFlechitaOut(id){
  document.getElementById(id).style.display = 'none';
}

function abrirMenu(id){
  document.getElementById('menu' + id).style.display = '';
}

function abrirSubMenu(id){
  document.getElementById('subMenu' + id).style.display = '';
}

function cerrarSubMenues(){
  for (i=1; i<=6; i++){
    document.getElementById('subMenu' + i).style.display = 'none';
  }
}

function cerrarMenues(id){
  for (i=1; i<=12; i++){
    document.getElementById('menu' + i).style.display = 'none';
    document.getElementById('opcion' + i).className = 'botonLink';
  }
  cerrarSubMenues();
}



function overTD(td,color){td.bgColor=color;}
function outTD(td,color){td.bgColor=color;}

function paso1 () {
	  document.getElementById('flechaZonaGris').style.display = '';
	  document.getElementById('zonaSeleccionada').style.display = '';
	  document.getElementById('flechaBarrioNaranja').style.display = '';
	  document.getElementById('barrios').style.display = '';
	  document.getElementById('flechaZonaNaranja').style.display = 'none';
	  document.getElementById('zonas').style.display = 'none';
	  document.getElementById('flechaBarrioGris').style.display = 'none';
	}

function paso2 () {
	  document.getElementById('flechaZonaGris').style.display = '';
	  document.getElementById('zonaSeleccionada').style.display = '';
	  document.getElementById('flechaBarriogris').style.display = '';
	  document.getElementById('barrioSeleccionado').style.display = '';
	  document.getElementById('botonBusqueda').style.display = '';
	  document.getElementById('resultadoBusqueda').style.display = '';
	  document.getElementById('barrios').style.display = 'none';
	  document.getElementById('flechaZonaNaranja').style.display = 'none';
	  document.getElementById('zonas').style.display = 'none';
	  document.getElementById('flechaBarrioNaranja').style.display = 'none';
	  document.getElementById('referencias').style.display = '';
	}

function paso3 () {
		document.getElementById('listarSucursales').style.display = '';
		document.getElementById('flechaZonaGris').style.display = 'none';
		document.getElementById('zonaSeleccionada').style.display = 'none';
		document.getElementById('flechaBarrioNaranja').style.display = 'none';
		document.getElementById('barrios').style.display = 'none';
		document.getElementById('flechaZonaGris').style.display = 'none';
		document.getElementById('zonaSeleccionada').style.display = 'none';
		document.getElementById('flechaBarriogris').style.display = 'none';
		document.getElementById('barrioSeleccionado').style.display = 'none';
		document.getElementById('botonBusqueda').style.display = 'none';
		document.getElementById('resultadoBusqueda').style.display = 'none';
	}
	
function paso4 () {
	  document.getElementById('flechaZonaGris').style.display = '';
	  document.getElementById('zonaSeleccionada').style.display = '';
	  document.getElementById('flechaBarriogris').style.display = '';
	  document.getElementById('barrioSeleccionado').style.display = '';
	  document.getElementById('radioSucursalDiv').style.display = '';
	  document.getElementById('barrios').style.display = 'none';
	  document.getElementById('flechaZonaNaranja').style.display = 'none';
	  document.getElementById('zonas').style.display = 'none';
	  document.getElementById('flechaBarrioNaranja').style.display = 'none';	
	}	

function paso6 () {
	  document.getElementById('flechaZonaGris').style.display = 'none';
	  document.getElementById('flechaZonaNaranja').style.display = '';
	  document.getElementById('zonas').style.display = '';
	  document.getElementById('zonaSeleccionada').style.display = 'none';
	  document.getElementById('flechaBarriogris').style.display = 'none';
	  document.getElementById('flechaBarrioNaranja').style.display = 'none';
	  document.getElementById('barrios').style.display = 'none';
	  document.getElementById('barrioSeleccionado').style.display = 'none';	  
	  document.getElementById('radioSucursalDiv').style.display = 'none';
	  document.getElementById('botonBusqueda').style.display = 'none';
	}
	
function paso8 () {
	  document.getElementById('flechaZonaGris').style.display = 'none';
	  document.getElementById('flechaZonaNaranja').style.display = '';
	  document.getElementById('zonas').style.display = '';
	  document.getElementById('zonaSeleccionada').style.display = 'none';
	  document.getElementById('flechaBarriogris').style.display = '';
	  document.getElementById('flechaBarrioNaranja').style.display = 'none';
	  document.getElementById('barrios').style.display = 'none';
	  document.getElementById('barrioSeleccionado').style.display = 'none';	  
	  document.getElementById('resultadoBusqueda').style.display = 'none';
	  document.getElementById('listarSucursales').style.display = 'none';
	}
function paso9 () {
	  document.getElementById('flechaZonaGris').style.display = 'none';
	  document.getElementById('flechaZonaNaranja').style.display = '';
	  document.getElementById('zonas').style.display = 'none';
	  document.getElementById('zonaSeleccionada').style.display = 'none';
	  document.getElementById('flechaBarriogris').style.display = 'none';
	  document.getElementById('flechaBarrioNaranja').style.display = 'none';
	  document.getElementById('barrios').style.display = 'none';
	  document.getElementById('barrioSeleccionado').style.display = 'none';	  
	  document.getElementById('resultadoBusqueda').style.display = 'none';
	  document.getElementById('botonBusqueda').style.display = '';
	}	
		

function pasarValue(idFrom, idTo) {
		if (document.getElementById){ 
			//alert('idFrom: ' + idFrom + ' idTo: ' + idTo);
			//var rdio = idFrom.value;
			//alert("color: " + rdio);
			//alert('document.getElementById(idTo): ' + document.getElementById(idTo) );
			var valueFrom = idFrom.value; 
			objTo = document.getElementById(idTo);
			objTo.value = valueFrom;
			document.getElementById('botonBusqueda').style.display = '';	
		} 
	}	

function Visible_Invisible(id){
		if (document.getElementById){ 
				obj = document.getElementById(id); 
			if (obj.style.display == "none"){ 
				obj.style.display = '';
			} else {
				obj.style.display = 'none';  
			} 
		} 
	}

//----------------Inicio codigo reloj-----------------------------
	//Novitemp Clock on server
	var dateServer;
    /*    
	function MakeArrayday(size) {
		this.length = size;
		for(var i = 1; i <= size; i++)
		this[i] = "";
		return this;
	}
        
	function MakeArraymonth(size) {
		this.length = size;
		for(var i = 1; i <= size; i++)
		this[i] = "";
		return this;
	}
	*/
	var hours;
	var minutes;
	var seconds;
	var timer = null;
        
	function sClock(valor) {
		dateServer = valor;
		var pp = new Array();
		pp = dateServer.split(':');
		hours=pp[0];
		minutes=pp[1];		
		seconds=pp[2];
		if(timer){
			clearInterval(timer);
			timer=null;
		}
		timer=setInterval("work();",1000);
	}
		
	function twoDigit(_v) {
		_v = _v + '';
		//if(_v < 10)_v="0"+_v;
		if(_v.length == 1 || _v.length == 'undefined')_v="0"+_v;
		return _v;
	}

	function work() {
		if (!document.layers && !document.all && !document.getElementById) return;
		//var runTime = new Date();
		var shours = hours;
		var sminutes = minutes;
		var sseconds = seconds;
		var quehora;
		if (!shours) shours = 12;
		sminutes=twoDigit(sminutes);
		sseconds=twoDigit(sseconds);
		shours  =twoDigit(shours  );
		movingtime = ""+ shours + ":" + sminutes +":"+sseconds+"";
		quehora=""+ shours + ":" + sminutes +"";
		
		if (document.getElementById)
			document.getElementById("clock").innerHTML=quehora;
		else if (document.layers) {
			document.layers.clock.document.open();
			document.layers.clock.document.write(quehora);
			document.layers.clock.document.close();
		}
		else if (document.all)
			clock.innerHTML = quehora;
		
		if(++seconds > 59) {
		  seconds=0;
		  if(++minutes > 59) {
		    minutes=0;
		    if(++hours > 23) {
		      hours=0;
		    }
		  }
		}
	}
//-------------------Fin codigo reloj-------------------------------

//Se fija que esté ingresando un valor numérico
function esInteger(e) {
	var charCode;
	charCode = e.keyCode; // leo la tecla en ASCII que ingreso
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		return false;
	}
	return true;
}

// ---------- INICIO - Para limpiar el formulario-----------
					
function clearForm(formIdent) {
	var form, elements, i, elm; 
  	form = document.getElementById ? document.getElementById(formIdent): document.forms[formIdent]; 
				
	//look through by tag name
	if (document.getElementsByTagName)
	{
		//clear text boxes, check boxes, and radio buttons
		elements = form.getElementsByTagName('input');
		for(i = 0, elm; elm = elements.item(i++);)
		{
			if (elm.disabled == false)
			{
				//clear text boxes
				if (elm.getAttribute('type') == "text" || elm.getAttribute('type') == "password" )
				{
					elm.value = '';
				}
				//clear check boxes and radio buttons
				else if (elm.getAttribute('type') == "checkbox")
				{
					elm.checked = false;
				}
			}
		}
		//clear text areas
		elements = form.getElementsByTagName('textarea');
		for(i = 0, elm; elm = elements.item(i++);)
		{
			elm.value = '';
		}
		
		//reset list boxes and drop down lists to the first item
		elements = form.getElementsByTagName('select');
		for(i = 0, elm; elm = elements.item(i++);)
		{
			if (elm.disabled == false)
			{
				elm.options.selectedIndex=0;
			}
		}
	}
}

// ---------- FIN - Para limpiar el formulario-----------

function validarEmail(email,emailConfirm){
	if(!(email.value==emailConfirm.value)){
		alert('Los emails ingresados no coinciden');
		emailConfirm.focus();
		return false;
		}
	return true;		
}



//------------ URL de HB Aleatorio ----------------------s

function UrlHomeBanking(){
	numPosibilidades = 1000 - 1 
	aleat = Math.random() * numPosibilidades 
	aleat = Math.round(aleat) 
	numero = aleat % 2

	if (numero==0) {
		window.open("https://ihb1.itau.com.ar/homebanking/login.do");
	}else{
		window.open("https://ihb2.itau.com.ar/homebanking/login.do");
	}
} 

//------------ Mostrar Ocultar el "*" de formulario abrir_cuanta_itau ----------------------s

function  mostrarOcultarDNI(obj,idDeDiv){
	if(obj.checked)
		document.getElementById(idDeDiv).style.display = '';		
	else
		document.getElementById(idDeDiv).style.display = 'none';
}

//Se fija que esté ingresando un valor numérico
function chequeaArroba(e) {
	var charCode;
	charCode = e.keyCode; // leo la tecla en ASCII que ingreso
	if (charCode==64) {
		return false;
	}
	return true;
}	
