// JavaScript Document

var dom = document.getElementById ? true:false;
var nn4 = document.layers ? true:false;
var ie4 = document.all ? true:false;
var nn = document.layers ? true:false;
var ie = document.all ? true:false;

var rutaweb=location.pathname 
var carp=''
var auxnivel='';


function countLetter (string, letter) {
  var n = 0;  var p = 0;
  while ((p = string.indexOf(letter, p) + 1) != 0)
    n++;
  return n;
}
if (location.href.indexOf('_www')>-1) {
	posref=location.href.indexOf("_www");
	posref=eval(posref+5);
	rutaweb=location.href.substring(0,posref)+'novedades-promo/';
	carpeta=location.href.substring(posref,location.href.length);
	if (carpeta.indexOf("/")>-1) auxnivel=countLetter(carpeta,'/');
	if (carpeta.indexOf("\\")>-1) auxnivel=countLetter(carpeta,'\\');
	if (!auxnivel) nivel=0;
	else	nivel=auxnivel
} else {
	
	
	
	if (location.href.indexOf('.com')>-1) {
	
		if (location.href.indexOf('movistar.es')>-1) {
				posref=location.href.indexOf("movistar.es")
				posref=eval(posref+12);
		}  else {

	
			if (location.href.indexOf('.com.es')>-1) {	
				posref=location.href.indexOf(".com.es")
				posref=eval(posref+8);
			} else {
				posref=location.href.indexOf(".com")
				posref=eval(posref+5);
			}
		} 
	} 
	
	if (location.href.indexOf('.net')>-1) {
		posref=location.href.indexOf(".net")
		posref=eval(posref+5);
	} 
	if (location.href.indexOf('.org')>-1) {
		posref=location.href.indexOf(".org")
		posref=eval(posref+5);
	} 
	if (location.href.indexOf('.biz')>-1) {
		posref=location.href.indexOf(".biz")
		posref=eval(posref+5);
	} 
	if (location.href.indexOf('.info')>-1) {
		posref=location.href.indexOf(".info")
		posref=eval(posref+6);
	} 
	if (location.href.indexOf('.name')>-1) {
		posref=location.href.indexOf(".name")
		posref=eval(posref+6);
	} 
	if (location.href.indexOf('.es')>-1) {
		posref=location.href.indexOf(".es")
		posref=eval(posref+4);
	} 
	
	
	

	if (location.href.indexOf('prepubmovistar.tsm.inet')>-1) {
		posref=location.href.indexOf("prepubmovistar.tsm.inet")
		posref=eval(posref+24);
	}
	
	
	rutaweb=location.href.substring(0,posref)+'novedadesypromociones/'
	carpeta=location.href.substring(posref,location.href.length)
	if (carpeta.indexOf("/")>-1) auxnivel=countLetter(carpeta,'/')
	if (carpeta.indexOf("\\")>-1) auxnivel=countLetter(carpeta,'\\')
	if (!auxnivel) nivel=0;
	else nivel=auxnivel
	
						
}


for (var j = 1; j < nivel; ++j) {
		carp+='../'
}
								
ruta=rutaweb+carp;
								



function MostrarFecha()
   {
   var nombres_dias = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado")
   var nombres_meses = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre")
   var fecha_actual = new Date()
   dia_mes = fecha_actual.getDate() 
   dia_semana = fecha_actual.getDay() 
   mes = fecha_actual.getMonth() + 1
   anio = fecha_actual.getFullYear()
	 lafecha='<span class="azulfecha">'+nombres_dias[dia_semana]+'</span><span class="itemmenunivel3">|</span><span class="azulfecha"><strong>'+dia_mes+'</strong></span><span class="itemmenunivel3">|</span><span class="azulfecha">'+nombres_meses[mes - 1]+'</span> '
   

     document.write(lafecha)
   }
function MostrarHora() {
   var fecha_actual = new Date()
   hora = fecha_actual.getHours()
  
   minuto = fecha_actual.getMinutes()
   if (minuto<10)  minuto='0'+minuto
   
	
	document.write(hora+':'+minuto)
}


var storedValue ;
var menumm='';
var menummon='';
var primernivelactivo=-1;
var segundonivelactivo=-1;
var ultimaopcioncargada=-1;
var menuabierto=0
var opcionforzada1=-1
var opcionforzada2=-1

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
	obj.visibility=v; }
}


function item(nombre, parent, text, descrip,depth,clink,flash,htmlbotones) {
        this.nombre = nombre // is this item a parent?
	    this.parent = parent // is this item a parent?
        this.text = text // text for link (may include HTML)
  		this.descrip = descrip // text for link (may include HTML)
        this.depth = depth // nested depth
		this.clink = clink // nested depth
		this.flash = flash 
		this.htmlbotones = htmlbotones 
}

