// FECHA
function fecha() {
    var ndia = new Array('Domingo','Lunes','Martes','Miercoles','Jueves','Viernes','Sabado')
    var nmes = new Array('enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre')
    var ahora
    var fechadehoy = new Date()
    var ano = fechadehoy.getYear()
    var mes = fechadehoy.getMonth()
    var dia = fechadehoy.getDay()
    var aux = "" + fechadehoy

    if (ano<10)  ano2 = "200" + eval(ano);
    else if (ano<80) ano2 = "20" + ano;
    else if (ano<=99) ano2 = "19" + ano;
    else if (ano<1000) ano2 = eval(ano) + eval(1900);
    else ano2 = ano;

    ahora = ndia[dia] + ", " + eval(aux.substring(7, 10)) + " de " + nmes[mes] + " de " + ano2;
    return ahora;
}

// JavaScript Document
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 abreFoto(s) {
   var fotoWin = window.open("","sierradefrancia","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,width=320, height=240");
   var myHTML = '<html><head><title>[ ATURSS ::: SIERRAS DE FRANCIA Y BEJAR ]</title><link rel=stylesheet href=/css/sierradefrancia.css type=text/css></head>'
              + '<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'
              + '<img src="'+s+'"></body></html>';
   fotoWin.document.write(myHTML);
}
function abreProducto(s) {
   var fotoWin = window.open(s,"detalleproducto","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,width=640, height=480");
}


function navBarOver(obj,c) {
  if (!obj.contains(event.fromElement)) {
    obj.style.cursor = 'hand';
    obj.bgColor = c;
  }
}

function navBarOut(obj,c) {
  if (!obj.contains(event.toElement)) {
    obj.style.cursor = 'default';
    obj.bgColor = c;
  }
}

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_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

