pestanasStart=function(){
	var arrayCaracteristicas=new Array();
	var arrayPestanas=new Array();
	
	
	nodoTerminos=document.getElementById('lista_etiquetas');
	noliAux=nodoTerminos.getElementsByTagName('li');
	
	if(Request.QueryString("p") != 'undefined'){
		pest=Request.QueryString("p");
		
		for(i=0;i<5;i++){
			num=i+1;
			if(document.getElementById('pestana'+num)){ arrayPestanas[i]=document.getElementById('pestana'+num);			}

			if(document.getElementById('cont_pestana'+num)){
				arrayCaracteristicas[i]=document.getElementById('cont_pestana'+num);
				if(i!=pest-1){
					arrayCaracteristicas[i].className='novisible';
				}else{
						noliAux[i].className='select';
				}
			}
		}	
		
	}else{
	
		for(i=0;i<5;i++){
			num=i+1;
			if(document.getElementById('pestana'+num)){arrayPestanas[i]=document.getElementById('pestana'+num);}
			if(document.getElementById('cont_pestana'+num)){
				arrayCaracteristicas[i]=document.getElementById('cont_pestana'+num);
				if(i>0){ arrayCaracteristicas[i].className='novisible';}
			}
		}	
		noliAux[0].className='select';
	}
	

	for (i=0;i<noliAux.length;i++){ /*escondo-muestro capas principales segun el ancla del enlace */
		nodeLi=noliAux[i];
		nodeLi.onclick=function(){
		
			for(h=0;h<arrayPestanas.length;h++){
				arrayPestanas[h].className='';
			}
		
			this.className='select';
			
			for(j=0; j<this.childNodes.length; j++){ 
				childNod=this.childNodes[j];
				if(childNod.nodeName=='A'){
					anchorT=childNod.hash.substring(1,childNod.hash.length);
					for(k=0;k<arrayCaracteristicas.length;k++){
						capaAux2=arrayCaracteristicas[k];
						if(capaAux2.id!=anchorT){
							capaAux2.className="novisible";
						}else{
							capaAux2.className="visible";
						}
					}
				}
			} return false;
		}
	}
	
	if(document.getElementById('inicio')){
		var linksCar=new Array();
		for(i=0;i<arrayCaracteristicas.length;i++){
			carLinks=arrayCaracteristicas[i].getElementsByTagName('a');
			linksCar=carLinks[carLinks.length-1];
		}
		
		for(i=0;i<arrayCaracteristicas.length;i++){
			arrayCaracteristicas[i].style.cursor='pointer';
			arrayCaracteristicas[i].onclick=function(){
				carLinks=this.getElementsByTagName('a');
				linkCar=carLinks[carLinks.length-1];
				location.href=linkCar;
			}
		}
	}
	
	
	var arrayDevuelta=new Array();
	
	arrayDevuelta[0]=arrayCaracteristicas;
	arrayDevuelta[1]=arrayPestanas;
	
	return arrayDevuelta;  
}

productStart=function(){
	recoje=pestanasStart();
	arrayCaracteristicas=recoje[0];
	arrayPestanas=recoje[1];

	for (i=0; i<arrayCaracteristicas.length; i++){  /* esconde y muestras las caracteristicas internas*/
		arrayH1=arrayCaracteristicas[i].getElementsByTagName('h1');
		for(j=0;j<arrayH1.length;j++){
			if(arrayH1[j].className=='nosc') arrayH1[j].className='novisible'; /*escondo h1 que solo deben verse sin js o en hoja de estilos de impresion*/
		}
			
		noliAux=arrayCaracteristicas[i].getElementsByTagName('li');
		escondeMuestra(noliAux);
	}
}
	