////FUNCIONES GABI/////


function imprime(){
  cadena=document.location.href;
  nombre=('imp-'+cadena.slice(cadena.lastIndexOf('/')+1));
  imp=window.open(nombre,'imprimir','resizable=no,scrollbars=yes,toolbar=no,location=no,menu=no,Width=580,Height=350,');
 // imp.print();
}


function mifuncion() {
	self.print();
	setTimeout ('cerrado ()', 5000); 
}

function cerrado() {
	self.close();
}

////FIN FUNCIONES GABI/////




function setStates() {
        // assign current cookie to local variable
        var storedValue = menumm

        // if desired cookie not found (null)
        
        if (!storedValue) {
                // set states to default if no cookie found
                for (var i = 0; i < arbol.length; ++i) {
                        // only topmost level is visible by default
                        if (arbol[i].depth == 0)
                                arbol[i].state = true
                        else
                                arbol[i].state = false
                }
        } else {
                // extract current states from cookie (0 => false, 1 => true)
                for (var i = 0; i < arbol.length; ++i) {
                
                
                        if (storedValue.charAt(i) == '1') {
	                      
                                arbol[i].state = true
                        } else {
                                arbol[i].state = false
                        }
                }
        }
}

function setImages() {

        for (var i = 0; i < arbol.length; ++i) {
                if (arbol[i].state)
                        if (arbol[i].parent) { // arbol[i] is a parent
                                if (arbol[i + 1].state) // arbol[i] is exploded
                                        arbol[i].pic = '<A HREF="javascript:toggle(' + i + ')"><IMG SRC="'+carp+'imgs/item-menos.gif" BORDER=0></A>'
                                else // arbol[i] is collapsed
                                        arbol[i].pic = '<A HREF="javascript:toggle(' + i + ')"><IMG SRC="'+carp+'imgs/item-mas.gif" BORDER=0></A>'
                        } else {
                                
                                if (arbol[i].depth==1) arbol[i].pic = '<IMG SRC="'+carp+'imgs/ico-menu-item.gif" BORDER=0>'
                                if (arbol[i].depth==2) arbol[i].pic = '<IMG SRC="'+carp+'imgs/ico-menu-secc4.gif" BORDER=0>'
                        }
        }
}

function toggle(num) {
		 if (isNaN(num)) {

		for (var i = 0; i < arbol.length; ++i) {
			if (arbol[i].nombre==num) {
				num=i;
				break;
			}
		}
	  }

	if (!isNaN(num)) {
		
					if (menuabierto!=1) {
						if ((arbol[num].depth==0) && (ultimaopcioncargada!=num) ){
							
							for (var i = 0; i < arbol.length; ++i) {
								if (arbol[i].depth == 0)
									arbol[i].state = true
								else
									arbol[i].state = false;
							}
							

							
							
						}
					}
					
				
			
					for (var i = num + 1; i < arbol.length && arbol[i].depth >= arbol[num].depth + 1; ++i) {
							if (arbol[i].depth == arbol[num].depth + 1) {
								arbol[i].state = !arbol[i].state;
							} else {
								arbol[i].state=false;
							}
					}


					if ((arbol[num].depth==0) && (primernivelactivo>-1) && (ultimaopcioncargada!=num) ) {
						
						for (var i = primernivelactivo + 1; i < arbol.length && arbol[i].depth >= arbol[primernivelactivo].depth + 1; ++i) {
									arbol[i].state=false;
						}	
					
					}



					if ((arbol[num].depth==1) && (segundonivelactivo>-1) && (segundonivelactivo!=num)) {
						for (var i = segundonivelactivo + 1; i < arbol.length && arbol[i].depth >= arbol[segundonivelactivo].depth + 1; ++i) {
							
								
									arbol[i].state=false;
								
						}	
						
					}
					
					if (arbol[num].depth==0)  { 
						primernivelactivo=num;segundonivelactivo=-1
					} else {
						if (arbol[num].depth==1)  segundonivelactivo=num
						
					}
					ultimaopcioncargada=num
					
	
	  }
        setStorage(num)
        creararbol();
        pintamenu();
		//if (primernivelactivo>0) alert('primernivelactivo:'+eval('arbol['+primernivelactivo+'].text'))

		//if (segundonivelactivo>0) alert('segundonivelactivo:'+eval('arbol['+segundonivelactivo+'].text'))
		//if (ultimaopcioncargada>0) alert('ultimaopcioncargada:'+eval('arbol['+ultimaopcioncargada+'].text'))
		

}


