//Redirecciono según resolución







function redireccionar() {







var url800x600 = "index800600.php";






var url1024x768 = "index1024768.php";







if ((screen.width == 1024) && (screen.height == 768)){






window.location.href= url1024x768;}






else {window.location.href= url800x600;}






}







function mostrar(nombreCapa){ 






document.getElementById(nombreCapa).style.visibility="visible";






} 







function ocultar(nombreCapa){






document.getElementById(nombreCapa).style.visibility="hidden";






}








function wind_loc(URL){






window.open(URL,'ventana_loc','width=350,height=300,scrollbars=NO,top=250,left=250'); 






}








function wind_cam(URL){






 window.open(URL,'ventana_cam','width=720,height=600,scrollbars=NO,top=60,left=60'); 






} 








//Deshabilitar botón derecho

//   if(document.layers){ 
 //    window.captureEvents(Event.MOUSEDOWN); 
 //    window.onMouseDown=ratonAbajo; 
//    }
//   else  
//     document.oncontextmenu=ratonAbajo;  	     
//    function ratonAbajo(LePucho){  
//      if(document.layers&&LePucho.which!=1) 
 //       return false; 
 //     if(document.all||document.getElementById)
 //      return false;	  
 //   } 		


//Agregar a favoritos
//function favoritos(){
//   if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
//      var url="http://video.cccs.es:82/";
//      var titulo="Cámaras Centro Norteamericano";
//      window.external.AddFavorite(url,titulo);
//   }
//   else {
//      if(navigator.appName == "Netscape")
//         alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks");
//   } 
//}


//window.defaultStatus = 'Centro Norteamericano de Estudios Interculturales';




function reloadimageonly(){
	
	clearTimeout();
	periodo_only=5;
	imgsrc=document.images.foto.src;
	//alert(imgsrc);
	buffer=new Image();
	buffer.onload=imageChange;
	buffer.onerror=imageErroronly;
	imageReloadonly();
}

function imageReloadonly() {
 	
	buffer.src = imgsrc+ "?d=" + new Date().getTime();
	setTimeout("imageReloadonly()", periodo_only * 1000);
}

function imageChange() {
	//alert("change");
	
	document.images.foto.src= buffer.src;
}

function imageErroronly() {
	alert("error");
	setTimeout("imageReloadonly()", 200);
}

function reloadimages() {
	
	clearTimeout();
	periodo_images=10;

	imgsrc1=document.images.foto1.src;
	imgsrc2=document.images.foto2.src;
	imgsrc3=document.images.foto3.src;
	imgsrc4=document.images.foto4.src;
	imgsrc5=document.images.foto5.src;

	buffer1=new Image();
	buffer2=new Image();
	buffer3=new Image();
	buffer4=new Image();
	buffer5=new Image();

	buffer1.onload=imageChange1;
	buffer2.onload=imageChange2;
	buffer3.onload=imageChange3;
	buffer4.onload=imageChange4;
	buffer5.onload=imageChange5;

	buffer1.onerror=imageError;
	buffer2.onerror=imageError;
	buffer3.onerror=imageError;
	buffer4.onerror=imageError;
	buffer5.onerror= imageError;

	buffer1.src = imgsrc1+ "?d=" + new Date().getTime();
	buffer2.src = imgsrc2+ "?d=" + new Date().getTime();
	buffer3.src = imgsrc3+ "?d=" + new Date().getTime();
	buffer4.src = imgsrc4+ "?d=" + new Date().getTime();
	buffer5.src = imgsrc5+ "?d=" + new Date().getTime();

	setTimeout("imageReload()", periodo_images * 1000);
}

function imageError() {
	alert("error");
	setTimeout("imageReload()", 200);
}


function imageReload() {

	buffer1.src = imgsrc1 + "?d=" + new Date().getTime();
	buffer2.src = imgsrc2 + "?d=" + new Date().getTime();
	buffer3.src = imgsrc3 + "?d=" + new Date().getTime();
	buffer4.src = imgsrc4 + "?d=" + new Date().getTime();
	buffer5.src = imgsrc5 + "?d=" + new Date().getTime();

 	setTimeout("imageReload()", periodo_images * 1000);
}

function imageChange1() {
	//alert("change1");
	document.images.foto1.src= buffer1.src;
}

function imageChange2() {
		//alert("change2");
	document.images.foto2.src= buffer2.src;
}

function imageChange3() {
		//alert("change3");

	document.images.foto3.src= buffer3.src;
}

function imageChange4() {
	//alert("change4");
	document.images.foto4.src= buffer4.src;
}

function imageChange5() {
	//alert("change5");
	document.images.foto5.src= buffer5.src;
}