/*
//Inicialización
var max = 0;
var actual = 1;
var anterior = 1;
var pasos_cadena = '';
var intervalo;
var altura_menu = 0;
var aire_menu = 0;
var t_intervalo = 15000;

function inic_html_hogar()
{
	redimensionar_contenido();
	//selec_menu(1,"/on/io/es/home/alta_linea1.html");
	selec_menu(2,"/on/io/es/home/duo_adsl.html");
	document.getElementById("contenedor_principal_home").style.visibility = 'visible';
}

function inic_html_hogar_ca()
{
	redimensionar_contenido();
	//selec_menu(1,"/on/io/ca/home/alta_linea1.html");
	selec_menu(2,"/on/io/ca/home/duo_adsl.html");
	document.getElementById("contenedor_principal_home").style.visibility = 'visible';
}

function inic_html_empr()
{
	redimensionar_contenido();
	selec_menu(1,"/on/io/es/home/puestos_trabajo.html");
	//selec_menu(3,"/on/io/es/home/servicios_sobre_adsl.html");
	document.getElementById("contenedor_principal_home").style.visibility = 'visible';
}

function inic_html_empr_ca()
{
	redimensionar_contenido();
	selec_menu(1,"/on/io/ca/home/puestos_trabajo.html");
	//selec_menu(3,"/on/io/ca/home/servicios_sobre_adsl.html");
	document.getElementById("contenedor_principal_home").style.visibility = 'visible';
}

function inic_html_2()
{
	var banner_aux = document.getElementById('banner').innerHTML;			
	var vector = banner_aux.split('producto_banner');
	max = vector.length - 1;
	inicializar_carrusel(max);
}

var objeto_ajax;

function crear_objeto_ajax()
{
	if	(window.XMLHttpRequest)
	{
		objeto_ajax = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objeto_ajax = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (objeto_ajax == null)
	{
		alert("Your browser does not support XMLHTTP.")
	}
}

function llamadaWebAjax(url)
{
	if (objeto_ajax != null)
	{
		objeto_ajax.open("GET", url, true);
		objeto_ajax.onreadystatechange = estadoWebAjax;
		objeto_ajax.send(null);		
	}
}

function estadoWebAjax()
{
	if	(objeto_ajax.readyState == 4)
	{
		if	(objeto_ajax.status == 200)
		{			
			var banner_aux = objeto_ajax.responseText;
			banner_aux = banner_aux.split('<div id="inicio_banner"></div>')[1];
			banner_aux = banner_aux.split('<div id="fin_banner"></div>')[0];
			document.getElementById('productos_banner_principal').innerHTML = banner_aux;			
			var vector = banner_aux.split('producto_banner');
			max = vector.length - 1;
			inicializar_carrusel(max);				
		}
		else
		{	
			alert('No se han podido cargar los datos');				
		}
	}
}

function cargar_menu(url)
{
	//Creamos los objeto ajax
	crear_objeto_ajax();

	//Lanzamos el primer objeto ajax
	var url_ajax = url;
	llamadaWebAjax(url_ajax);
}


function selec_menu(id,nombre)
{
	document.getElementById('productos_banner_principal').style.visibility = 'hidden';
	cargar_menu(nombre);
	
	var selec = 'menu_' + id;

	for (var icapa in document.getElementById('item_menu').getElementsByTagName('div'))
	{
		document.getElementById('item_menu').getElementsByTagName('div')[icapa].className = 'menu';
	}

	var newClassName = 'menu_sel fondo_menu_' + id;
	document.getElementById(selec).className = newClassName;

	//El 20 son los 20px de altura la flecha
	var altura = aire_menu + ((id - 1) * parseFloat(altura_menu / 16)) + (parseFloat((altura_menu - 20)/32));

	document.getElementById('img_menu_selec').style.marginTop =  parseFloat(altura) + 'em';
}

function selec_banner(id)
{
	clearInterval(intervalo);
	document.getElementById('paso_'+actual).className = 'sin_marcar';
	document.getElementById('paso_'+id).className = 'marcar';
	anterior = actual;
	actual = id;

	document.getElementById("imagen_banner_principal_"+anterior).style.display = 'none';
	document.getElementById("imagen_banner_principal_"+actual).style.display = 'block';

	//intervalo = setInterval("banner_aleatorio();",t_intervalo);
}

function mas_menos(mas, id)
{		
	var nuevo = (mas) ? ((id == max) ? 1 : (id+1)) : ((id == 1) ? max : (id-1));
	selec_banner(nuevo); 
}

function banner_aleatorio()
{
	var nuevo = (actual % max) + 1;
	document.getElementById('paso_'+actual).className = 'sin_marcar';
	document.getElementById('paso_'+nuevo).className = 'marcar';
	anterior = actual;
	actual = nuevo;

	document.getElementById("imagen_banner_principal_"+anterior).style.display = 'none';
	document.getElementById("imagen_banner_principal_"+actual).style.display = 'block';
}

function inicializar_carrusel(max)
{
	actual = 1;
	anterior = 1;
	pasos_cadena = '';
	clearInterval(intervalo);

	pasos_cadena = '';
	pasos_cadena += '	<div class="barra_pasos" onclick="javascript:mas_menos(false, actual); return false;">';
	pasos_cadena +=	'		<img id="imgmenos" src="/on/images/ico_menos2.gif" alt="menos" width="12px" height="12px"/>';
	pasos_cadena += '	</div>';
	pasos_cadena += '<div class="barra_pasos">';
	pasos_cadena += '	<img src="/on/images/fndLImenuCierre.gif" alt="|" width="1" height="12px">';
	pasos_cadena += '</div>';
	for	(i=0; i<max; i++)
	{
		pasos_cadena += '<div id="paso_' + (i+1) + '" class="sin_marcar" onclick="javascript:selec_banner(' + (i+1) +'); return false;">';
		pasos_cadena +=	'	' + (i+1) + '';
		pasos_cadena += '</div>';
		pasos_cadena += '<div class="barra_pasos">';
		pasos_cadena += '	<img src="/on/images/fndLImenuCierre.gif" alt="|" width="1" height="12px">';
		pasos_cadena += '</div>';
	}
	pasos_cadena += '	<div class="barra_pasos" onclick="javascript:mas_menos(true, actual); return false;">';
	pasos_cadena +=	'		<img id="imgmas" src="/on/images/ico_mas2.gif" alt="mas"/ >';
	pasos_cadena += '	</div>';

	if (max > 1)
	{	
		document.getElementById('num_pasos_banner').innerHTML = pasos_cadena;
		paso_actual = 'paso_' + actual;
		document.getElementById(paso_actual).className = 'marcar';
		intervalo = setInterval("banner_aleatorio();",t_intervalo);	
	}
	document.getElementById("imagen_banner_principal_"+anterior).style.display = 'none';
	document.getElementById("imagen_banner_principal_"+actual).style.display = 'block';
	document.getElementById('productos_banner_principal').style.visibility = 'visible';	
}

function redimensionar_contenido()
{
	var num_menu = 1; 
	var h_menu = 0;
	var h_menu_banner_principal = 0;
	var h_titulo_banner_inf = 0;
	var h_contenido_banner_inf = 0;
	var h_contenedor_datoscentrales = 0;
	var h_contenedor_servicios = 0;
	altura_menu = 0;

	for (var icapa in document.getElementsByTagName("div"))
	{
		//Buscamos el número de opciones del menú izquierdo
		if (document.getElementsByTagName("div")[icapa].className == 'menu')
		{
			num_menu += 1;
			var altura = document.getElementsByTagName("div")[icapa].offsetHeight;
			h_menu = (altura > h_menu) ? altura : h_menu;
		}
		
		//Altura del menu_banner_principal
		if (document.getElementsByTagName("div")[icapa].id == 'menu_banner_principal')
		{
			h_menu_banner_principal = document.getElementsByTagName("div")[icapa].offsetHeight;	
		}

		//Titulo de banners inferiores
		if (document.getElementsByTagName("div")[icapa].className == 'titulo_banner_inf')
		{
			var altura = document.getElementsByTagName("div")[icapa].offsetHeight;
			h_titulo_banner_inf = (altura > h_titulo_banner_inf) ? altura : h_titulo_banner_inf;
		}

		//Contenido de banners inferiores
		if (document.getElementsByTagName("div")[icapa].className == 'contenido_banner_inf')
		{
			var altura = document.getElementsByTagName("div")[icapa].offsetHeight;
			h_contenido_banner_inf = (altura > h_contenido_banner_inf) ? altura : h_contenido_banner_inf;
		}
	}
	
	//Aumentamos el tamaño. Num_menu es igual al número de items del menú izq + 1
	//altura_menu = h_menu + (num_menu * 4);
	switch	(num_menu)
	{
		case 4:		altura_menu = h_menu + (num_menu * 4);
					break;
		case 5:		altura_menu = h_menu + (num_menu * 4);
					break;
		case 6:		altura_menu = h_menu + (num_menu * 3);
					break;
		default:	altura_menu = h_menu + (num_menu * 3);
	}

	for (var icapa in document.getElementsByTagName("div"))
	{
		if (document.getElementsByTagName("div")[icapa].className == 'menu')
		{
			var altura = document.getElementsByTagName("div")[icapa].offsetHeight;
			document.getElementsByTagName("div")[icapa].style.padding = parseFloat((altura_menu - altura)/32) + 'em 0em 0em 0.8em';
			document.getElementsByTagName("div")[icapa].style.height = parseFloat(altura_menu/16) + 'em';
		}

		//Titulo de banners inferiores
		if (document.getElementsByTagName("div")[icapa].className == 'titulo_banner_inf')
		{
			document.getElementsByTagName("div")[icapa].style.height = parseFloat(h_titulo_banner_inf/16) + 'em';
		}

		//Contenido de banners inferiores
		if (document.getElementsByTagName("div")[icapa].className == 'contenido_banner_inf')
		{
			document.getElementsByTagName("div")[icapa].style.height = parseFloat(h_contenido_banner_inf/16) + 'em';
		}
	}

	// Modificamos el padding del item_menu
	for (var icapa in document.getElementsByTagName("div"))
	{
		if (document.getElementsByTagName("div")[icapa].id == 'item_menu')
		{
			var aire = parseFloat(h_menu_banner_principal/16) - parseFloat(document.getElementsByTagName("div")[icapa].offsetHeight/16);
			aire = parseFloat(aire / 2);
			aire_menu = (aire > 0) ? parseFloat(aire) : 0;
			document.getElementsByTagName("div")[icapa].style.paddingTop = aire_menu + 'em';
		}
	}

	//Ajustamos el contenedor_servicios
	var h1 = parseFloat(document.getElementById('contenedor_datoscentrales').offsetHeight / 16);
	var h2 = parseFloat(document.getElementById('contenedor_servicios').offsetHeight / 16);
	var diferencia = parseFloat(h1 - h2);
	//document.getElementById('titulo_11822').style.margin = (diferencia > 0) ? parseFloat(h1 - h2) + 'em 0em 0em 0em' : document.getElementById('titulo_11822').style.margin;

	if	(diferencia > 0)
	{
		document.getElementById('titulo_11822').style.margin = parseFloat(h1 - h2) + 'em 0em 0em 0em';
	}
	else
	{
		document.getElementById('otros_banner').style.margin = parseFloat(h2 - h1) + 'em 0em 0em 0em';
	}


}

//busca caracteres que no sean espacio en blanco en una cadena
function vacio(q)
{
	for (i = 0; i < q.length; i++ )
	{
		if	(q.charAt(i) != " " )
		{
			return true;
		}
	}
	return false;
}

function comprobar_1822()
{					
	if	(document.getElementsByName('nombre').item(0).value == 'Nombre')
		document.getElementsByName('nombre').item(0).value= '';

	if	(document.getElementsByName('apellido1').item(0).value == 'Apellido 1')
		document.getElementsByName('apellido1').item(0).value= '';

	if	(document.getElementsByName('localidad').item(0).value == 'Localidad')
		document.getElementsByName('localidad').item(0).value= '';

	if	((document.getElementsByName('nombre').item(0).value == '') && (document.getElementsByName('apellido1').item(0).value == ''))
	{	
		alert('Rellene correctamente el nombre o alguno de los apellidos');

		document.getElementsByName('nombre').item(0).value = 'Nombre';
		document.getElementsByName('apellido1').item(0).value = 'Apellido 1';
		document.getElementsByName('localidad').item(0).value = 'Localidad';

		return false;
	}
	else
	{
		document.formulario_consulta_11822.submit();
	}
}

function comprobar_11822()
{					
	if	(document.getElementsByName('nombre').item(0).value == 'Nombre')
		document.getElementsByName('nombre').item(0).value= '';

	if	(document.getElementsByName('apellido1').item(0).value == 'Apellido 1')
		document.getElementsByName('apellido1').item(0).value= '';

	if	(document.getElementsByName('localidad').item(0).value == 'Localidad')
		document.getElementsByName('localidad').item(0).value= '';

	if	((document.getElementsByName('nombre').item(0).value == '') && (document.getElementsByName('apellido1').item(0).value == ''))
	{	
		alert('Rellene correctamente el nombre o alguno de los apellidos');

		document.getElementsByName('nombre').item(0).value = 'Nombre';
		document.getElementsByName('apellido1').item(0).value = 'Apellido 1';
		document.getElementsByName('localidad').item(0).value = 'Localidad';

		return false;
	}
	else
	{
		document.formulario_consulta_11822.submit();
	}
}

*/