function pintamenu(){
	
	// En esta funcion podemos quitar el tiker en la linea 372 
	
	actual= menummon
	
	gestion=0
	
		
	textohtml=''
		
	textohtml='<table width="203" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" background="'+carp+'imgs/fondo-menu.gif"><a href="'+carp+'index.html" title="Novedades y Promociones"><img src="'+carp+'imgs/espacio.gif" width="203" height="45" alt="Novedades y Promociones"  border="0" title="Novedades y Promociones"></a><table width="184" border="0" cellpadding="0" cellspacing="0" background="'+carp+'imgs/espacio.gif">'
	//con ticker       textohtml='<table width="203" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" background="'+carp+'imgs/fondo-menu-ticker.gif"><a href="'+carp+'index.htm" title="Novedades y Promociones"><img src="'+carp+'imgs/espacio.gif" width="203" height="38" alt="Novedades y Promociones"  border="0" title="Novedades y Promociones"></a><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="199" height="15"><param name="movie" value="'+carp+'imgs/tiquer.flash"><embed src="'+carp+'imgs/tiquer.flash" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="199" height="15"></embed></object><br><br><table width="184" border="0" cellpadding="0" cellspacing="0" background="'+carp+'imgs/espacio.gif">'

	

	for (var i = 0; i < arbol.length; ++i) {

 
 
		 
		 if ((arbol[i].text!="MENUGESTION") && (arbol[i].text!="ESPACIO")) {
		 
				if (arbol[i].state){
			
					
					
					if (arbol[i].text.indexOf("<img")>-1){
						cestilo='itemmenu'; 
						textohtml+='<tr><td bgcolor="#FFFFFF"><img src="'+carp+'imgs/iconar1.gif" width="12" height="16"></td><td colspan="2"  width="250"><a href="javascript:toggle(' + i + ')"  alt="'+arbol[i].nombre+'" >'+arbol[i].text+'</a></td></tr>';
					} else {
						
						if ( ((actual==i) || (opcionforzada1==i) || (opcionforzada2==i)) && (primernivelactivo>-1) && (arbol[0].state==1)) {
							
							if (arbol[i].depth==0) { cestilo='menuAzul'; textohtml+='<tr><td width="20" align="center" background="'+carp+'imgs/espacio.gif"><img src="'+carp+'imgs/ico-estrella-on.gif" alt="" name="icon'+i+'" title=""></td><td width="164" height="27" background="'+carp+'imgs/espacio.gif" bgcolor="#FAFAFA" class="menu"><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td align="left" class="menu">'}
							
							texxxto= '&nbsp;<span class="'+cestilo+'"><b>'+arbol[i].text+'</b></span>'
							texxxto2= '&nbsp;<span class="menu"><b>'+arbol[i].descrip+'</b></span>'
									
						} else {
		
		
							if (arbol[i].depth==0) { cestilo='menuVerde'; textohtml+='<tr><td width="20" align="center" background="'+carp+'imgs/espacio.gif"><img src="'+carp+'imgs/ico-estrella.gif" alt="" name="icon'+i+'"  title=""></td><td width="164" height="27" background="'+carp+'imgs/espacio.gif" bgcolor="#FAFAFA" class="menu"><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td align="left" class="menu">'}
							if ((i==segundonivelactivo) ) {
								texxxto= '&nbsp;'+arbol[i].text
								texxxto2=  '&nbsp;'+arbol[i].descrip
								
							} else {
								texxxto= '&nbsp;'+arbol[i].text
								texxxto2=  '&nbsp;'+arbol[i].descrip
								
							}

							
							
					
						}
					
						
						
						if (arbol[i].clink!='') {
							if (arbol[i].clink.indexOf('script')>-1){ 
							
								textohtml+='<a href="javascript:;" onclick="'+carp+arbol[i].clink+'" title="'+arbol[i].text+'" class="'+cestilo+'"  onMouseOver="MM_swapImage('+comilla+'icon'+i+comilla+','+comilla+''+comilla+','+comilla+carp+'imgs/ico-estrella-on.gif'+comilla+',1)" onMouseOut="MM_swapImgRestore()">'+texxxto+'<br><span class="menu">'+texxxto2+'</span></a></td></tr></table></td></tr>'
							} else {
								
								if (arbol[i].clink.indexOf('http')>-1){ 
									textohtml+='<a href="'+arbol[i].clink+'" target="_blank" title="'+arbol[i].text+'" class="'+cestilo+'"  onMouseOver="MM_swapImage('+comilla+'icon'+i+comilla+','+comilla+''+comilla+','+comilla+carp+'imgs/ico-estrella-on.gif'+comilla+',1)" onMouseOut="MM_swapImgRestore()">'+texxxto+'<br><span class="menu">'+texxxto2+'</span></a></td></tr></table></td></tr>'								
								} else {
									textohtml+='<a href="'+arbol[i].clink+'"  title="'+arbol[i].text+'" class="'+cestilo+'"  onMouseOver="MM_swapImage('+comilla+'icon'+i+comilla+','+comilla+''+comilla+','+comilla+carp+'imgs/ico-estrella-on.gif'+comilla+',1)" onMouseOut="MM_swapImgRestore()">'+texxxto+'<br><span class="menu">'+texxxto2+'</span></a></td></tr></table></td></tr>'		
							
								}
							}
							
						} else {
							textohtml+='<a href="javascript:toggle(' + i + ');"  title="'+arbol[i].text+'" class="'+cestilo+'"  onMouseOver="MM_swapImage('+comilla+'icon'+i+comilla+','+comilla+''+comilla+','+comilla+carp+'imgs/ico-estrella-on.gif'+comilla+',1)" onMouseOut="MM_swapImgRestore()">'+texxxto+'<br><span class="menu">'+texxxto2+'</span></a></td></tr></table></td></tr>'		
							
						}
					}
					if (arbol[i].depth==0)  textohtml+='<tr><td height="3" colspan="2" background="'+carp+'imgs/espacio.gif"><img src="'+carp+'imgs/separador.gif" width="184" height="3"></td></tr>'
					
				} 
			   }
	
	}

	
	
	textohtml+='</table></td></tr><tr><td><img src="'+carp+'imgs/menu-abajo.gif" width="203" height="10" alt="" title=""></td></tr></table>'
	//alert(textohtml);
	MM_setTextOfLayer('arbol','',''+escape(textohtml))

}

