function load_presentacion () {
	setTimeout('presentacion()',3000);	
}

function presentacion() {    
	var mc_home = new FlashObject("home.swf", "bn40", "450", "300", "6", "");  
	mc_home.addParam("menu", "false"); 
	mc_home.addParam("wmode", "transparent"); 
	mc_home.write("home"); 
}

function pop_galeria(id_nota) {
	ancho = 520;
	alto = 400;
	
	var ventana, txtBody;

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open('galeria.php?id_not='+id_nota,'ventana1','toolbar=no,scrollbars=yes,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}


function cambiar_contenidos(url, id_contenedor){
var pagina = false
if (window.XMLHttpRequest) {// Firefox y otros
pagina = new XMLHttpRequest()
} else if (window.ActiveXObject){ // IE
try {
pagina = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){ 
try{
pagina = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
pagina.onreadystatechange=function(){ 
load_pagina(pagina, id_contenedor)
}
pagina.open('GET', url, true) 
pagina.send(null)
}

function load_pagina(pagina, id_contenedor){
	if (pagina.readyState == 4 && (pagina.status==200 || window.location.href.indexOf("http")==-1)) {
		document.getElementById(id_contenedor).innerHTML=pagina.responseText
	} else {
		document.getElementById(id_contenedor).innerHTML="<br><br><br><br><div align='center'><img src='imagenes/loading.gif' width='16' height='16'></div>"
	}

}


function POPHTM(file, ancho, alto) {
	var ventana, txtBody;

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana1','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}

function popgaleria(nro) {
	ancho=600;
	alto=620;
	var ventana, txtBody;
	
	switch (nro) {
		case 1:
			file = "galerias/1/1.html";
			break;
		case 2:
			file = "galerias/2/2.html";
			break;			
		case 3:
			file = "galerias/3/3.html";
			break;			
		case 4:
			file = "galerias/4/4.html";
			break;	
		case 5:
			file = "galerias/5/5.html";
			break;	
		case 6:
			file = "galerias/6/6.html";
			break;	
		case 7:
			file = "galerias/7/7.html";
			break;	
		case 8:
			file = "galerias/8/8.html";
			break;				
		case 9:
			file = "galerias/9/9.html";
			break;				
		case 10:
			file = "galerias/10/10.html";
			break;				
		case 11:
			file = "galerias/11/11.html";
			break;				
		case 12:
			file = "galerias/12/12.html";
			break;				
		case 13:
			file = "galerias/13/13.html";
			break;	
		case 14:
			file = "galerias/14/14.html";
			break;	
		case 15:
			file = "galerias/15/15.html";
			break;	
		case 16:
			file = "galerias/16/16.html";
			break;				
		case 17:
			file = "galerias/17/17.html";
			break;				
		case 18:
			file = "galerias/18/18.html";
			break;
		case 19:
			file = "galerias/19/19.html";
			break;				
		case 20:
			file = "galerias/20/20.html";
			break;			
		case 21:
			file = "galerias/21/21.html";
			break;			
		case 22:
			file = "galerias/22/22.html";
			break;	
		case 23:
			file = "galerias/23/23.html";
			break;	
		case 24:
			file = "galerias/24/24.html";
			break;	
		case 25:
			file = "galerias/25/25.html";
			break;	
		case 26:
			file = "galerias/26/26.html";
			break;	
		case 27:
			file = "galerias/27/27.html";
			break;	
		case 28:
			file = "galerias/28/28.html";
			break;	
		case 29:
			file = "galerias/29/29.html";
			break;	
		case 30:
			file = "galerias/30/30.html";
			break;	
		case 31:
			file = "galerias/31/31.html";
			break;	
		case 32:
			file = "galerias/32/32.html";
			break;	
		case 33:
			file = "galerias/33/33.html";
			break;	
		case 34:
			file = "galerias/34/34.html";
			break;	
		case 35:
			file = "galerias/35/35.html";
			break;	
		case 36:
			file = "galerias/36/36.html";
			break;	
		case 37:
			file = "galerias/37/37.html";
			break;	
		case 38:
			file = "galerias/38/38.html";
			break;	
		case 39:
			file = "galerias/39/39.html";
			break;
		case 40:
			file = "galerias/40/40.html";
			break;
		case 41:
			file = "galerias/41/41.html";
			break;			
	}
	
	

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana1','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}

function MM_validateForm() { //v4.0
  if (document.getElementById){
    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=document.getElementById(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+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('Debe completar Empresa, domicilio, teléfono y contacto');
    document.MM_returnValue = (errors == '');
} }

function POPHTM(file, ancho, alto) {
	var ventana, txtBody;

	var leftPos= (screen.width)?parseInt((screen.width-ancho)/2):100;
	var topPos= (screen.height)?parseInt((screen.height-alto)/2):100;

	ventana=window.open(file,'ventana1','toolbar=no,location=no,directories=no,status=no,menubar=no,width='+ancho+',height='+alto+',top='+topPos+',left='+leftPos);

	if(ventana.focus)
		ventana.focus();
}
