var baseopacity=100

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",90)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)-0.5, -1)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity>50)
cur2.filters.alpha.opacity-=10
else if (window.highlighting)
clearInterval(highlighting)
}



var ventana
var cont=0
var titulopordefecto = "Fotografia Ampliada"
function abrefoto(cual,titulo)
{
if(cont==1){ventana.close();ventana=null}
if(titulo==null){titulo=titulopordefecto}
ventana=window.open('','ventana','resizable=no,scrollbars=no')
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)">')
ventana.document.close()
cont++
}
function redimensionar(ancho, alto)
{
ventana.resizeTo(ancho+12,alto+28)
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2) //centra la ventana. Eliminar si no se quiere centrar el popup
}

function ir()
    {
        /**
        * variable que almacena la opcion elegida en el primer combo
        */
       var indice=document.form1.secciones.options[document.form1.secciones.selectedIndex].value;

	window.location.href=indice;
		
	} 
	
	
	function irgaleria()
    {
        /**
        * variable que almacena la opcion elegida en el primer combo
        */
            var indice2=document.form1.secciongaleria.options[document.form1.secciongaleria.selectedIndex].value;
		 

	window.location.href="Galeria.asp?IdSeccionGaleria="+ indice2;
		
	} 
	
	
var all;
var month;
var period;
var day;
function time(){
var currentDate=new Date()

hour=currentDate.getHours()
min=currentDate.getMinutes()
sec=currentDate.getSeconds()
date=currentDate.getDate()
year=currentDate.getYear()
switch(currentDate.getMonth()){
        case 0:month="Enero";break;
        case 1:month="Febrero";break;
        case 2:month="Marzo";break;
        case 3:month="Abril";break;
        case 4:month="Mayo";break;
        case 5:month="Junio";break;
        case 6:month="Julio";break;
        case 7:month="Agosto";break;
        case 8:month="Septiembre";break;
        case 9:month="Octubre";break;
        case 10:month="Noviembre";break;
        case 11:month="Diciembre";break;
}

switch(currentDate.getDay()){
        case 0:day="Domingo";break;
        case 1:day="Lunes";break;
        case 2:day="Martes";break;
        case 3:day="Miercoles";break;
        case 4:day="Jueves";break;
        case 5:day="Viernes";break;
        case 6:day="Sabado";break;
}
if(sec<10){sec="0"+sec}
if(min<10){min="0"+min}

if(hour>12){hour-=12;period="pm"} else {period="am"}
if(currentDate.getHours()==12){period="pm"}
if(currentDate.getHours()==24){period="am"}

var all=" "+day+" "+date+" de "+month+" "+year+" "+hour+":"+min+":"+sec+period
window.status=all
window.setTimeout("time()",300)
}
time()


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' Debe ser direccion de Correo Electronico.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' Debe ser un numero.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' debe ser un numero entre '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' Es un campo obligatorio.\n'; }
  } if (errors) alert('Se han encontrado los Siguiente Errores\n'+errors);
  document.MM_returnValue = (errors == '');
}



function Abreventana(arquivo, tamx, tamy)

{
window.open(arquivo,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=yes,width=" + tamx + ",height=" + tamy)
}