glosaStart = function() {
		
	var arrayLetras= new Array();
	arrayLetras[0]='a';
	arrayLetras[1]='d';
	arrayLetras[2]='g';
	arrayLetras[3]='j';
	arrayLetras[4]='m';
	arrayLetras[5]='p';
	arrayLetras[6]='s';
	arrayLetras[7]='w';
	
	/*esconde todas las capas menos la primera*/
	for(i=1;i<arrayLetras.length;i++){
		document.getElementById(arrayLetras[i]).className="novisible";
	}

	nodoTerminos=document.getElementById('lista_enlaces');

	noliAux=nodoTerminos.getElementsByTagName('li');
	noliAux[0].className='selected';
			
	var longNodo=noliAux.length;
			
	for (jj=0;jj<longNodo;jj++){ //jj en vez de j porque IE se lia con las letras del array y da error. 
		nodeLi= noliAux[jj];
		nodeLi.onclick=function(){
			for(k=0; k<this.childNodes.length; k++){ 
				childNod=this.childNodes[k];
				if(childNod.nodeName=='A'){
					anchorT=childNod.hash.substring(1,childNod.hash.length);
		
					for(l=0;l<arrayLetras.length;l++){
						capaAux2=document.getElementById(arrayLetras[l]);
						if(arrayLetras[l]!=anchorT){
							capaAux2.className="novisible";
						}else{
							capaAux2.className="visible";
						}
					}
				}
						
				for(mm=0;mm<noliAux.length;mm++){
					if(arrayLetras[mm]!=anchorT){
						noliAux[mm].className="";
					}else{
						noliAux[mm].className="selected";
					}
				}
			} return false;
		}
	}
}
	
	
tarifasStart=function(){
	nodoListaTarifas=document.getElementById('lista_tarifas');
	noliAux=nodoListaTarifas.getElementsByTagName('li');
	escondeMuestra(noliAux);
}
	
escondeMuestra= function(nodoLiAux){ /* despliega y contra una capa cuando clickas en un h3 */
	for (j=0; j<noliAux.length; j++) { //agrupa en un array a los li
		node = noliAux[j];
		for(k=0; k<node.childNodes.length; k++){ 
			hijo=node.childNodes[k];
			if (hijo.nodeName=="DIV") { /*esconde al iniciar los divs hijos de los li*/
//				hijo.className='novisible';
			}
			if (hijo.nodeName=="H3") { /*manita en h3, no en css, xq no debe aparecer si js desactivado*/
				hijo.style.cursor='pointer';
				hijo.onclick=function(){
					nodoLi=this.parentNode;
					var capaDiv;
					for(l=0; l<nodoLi.childNodes.length; l++){ 
						hijo=nodoLi.childNodes[l];
						if (hijo.nodeName=="DIV") {
							capaDiv=hijo;
						}
					}
					if(nodoLi.className==''){
						nodoLi.className='select';
						capaDiv.className='visible';
					}else{
						nodoLi.className='';
						capaDiv.className='novisible';
					}
				}
			}
		}
	}		
}

function showLayer(sId) {
	if(document.getElementById(sId).style.display == 'none') {
		document.getElementById(sId).style.display='block';
	} else {
	document.getElementById(sId).style.display='none';
	}
}

