	var J=document.location.pathname.charAt(document.location.pathname.indexOf('.html')-2);
    var K=document.location.pathname.charAt(document.location.pathname.indexOf('.html')-1);
	var fichas=parent.frames["fichas"];
	var menu=parent.frames["menu"];	
    var mes = new Array();
    mes[0] ='enero';
	mes[1] ='febrero';
	mes[2] ='marzo';
	mes[3] ='abril';
	mes[4] ='mayo';
	mes[5] ='junio';
	mes[6] ='julio';
	mes[7] ='agosto';
	mes[8] ='septiembre';
	mes[9] ='octubre';
	mes[10]='noviembre';
	mes[11]='diciembre';
	
	var sem = new Array();
	sem[0]='domingo';
	sem[1]='lunes';
	sem[2]='martes';
	sem[3]='miércoles';
	sem[4]='jueves';
	sem[5]='viernes';
	sem[6]='sábado';
	function Ajustamenu (j,k) {
	  if ((menu != null) && (fichas != null)) {
       if (menu.document.location.pathname.indexOf("menu"+j+".html",0)==-1) {
	      menu.document.location.replace("../menu"+j+".html");
	    }
	    if (k!=0) {
	      menu.Marca(k);
	    } else {
	       fichas.Vista("menu","marca","no");
	    }
	  } 
   }
   function Cabecera(t,x,y,w) {
      x0 = 100+x;
	  y0 = 130+y;
	  if (w!='') {
	    w0=w-x
	  } else {
	    w0=600-x
	  }
	  h0 = 450-y; 

	  
      if (t == null) {
	     document.writeln('</div>');
		 document.writeln('<a href="../index.html" target="_blank">'); 
		 document.writeln('<img src="../graficos/logo.jpg" alt="" width="90px" border="0" align="left"  style="POSITION:absolute; TOP:0px; LEFT:0px">');
         document.writeln('<img src="../graficos/casapasteles2.gif" style="POSITION:absolute; TOP:20px; LEFT:105px; border:0" > </img></a>');
		 document.write('<a style="POSITION:absolute; TOP:10px; RIGHT:10px" href="../notalegal.html" target="popup" ');
         document.writeln('onClick="popup=window.open(this.href, this.target, \'resizable=no,width=600,height=400,toolbar=no,directories=no,menu=no,scrollbars=yes, top=50, left=50\'); return false;">Nota&nbsp;legal</a>');
	     document.writeln('<I style="POSITION:absolute; TOP:90px; LEFT:112px;font-size:12px">');
         document.writeln('fundada&nbsp;en&nbsp;1.928</I>');
		 document.writeln('<a href="../index.html" target="_blank" style="POSITION:absolute; TOP:90px; RIGHT:10px">www.casapasteles.es</a>'); 
		/* document.writeln('<h4 align="center" style= "width:500px; position:absolute; top:110px; left:113px; color:black;">Plaza&nbsp;Larga&nbsp;1,&nbsp;18010&nbsp;Granada.&nbsp;Teléfono&nbsp;958&nbsp;27&nbsp;89&nbsp;97 </h4>'); */
     	 document.writeln('<div class=conmargen style="position:absolute; top:'+y0+'px; left:'+x0+'px; width:'+w0+'px; height:'+h0+'px">');

         
	  }
   }

    function Cambia(s,c1,c2){
	  var s1=s;
	  n1=s1.indexOf(c1);
	  while (n1>=0) {
	    s1=s1.substring(0,n1)+c2+s1.substring(n1+1,s1.length);
		n1=s1.indexOf(c1);
	  }
	  return s1
	}
	function Limpia(s){
	  var i;
	  var s2=Cambia(s.toLowerCase(),' ','');
      if (s2.indexOf('(')>0) {
	     s2=s2.substring(0,s2.indexOf('('));
	 }
	  s2=Cambia(s2,'á','a');
	  s2=Cambia(s2,'é','e');
	  s2=Cambia(s2,'í','i');
	  s2=Cambia(s2,'ó','o');
	  s2=Cambia(s2,'ú','u');
	  s2=Cambia(s2,'ü','u');
	  s2=Cambia(s2,'ñ','n');
	  return s2;
	}

	function Inicial(s){
	   return s.substring(0,1).toUpperCase()+s.substring(1);
	}
    function Param(f,c){
        nmes=f.getMonth();
		nsem=f.getDay();
		ndia=f.getDate();
		nano=f.getYear();
		
	    if (c=='s'){
		    return sem[nsem];
		} else if (c=='S') {
		    return Inicial(sem[nsem]);
		} else if (c=='m'){
		    return mes[nmes];
		} else if (c=='M') {
		    return Inicial(mes[nmes]);
		} else if (c=='d') {
		    return ndia+'';
		} else if (c=='D') {
	        if (ndia<10) {return '0'+ndia;}
			else return ndia+'';
		} else if (c=='a') {
		    return (nano % 100)+'';
		} else if (c=='A') {
		    return (nano)+'';
		} else if (c=='n') {
		    return (nmes+1)+''
		} else if (c=='N') {
		    if (nmes>=9) {
			   return (nmes+1)+''
			} else { return '0'+(nmes+1)}
		}
  	}

	function FStr(f,s){
	   var a_sub = s.split('%');
	   s1=a_sub[0];
	   for (i=1;i<a_sub.length;i++){
	      s1=s1+Param(f,a_sub[i].substring(0,1)) + a_sub[i].substring(1,a_sub[i].length);}
	   return s1;
	   
	}
    function Mensaje(i){
	   if ( Date.parse(msj[i].f1)<=Date.parse(Date()) && Date.parse(Date())<=Date.parse(msj[i].f2)) {
	      document.writeln(FStr(new Date(msj[i].f),msj[i].texto));

	   }
	}