// create items of arbol




function setStorage(numero) {
        // initialize local variable to empty string
        var text = ""

        // loop through all properties of arbol "array"
        for (var i = 0; i < arbol.length; ++i) {
                // use "1" character to represent true state, and "0" for false state
                text += (arbol[i].state) ? "1" : "0"
        }



        menumm= text
	menummon=numero
		
}
 





/////////////////////////////////////////////
/// FUNCIONES DE CENTRADO DE LAS PAGINAS   //
/////////////////////////////////////////////


var nWidth=0;
var nHeight=0;
var nBodyW=0;
var nBodyH=0;



function centrarcapa(nombre,val1,val2){
		if (document.layers) {
			totalwidth=window.innerWidth;
			totalheight=window.innerHeight;
		} else {
			totalwidth=document.body.clientWidth;
			totalheight=document.body.clientHeight;

		}
		val1=eval(val1)
		val2=eval(val2)

		if (window.opera) eval('document.getElementById("'+nombre+'").style.left='+val1)
		if (document.all) eval('document.all("'+nombre+'").style.left='+val1)
		if (document.layers) eval('document.layers["'+nombre+'"].left='+val1)
		if (document.getElementById) { eval('document.getElementById("'+nombre+'").style.left="'+val1+'px"');		}
		
		if (window.opera) eval('document.getElementById("'+nombre+'").style.top='+val2)
		if (document.all) eval('document.all("'+nombre+'").style.top='+val2)
		if (document.layers) eval('document.layers["'+nombre+'"].top='+val2)
		if (document.getElementById) { eval('document.getElementById("'+nombre+'").style.top="'+val2+'px"');		}
		

}
	var nTcontent = 65;	var nLcontent = 305;
function centrar(){

	//if ((ie) || (nn)) {

		if (document.layers){
			nWidth = window.innerWidth/2;
			nHeight = window.innerHeight/2;
		}else{
			nWidth = document.body.clientWidth/2;
			nHeight = document.body.clientHeight/2;
			
		}
		
			nBodyW = nWidth-405;
			nBodyH = nHeight;


		centrarcapa('pagina',nBodyW,nBodyH);
		if (MM_findObj("adornos")) centrarcapa('adornos',nBodyW+10,nBodyH+133);
		centrarcapa('arbol',nBodyW+25,145); //+482
		

	//}

	if (MM_findObj("loading")) MM_showHideLayers('loading','','hide');
	MM_showHideLayers('pagina','','show','arbol','','show','adornos','','show');


}