/*Traslado de un dominio desde la página de tipos de dominio*/
function moveDomain() {
	var oDomain = document.getElementById("input_domain");
	var msgError = 	document.getElementById("domain_error");
	var re_domain = new RegExp("^(http://)?(www\.)?([^_\-][a-z_0-9\-]+)(\.[a-z]{2,4})?(\.[a-z]{2,5})$","i");	// .museum es de 5
	
	//Oculto las capas de errores y resultados de anteriores busquedas
	msgError.innerHTML ='';
	document.getElementById("show_traslado2").style.display="none";
	oDomain.style.background="#FFFFFF";

	if ( oDomain.value == null || oDomain.value == '' ) {
		msgError.innerHTML = 'Introduzca un dominio<br />';
		oDomain.style.border="1px solid #F8F9FA";
		oDomain.style.background="#FFD7D7";
	} else if (! oDomain.value.match(re_domain)) {
		msgError.innerHTML = 'Dominio incorrecto. Introduzca un dominio válido<br />';
		oDomain.style.border="1px solid #F8F9FA";
		oDomain.style.background="#FFD7D7";
	}
	// Todo Ok: cambiamos las "vistas" y asignamos el valor de dominio al formulario fhosting
	else {
		// Es un dominio 'válido', comprobamos ahora que sea uno de los admitidos por el buscador:
		// .com .org .net .info .biz .ws .eu .es .com.es .nom.es .org.es .cat
		var re_match =  re_domain.exec(oDomain.value);
		var extension = '';
		re_match[4] == "" || re_match[4] == null || re_match[4] == "undefined"? extension = re_match[5]: extension = re_match[4]+re_match[5];

		// Estas extensiones las admite el buscador...
		if(extension.match(/^(\.com|\.org|\.net|\.info|\.biz|\.ws|\.eu|\.es|\.com\.es|\.nom\.es|\.org\.es|\.cat)$/)) {
			document.getElementById("hExtension").value=extension;
			document.getElementById("hDominio").value=re_match[3];

			document.getElementById("fSearcher").submit();
		}
		// Extensiones territoriales que son válidas. Sólo controlamos la última extensión, así que si hay un .kaka.am también la admitimos
		else if(re_match[5].match(/^(\.name|\.pro|\.coop|\.museum|\.aero|\.edu|\.ac|\.ad|\.ae|\.af|\.ag|\.ai|\.al|\.am|\.an|\.ao|\.aq|\.ar|\.as|\.at|\.au|\.aw|\.az|\.ba|\.bb|\.bd|\.be|\.bf|\.bg|\.bh|\.bi|\.bj|\.bm|\.bn|\.bo|\.br|\.bs|\.bt|\.bv|\.bw|\.by|\.bz|\.ca|\.cc|\.cd|\.cf|\.cg|\.ch|\.ci|\.ck|\.cl|\.cm|\.cn|\.co|\.cr|\.cu|\.cv|\.cx|\.cy|\.cz|\.de|\.dj|\.dk|\.dm|\.do|\.dz|\.ec|\.ee|\.eg|\.eh|\.er|\.et|\.fi|\.fj|\.fk|\.fm|\.fo|\.fr|\.ga|\.gd|\.ge|\.gf|\.gg|\.gh|\.gi|\.gl|\.gm|\.gn|\.gp|\.gq|\.gr|\.gs|\.gt|\.gu|\.gw|\.gy|\.hk|\.hm|\.hn|\.hr|\.ht|\.hu|\.id|\.ie|\.il|\.im|\.in|\.io|\.iq|\.ir|\.is|\.it|\.je|\.jm|\.jo|\.jp|\.ke|\.kg|\.kh|\.ki|\.km|\.kn|\.kp|\.kr|\.kw|\.ky|\.kz|\.la|\.lb|\.lc|\.li|\.lk|\.lr|\.ls|\.lt|\.lu|\.lv|\.ly|\.ma|\.mc|\.md|\.mg|\.mh|\.mk|\.ml|\.mm|\.mn|\.mo|\.mp|\.mq|\.mr|\.ms|\.mt|\.mu|\.mv|\.mw|\.mx|\.my|\.mz|\.na|\.nc|\.ne|\.nf|\.ng|\.ni|\.nl|\.no|\.np|\.nr|\.nu|\.nz|\.om|\.pa|\.pe|\.pf|\.pg|\.ph|\.pk|\.pl|\.pm|\.pn|\.pr|\.pt|\.pw|\.py|\.qa|\.re|\.ro|\.ru|\.rw|\.sa|\.sb|\.sc|\.sd|\.se|\.sg|\.sh|\.si|\.sj|\.sk|\.sl|\.sm|\.sn|\.so|\.sr|\.st|\.sv|\.sy|\.sz|\.tc|\.td|\.tf|\.tg|\.th|\.tj|\.tk|\.tm|\.tn|\.to|\.tp|\.tr|\.tt|\.tv|\.tw|\.tz|\.ua|\.ug|\.uk|\.um|\.us|\.uy|\.uz|\.va|\.vc|\.ve|\.vg|\.vi|\.vn|\.vu|\.wf|\.ye|\.yt|\.yu|\.za|\.zm|\.zr|\.zw)$/)) {
			//document.getElementById("show_traslado1").style.display="none";
			document.getElementById("show_traslado2").style.display="block";
			document.getElementById("domain2").value=oDomain.value;
			document.getElementById("dominio2").innerHTML=oDomain.value;
		}
		else {
			msgError.innerHTML = 'Extensi&oacute;n no v&aacute;lida.<br />';
			oDomain.style.border="1px solid #F8F9FA";
			oDomain.style.background="#FFD7D7";
		}
	}

	// Simpre return 'false', porque no hacemos nunca el submit... solo es una trampa para recoger los valores
	return false;
}
/*Traslado de un dominio desde la página de traslado*/
function moveDomainTraslado() {
	var oDomain = document.getElementById("input_domain");
	var msgError = 	document.getElementById("domain_error");
	var re_domain = new RegExp("^(http://)?(www\.)?([^_\-][a-z_0-9\-]+)(\.[a-z]{2,4})?(\.[a-z]{2,5})$","i");	// .museum es de 5

	if ( oDomain.value == null || oDomain.value == '' ) {
		msgError.innerHTML = 'Introduzca un dominio<br />';
		oDomain.style.border="1px solid #F8F9FA";
		oDomain.style.background="#FFD7D7";
	} else if (! oDomain.value.match(re_domain)) {
		msgError.innerHTML = 'Dominio incorrecto. Introduzca un dominio válido<br />';
		oDomain.style.border="1px solid #F8F9FA";
		oDomain.style.background="#FFD7D7";
	}
	// Todo Ok: cambiamos las "vistas" y asignamos el valor de dominio al formulario fhosting
	else {
		// Es un dominio 'válido', comprobamos ahora que sea uno de los admitidos por el buscador:
		// .com .org .net .info .biz .ws .eu .es .com.es .nom.es .org.es cat
		var re_match =  re_domain.exec(oDomain.value);
		var extension = '';
		re_match[4] == "" || re_match[4] == null || re_match[4] == "undefined"? extension = re_match[5]: extension = re_match[4]+re_match[5];

		// Estas extensiones las admite el buscador...
		if(extension.match(/^(\.com|\.org|\.net|\.info|\.biz|\.ws|\.eu|\.es|\.com\.es|\.nom\.es|\.org\.es|\.cat)$/)) {
			document.getElementById("hExtension").value=extension;
			document.getElementById("hDominio").value=re_match[3];

			document.getElementById("fSearcher").submit();
		}
		// Extensiones territoriales que son válidas. Sólo controlamos la última extensión, así que si hay un .kaka.am también la admitimos
		else if(re_match[5].match(/^(\.name|\.pro|\.coop|\.museum|\.aero|\.edu|\.ac|\.ad|\.ae|\.af|\.ag|\.ai|\.al|\.am|\.an|\.ao|\.aq|\.ar|\.as|\.at|\.au|\.aw|\.az|\.ba|\.bb|\.bd|\.be|\.bf|\.bg|\.bh|\.bi|\.bj|\.bm|\.bn|\.bo|\.br|\.bs|\.bt|\.bv|\.bw|\.by|\.bz|\.ca|\.cc|\.cd|\.cf|\.cg|\.ch|\.ci|\.ck|\.cl|\.cm|\.cn|\.co|\.cr|\.cu|\.cv|\.cx|\.cy|\.cz|\.de|\.dj|\.dk|\.dm|\.do|\.dz|\.ec|\.ee|\.eg|\.eh|\.er|\.et|\.fi|\.fj|\.fk|\.fm|\.fo|\.fr|\.ga|\.gd|\.ge|\.gf|\.gg|\.gh|\.gi|\.gl|\.gm|\.gn|\.gp|\.gq|\.gr|\.gs|\.gt|\.gu|\.gw|\.gy|\.hk|\.hm|\.hn|\.hr|\.ht|\.hu|\.id|\.ie|\.il|\.im|\.in|\.io|\.iq|\.ir|\.is|\.it|\.je|\.jm|\.jo|\.jp|\.ke|\.kg|\.kh|\.ki|\.km|\.kn|\.kp|\.kr|\.kw|\.ky|\.kz|\.la|\.lb|\.lc|\.li|\.lk|\.lr|\.ls|\.lt|\.lu|\.lv|\.ly|\.ma|\.mc|\.md|\.mg|\.mh|\.mk|\.ml|\.mm|\.mn|\.mo|\.mp|\.mq|\.mr|\.ms|\.mt|\.mu|\.mv|\.mw|\.mx|\.my|\.mz|\.na|\.nc|\.ne|\.nf|\.ng|\.ni|\.nl|\.no|\.np|\.nr|\.nu|\.nz|\.om|\.pa|\.pe|\.pf|\.pg|\.ph|\.pk|\.pl|\.pm|\.pn|\.pr|\.pt|\.pw|\.py|\.qa|\.re|\.ro|\.ru|\.rw|\.sa|\.sb|\.sc|\.sd|\.se|\.sg|\.sh|\.si|\.sj|\.sk|\.sl|\.sm|\.sn|\.so|\.sr|\.st|\.sv|\.sy|\.sz|\.tc|\.td|\.tf|\.tg|\.th|\.tj|\.tk|\.tm|\.tn|\.to|\.tp|\.tr|\.tt|\.tv|\.tw|\.tz|\.ua|\.ug|\.uk|\.um|\.us|\.uy|\.uz|\.va|\.vc|\.ve|\.vg|\.vi|\.vn|\.vu|\.wf|\.ye|\.yt|\.yu|\.za|\.zm|\.zr|\.zw)$/)) {
			document.getElementById("show_traslado1").style.display="none";
			document.getElementById("show_traslado2").style.display="block";
			document.getElementById("domain2").value=oDomain.value;
			document.getElementById("dominio2").innerHTML=oDomain.value;
		}
		else {
			msgError.innerHTML = 'Extensi&oacute;n no v&aacute;lida.<br />';
			oDomain.style.border="1px solid #F8F9FA";
			oDomain.style.background="#FFD7D7";
		}
	}

	// Siempre return 'false', porque no hacemos nunca el submit... solo es una trampa para recoger los valores
	return false;
}

//Función para poner estilo a las imágenes (google, sala de prensa)
imgStyle=function(){
	arrayDivs=document.getElementsByTagName('div');
	for(i=0;i<arrayDivs.length;i++){
		if(arrayDivs[i].className=='imgborder'){
			divEvento=arrayDivs[i];
			arrayImgs=divEvento.getElementsByTagName('img');
			imgEvento=arrayImgs[0]; /*presuponemos que hay varias imagenes dentro de evento y coge la 1. Si se da el caso de que no hay imagenes se puede poner un if de comprobacion previa*/
			widthImg=imgEvento.width;
			divEvento.style.width=(widthImg)+'px';
		}
	}
}

// Abre y cierra proteccion de datos
function protPol(){
	if(document.getElementById('politica_uso_text')){
		dataLayer=document.getElementById('politica_uso_text');
		if(dataLayer.className=='novisible') dataLayer.className='';
		else dataLayer.className='novisible';
	}
	return false;
}

 function docId(id){
  	return document.getElementById(id);
 }
		

//se salta el frame de arsys.cat
cambiaEnlacesCatStart= function(){
	nodoRegCat=document.getElementById('reg_cat');
	nodoEnlaces=nodoRegCat.getElementsByTagName('A');
	for(i=0;i<nodoEnlaces.length;i++){
		hrefEnlace=nodoEnlaces[i].href;
		longEnlace=hrefEnlace.length;
		extension=hrefEnlace.substring(longEnlace-3,longEnlace);
		if(extension=='pdf'){
			nodoEnlaces[i].target='_blank';
		}else{
			nodoEnlaces[i].target='_parent';
		}
	}
}  