function abrirbuscar(mifrm){  
  
  var texque=MM_findObj("txtbuscar").value	
  
  if (texque=="" || null){  
    alert("Introduce un texto a buscar")
    //mifrm.txtbuscar.focus
  }else{  
 
    
    	texque = texque.replace(/'/g, '')
    	texque = texque.replace(/-/g, '')
    	texque = texque.replace(/\(/g, '')
    	texque = texque.replace(/\)/g, '')
    	texque = texque.replace(/</g, '')
    	texque = texque.replace(/>/g, '')
    	texque = texque.replace(/%/g, '')
    	texque = texque.replace(/\*/g, '')
	texque = texque.replace(/\"/g, '')
    
    
	//var url="http://www.movistar.es/buscador/index.htm?claves="+escape(texque)
    var idv=window.open ("http://www.movistar.es/buscador?claves="+(texque), "Buscador", "scrollbars=yes,status=yes,width=790,height=560,screenX=0,screenY=0")

    idv.focus()
  }  

}


function imprimir(){
  cadena=document.location.href;
  nombre=('imp-'+cadena.slice(cadena.lastIndexOf('/')+1));
  imp=window.open(nombre,'imprimir','resizable=no,scrollbars=yes,toolbar=no,location=no,menu=no,Width=580,Height=350,');
 // imp.print();
}



function escribefechahora(){
	
	var fecha_actual = new Date(); hora = fecha_actual.getHours(); minuto = fecha_actual.getMinutes();  if (minuto<10)  minuto='0'+minuto; 
	htmlfecha='<span class="hora">'+hora+':'+minuto+'&nbsp;</span>';
	var nombres_dias = new Array("Domingo", "Lunes", "Martes", "Mi&eacute;rcoles", "Jueves", "Viernes", "S&aacute;bado"); var nombres_meses = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");var fecha_actual = new Date();dia_mes = fecha_actual.getDate();dia_semana = fecha_actual.getDay();mes = fecha_actual.getMonth() + 1;anio = fecha_actual.getFullYear();lafecha= nombres_dias[dia_semana] + ", <b>" + dia_mes + "</b> de " + nombres_meses[mes - 1]; 
	htmlfecha+='<span class="grisfecha">'+lafecha.toLowerCase()+'</span>'
	return htmlfecha
	
}
function escribecabecera(){
	comilla="'";

	var htmltop="<table width='774' height='134' border='0' cellpadding='0' cellspacing='0'>"
	htmltop+="<tr>"
	htmltop+="<td width='168' height='63' rowspan='2' valign='bottom'><a href='http://www.movistar.es' tabindex='1'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_logo-movistar.gif' alt='Movistar' width='168' height='63' hspace='0' vspace='0' border='0' /></a></td>"
	htmltop+="<td height='27' colspan='2' valign='top'><table width='402' height='27' border='0' align='right' cellpadding='0' cellspacing='0'>"
	htmltop+="<tr>"
	htmltop+="<td width='56' align='center' valign='middle'><a href='http://www.movistar.es/media/contacta/contacta-particulares.htm' class='topmenu' title='Contacta' tabindex='2'>Contacta</a></td>"
	htmltop+="<td align='center'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_divis-sup.gif' alt='division' width='1' height='27' /></td>"
	htmltop+="<td width='101' align='center' valign='middle'><a href='http://www.atencionenlinea.movistar.es/particulares/tarifas.htm' class='topmenu' title='Atenci&oacute;n en L&iacute;nea' tabindex='3'>Atenci&oacute;n en L&iacute;nea</a></td>"
	htmltop+="<td align='center'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_divis-sup.gif' alt='division' width='1' height='27' /></td>"
	htmltop+="<td width='59' align='center' valign='middle'><a href='http://www.movistar.es/accesible/'  class='topmenu' target='_blank' title='Accesible' tabindex='4'>Accesible</a></td>"
	htmltop+="<td align='center'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_divis-sup.gif' alt='division' width='1' height='27' /></td>"
	htmltop+="<td width='41' align='center' valign='middle'><a href='http://www.movistar.es/media/mapa/mapa.htm' class='topmenu' title='Mapa' tabindex='5'>Mapa</a></td>"
	htmltop+="<td><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_divis-sup.gif' alt='division' width='1' height='27' /></td>"
	htmltop+="<td width='141' valign='middle'>&nbsp;<a href='#' style='color:#1E84CF;font-family:Arial, Helvetica, sans-serif;font-size:10px;"
	htmltop+="text-decoration:none;' title='Buscador' tabindex='6'>Buscador</a></span>"
	htmltop+="  <input type='text' name='txtbuscar' id='txtbuscar' accesskey='b' tabindex='6' class='inputbuscador'>"
	htmltop+="<a href='javascript:abrirbuscar();' tabindex='6'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_flecha-buscador.gif' alt='Buscar' width='13' height='18' border='0' align='absmiddle' /></a></td>"
	htmltop+="</tr>"
	htmltop+="</table></td>"
	htmltop+="</tr>"
	htmltop+="<tr>"
	htmltop+="<td width='528' height='36' valign='bottom' background='http://www.movistar.es/staticFiles/cda/movistar_es_cn_fondo-cabecera.gif'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_pixel.gif' alt='blanco' width='200' height='36' border='0' /></td>"
	htmltop+="<td height='36' align='right' valign='bottom'><a href='http://www.telefonica.es' target='_blank' tabindex='7'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_logo-telefonica.gif' alt='Telef&oacute;nica' width='85' height='36' border='0' /></a></td>"
	htmltop+="</tr>"
	htmltop+="<tr>"
	htmltop+="<td height='20' colspan='3' background='http://www.movistar.es/staticFiles/cda/movistar_es_cn_fondo-vertical.gif' valign='top'><table width='759' height='20' border='0' align='right' cellpadding='0' cellspacing='0'>"
	htmltop+="<tr>"
	htmltop+="<td width='339' align='left'>"+escribefechahora()+"</td>"
	htmltop+="<td width='104'><a href=\"http://www.movistar.es\" alt='Particulares' title='Particulares' tabindex='8' ><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_solapaparticulares-on.gif' alt='Particulares'  name='solaparticulares' width='104' height='20' border='0' id='solaparticulares' /></a></td>"
	htmltop+="<td width='175'><a href=\"http://www.movistar.es/empresas/\" alt='Empresas y Profesionales' title='Empresas y Profesionales' onmouseover=\"MM_swapImage('solapaempresas','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_solapaempresas-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='9'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_solapaempresas.gif' alt='Empresas y Profesionales'  name='solapaempresas' width='175' height='20' border='0' id='solapaempresas' /></a></td>"
	htmltop+="<td width='140'><a href=\"http://www.empresa.movistar.es/\" onmouseover=\"MM_swapImage('solapaconoce','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_solapaconoce-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" alt='Conoce la Empresa' title='Conoce la Empresa' tabindex='10'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_solapaconoce.gif' alt='Conoce la Empresa'  name='solapaconoce' width='140' height='20' border='0' id='solapaconoce' /></a></td>"
	htmltop+="</tr>"
	htmltop+="</table></td>"
	htmltop+="</tr>"
	htmltop+="<tr>"
	htmltop+="<td height='51' colspan='3'><table width='761' border='0' align='right' cellpadding='0' cellspacing='0'>"
	htmltop+="<tr>"
	htmltop+="<td width='95'><a href=\"http://www.movistar.es/particulares/tarifasycontratos\" onmouseover=\"MM_swapImage('tarifas','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_tarifas-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='11'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_tarifas.gif' alt='Tarifas y Contratos' name='tarifas' width='97' height='51' border='0' id='tarifas' /></a></td>"
	htmltop+="<td width='95'><a href=\"https://www.canalcliente.movistar.es/\" tabindex='12' onmouseover=\"MM_swapImage('ccliente','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_ccliente-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\"><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_ccliente.gif' alt='Canal Cliente' name='ccliente' width='95' height='51' border='0' id='ccliente' /></a></td>"
	htmltop+="<td width='95'><a href=\"http://www.movistar.es/particulares/recarga\" onmouseover=\"MM_swapImage('recarga','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_recarga-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='13'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_recarga.gif' alt='Recarga y Saldo' name='recarga' width='95' height='51' border='0' id='recarga' /></a></td>"
	htmltop+="<td width='95'><a href=\"http://www.movistar.es/particulares/servicios\" onmouseover=\"MM_swapImage('tusservicios','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_tusservicios-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='14'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_tusservicios.gif' alt='Tus Servicios' name='tusservicios' width='95' height='51' border='0' id='tusservicios' /></a></td>"
	htmltop+="<td width='95'><a href=\"http://www.movistar.es/particulares/servicios/hablacualquierpais/roaming\" onmouseover=\"MM_swapImage('internac','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_internac-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='15'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_internac.gif' alt='Internacional y Roaming' name='internac' width='95' height='51' border='0' id='internac' /></a></td>"
	htmltop+="<td width='95'><a href=\"http://www.movistar.es/particulares/renueva\" onmouseover=\"MM_swapImage('renueva','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_renueva-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='16'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_renueva.gif' alt='Renueva tu m&oacute;vil' name='renueva' width='95' height='51' border='0' id='renueva' /></a></td>"
	htmltop+="<td width='95'><a href=\"http://www.movistar.es/particulares/portabilidad\" onmouseover=\"MM_swapImage('venams','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_venams-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='17'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_venams.gif' alt='Ven a movistar' name='venams' width='95' height='51' border='0' id='venams' /></a></td>"
	htmltop+="<td width='102'><a href=\"https://www.tu-tienda.movistar.es/index.html?origen=P\" onmouseover=\"MM_swapImage('tutienda','','http://www.movistar.es/staticFiles/cda/movistar_es_cn_tutienda-on.gif',1)\" onmouseout=\"MM_swapImgRestore()\" tabindex='18'><img src='http://www.movistar.es/staticFiles/cda/movistar_es_cn_tutienda.gif' alt='Tu Tienda' name='tutienda' width='93' height='51' border='0' id='tutienda' /></a></td>"
	htmltop+="</tr>"
	htmltop+="</table></td>"
	htmltop+="</tr>"
	htmltop+="</table>"
	
	return htmltop
	
}


function escribepie(){
htmlpie='<table width='+comilla+'100%'+comilla+' border='+comilla+'0'+comilla+' cellpadding='+comilla+'0'+comilla+' cellspacing='+comilla+'0'+comilla+'><tr><td width='+comilla+'31'+comilla+'>&nbsp;</td><td><table align='+comilla+'left'+comilla+' border='+comilla+'0'+comilla+' cellpadding='+comilla+'0'+comilla+' cellspacing='+comilla+'0'+comilla+' width='+comilla+'759'+comilla+'> <tbody><tr> <td colspan='+comilla+'3'+comilla+'><img src='+comilla+'/staticFiles/cda/movistar_es_espacio.gif'+comilla+' alt='+comilla+''+comilla+' title='+comilla+''+comilla+' height='+comilla+'20'+comilla+' width='+comilla+'500'+comilla+'></td> </tr> <tr><td colspan='+comilla+'3'+comilla+' bgcolor='+comilla+'#ebf2f6'+comilla+'><img alt='+comilla+comilla+' src='+comilla+'/staticFiles/cda/movistar_es_espacio.gif'+comilla+' width='+comilla+'1'+comilla+' height='+comilla+'10'+comilla+'/></td></tr> <tr> <td colspan='+comilla+'3'+comilla+'> <table> <tbody><tr> <td><img alt='+comilla+''+comilla+' src='+comilla+'/staticFiles/cda/movistar_es_espacio.gif'+comilla+' height='+comilla+'1'+comilla+' width='+comilla+'20'+comilla+'></td> <td valign='+comilla+'middle'+comilla+'><a href='+comilla+'http://www.telefonicaonline.com/on/pub/ServNav?servicio=promocion&amp;c=5967'+comilla+' target='+comilla+'_blank'+comilla+'><img src='+comilla+'/staticFiles/cda/movistar_es_telefonicafija_.gif'+comilla+' alt='+comilla+'servicios para tu línea fija'+comilla+' title='+comilla+'servicios para tu línea fija'+comilla+' border='+comilla+'0'+comilla+' height='+comilla+'22'+comilla+' width='+comilla+'386'+comilla+'></a></td> <td style='+comilla+'font-size: 11px;'+comilla+' align='+comilla+'left'+comilla+'><a href='+comilla+'http://www.telefonicaonline.com/on/pub/ServNav?servicio=promocion&amp;c=5967%20'+comilla+' target='+comilla+'_blank'+comilla+' class='+comilla+'gris'+comilla+' title='+comilla+'servicios para tu línea fija'+comilla+' style='+comilla+'font-size:11px;text-decoration:none'+comilla+'> descubre todos los servicios de adsl, telefonía y televisión<br> que te ofrece <strong> telefónica para la línea fija de tu hogar.</strong></a></td> </tr> </tbody></table> </td> </tr> <tr> <td colspan='+comilla+'3'+comilla+'><img alt='+comilla+''+comilla+' src='+comilla+'/staticFiles/cda/movistar_es_espacio.gif'+comilla+' height='+comilla+'10'+comilla+' width='+comilla+'1'+comilla+'></td> </tr> <tr> <td colspan='+comilla+'3'+comilla+' bgcolor='+comilla+'#ebf2f6'+comilla+'><img alt='+comilla+''+comilla+' src='+comilla+'/staticFiles/cda/movistar_es_espacio.gif'+comilla+' height='+comilla+'10'+comilla+' width='+comilla+'1'+comilla+'></td> </tr> <tr> <td colspan='+comilla+'3'+comilla+'><img src='+comilla+'/staticFiles/cda/movistar_es_espacio.gif'+comilla+' alt='+comilla+''+comilla+' title='+comilla+''+comilla+' height='+comilla+'9'+comilla+' width='+comilla+'500'+comilla+'></td> </tr> <tr> <td align='+comilla+'right'+comilla+' width='+comilla+'46'+comilla+'> &nbsp;</td> <td class='+comilla+'palopie'+comilla+' align='+comilla+'center'+comilla+' height='+comilla+'27'+comilla+' valign='+comilla+'middle'+comilla+' width='+comilla+'651'+comilla+'><a href='+comilla+'javascript:;'+comilla+' class='+comilla+'pie'+comilla+' title='+comilla+'Aviso Legal'+comilla+' onclick='+comilla+'MM_openBrWindow(\'/legal/texto\',\'legal\',\'scrollbars=yes,resizable=yes\',\'560\',\'329\',\'true\')'+comilla+'>Aviso Legal</a> | <a href='+comilla+'javascript:;'+comilla+' class='+comilla+'pie'+comilla+' title='+comilla+'Web Protección de Datos'+comilla+' onclick='+comilla+'MM_openBrWindow(\'/legal/prodatos\',\'legal\',\'scrollbars=yes,resizable=yes\',\'560\',\'329\',\'true\')'+comilla+'>Web Protección de Datos</a> | <a href='+comilla+'javascript:;'+comilla+' class='+comilla+'pie'+comilla+' title='+comilla+'Telefónica Móviles España S.A.U.'+comilla+' onclick='+comilla+'MM_openBrWindow(\'/legal/legal\',\'legal\',\'scrollbars=yes,resizable=yes\',\'560\',\'329\',\'true\')'+comilla+'>Telefónica Móviles España S.A.U.</a> | <a href='+comilla+'javascript:;'+comilla+' class='+comilla+'pie'+comilla+' title='+comilla+'Optimizado Para...'+comilla+' onclick='+comilla+'MM_openBrWindow(\'/legal/optimizado\',\'legal\',\'scrollbars=yes,resizable=yes\',\'560\',\'329\',\'true\')'+comilla+'>Optimizado Para...</a>  </td> <td class='+comilla+'palopie'+comilla+' align='+comilla+'right'+comilla+' valign='+comilla+'bottom'+comilla+' width='+comilla+'57'+comilla+'><a href='+comilla+'http://www.confianzaonline.org'+comilla+' target='+comilla+'_blank'+comilla+'><img src='+comilla+'/staticFiles/cda/movistar_es_confianzaonline.gif'+comilla+' alt='+comilla+'Confianza Online'+comilla+' valign='+comilla+'top'+comilla+' border='+comilla+'0'+comilla+' vspace='+comilla+'2'+comilla+'></a></td> </tr> <tr> <td></td> </tr> </tbody></table><map name='+comilla+'piesuperior'+comilla+' id='+comilla+'piesuperior'+comilla+'><area shape='+comilla+'rect'+comilla+' coords='+comilla+'89,12,268,32'+comilla+' href='+comilla+'http://www.movistar.es/novedadesypromociones/index.html'+comilla+' alt='+comilla+'NOVEDADES Y PROMOCIONES'+comilla+'><area shape='+comilla+'rect'+comilla+' coords='+comilla+'390,13,463,33'+comilla+' href='+comilla+'http://www.movistar.es/emocion/'+comilla+' alt='+comilla+'emoción'+comilla+'><area shape='+comilla+'rect'+comilla+' coords='+comilla+'469,12,578,32'+comilla+' href='+comilla+'http://www.movistar.es/espacio/index.html?hunica'+comilla+' alt='+comilla+'espacio movistar'+comilla+'><area shape='+comilla+'rect'+comilla+' coords='+comilla+'583,12,681,32'+comilla+' href='+comilla+'http://www.movistar.es/martesdecine/index.html?hunica'+comilla+' alt='+comilla+'martes de cine'+comilla+'></map></td></tr></table>'

	//MM_setTextOfLayer('zonapie','',''+(htmlpie))
	return htmlpie

}

function abreflot(numero){
	
	switch (numero)
	{
		case 1:
			MM_openBrWindow('flot/legal-pasalo1.htm','pas1','scrollbars=no','480','360','true')
		break;
		
		case 2:
			MM_openBrWindow('flot/legal-pasalo2.htm','pas2','scrollbars=no','480','355','true')
		break;
	}
	
	
}