//antiguo validaciones.js
var nav4 = window.Event ? true : false;

// Permite introducir sólo números en un input.
// Uso: onKeyPress="return acceptNum(event)"
function acceptNum(evt){	
// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57	
var key = nav4 ? evt.which : evt.keyCode;	
return (key <= 13 || (key >= 48 && key <= 57));
}

//Retorna el valor del la opcion seleccionada en el radiogroup que recibe
function getRadioButtonValue(ctrl)
{
    for(i=0;i<ctrl.length;i++)
        if(ctrl[i].checked) return ctrl[i].value;
}

//presupuestador de housing
 conFireware=new Array();
 sinFireware=new Array();
 conFireware[0]='Transferencia 100 GB/mes (30&euro;/mes)';
 conFireware[1]='Transferencia 500 GB/mes (90&euro;/mes)';
 conFireware[2]='Caudal 1Mbps (acum) (30&euro;/mes)';
 sinFireware[0]='Transferencia 100 GB/mes (25&euro;/mes)';
 sinFireware[1]='Transferencia 500 GB/mes (75&euro;/mes)';
 sinFireware[2]='Caudal 1Mbps (acum) (25&euro;/mes)';
 
 function changeForCon(){ //tratar de usar changeSelect de Dedicadios?
  firewall=document.getElementById('firewall').checked;
  
  
  nodeSelect=document.getElementById('conectividad');
  nodeOptions=nodeSelect.getElementsByTagName('option');
  
  optionSelect=nodeSelect.selectedIndex;
  
  if(firewall){arrayAsociado=conFireware}
  else{arrayAsociado=sinFireware}
  
  for(i=0;i<=nodeOptions.length;i++){ 
   i=0;
   if(nodeOptions[i]){
    nodeSelect.removeChild(nodeOptions[i]);
   }
  } 
  
  for(i=0;i<3;i++){
   newOption=document.createElement('option');
   newOption.setAttribute('value', i);
   newOption.innerHTML=arrayAsociado[i]; //posibilidad de no uso de innerHTML?
   nodeSelect.appendChild(newOption);
  }
  
  nodeSelect.selectedIndex=optionSelect;
 }
 
function writerHosting() {
    selecCon=document.getElementById('conectividad').selectedIndex;
 
    
    firewallSel=document.getElementById('firewall').checked;
    
    if(firewallSel){
    txtCon=conFireware[selecCon];
	txtFW='con servicio de Firewall (30 euros/mes).';
    }else{
	txtCon=sinFireware[selecCon];
    txtFW='sin servicio de Firewall.';
    }
	txtCon=txtCon.replace(new RegExp('&euro;','g'),' euros');
    txtFW=txtFW.replace(new RegExp('&euro;','g'),' euros');
	
     document.form1.msg.value = "Deseo información sobre la contratación del servicio de Housing con las siguientes características: \n\n Alojamiento: " + document.form1.alojamiento.value + "\n\n Fórmula de conectividad: " + txtCon +' '+txtFW;
}