///
if (navigator.appName == "Netscape") {ns=true;} else {ns=false;}
///
win_ancho=screen.availWidth;
win_alto=screen.availHeight;
function abrePopup(path){
	win_w=300;
	win_h=200;
	posLeft=(win_ancho/2)-(win_w/2);
	posTop=(win_alto/2)-(win_h/2);
	winB = window.open(path, 'ventanaF', 'width='+win_w+', height='+win_h+', top='+posTop+', left='+posLeft+', scrollbars=no, status=no, resizable=no, toolbar=no, menubar=no');
	winB.focus();
}
///
function imprimir() {
	if (window.print){ 
		window.print();
	}else{
		alert("Disculpe, opción no disponible\nIntente imprimir desde el menu archivo.");
	}
}
//
function volver(){
	window.history.back();
}
//
function wl(ruta){
	window.location=ruta;
}
//
function cachear(){
	cacheOver=[];
	for(im=0; im<cachear.arguments.length; im++){
		imagenCachear = 'img/'+cachear.arguments[im];
		cacheOver[im] = new Image();
		cacheOver[im].src = imagenCachear;
	}	
}
//
function deslizarTop(){
	var vel1 = 3;
	var vel2 = 5;
	var sec = 20;
	var y;
	var cy;
	var gy = 0;
	var scrollEngine;
	if(document.all){
		cy = document.body.scrollTop;
	}
	else if(document.layers || document.getElementById){
		cy = pageYOffset;
	}
	y = cy-gy;
	if(Math.abs(y)>400){
		cy = cy-(y/vel1);
		window.scroll(0,cy);
		scrollEngine = setTimeout("deslizarTop()",sec);	
	}else if(Math.abs(y)>0){
		cy = cy-(y/vel2);
		window.scroll(0,cy);
		scrollEngine = setTimeout("deslizarTop()",sec);	
	}else{
		window.scroll(0,0);
		clearTimeout(scrollEngine);
	}
}
function ampliar(){
	fotoAmpliar = document.getElementById('previo').src;	
	fotoAmpliar = fotoAmpliar.replace('_CH','');	
	abrirpopup(fotoAmpliar,'Foto');
}
//
function setCookie(nombre, valor) {
	caduca=new Date(2010, 12, 31);
	document.cookie = nombre + "=" + escape(valor) + "; expires=" + caduca.toGMTString();
}
function getCookie(nombre) {
  var buscar = nombre + "="; 
  if (document.cookie.length > 0) {
	i = document.cookie.indexOf(buscar);	
	if (i != -1) {
	  i += buscar.length;	  
	  j = document.cookie.indexOf(";", i);
	  return unescape(document.cookie.substring(i,j));
	}else{
		return ""
	}
  }
}
function overCeld(obj){
	obj.style.backgroundColor="#ffffcc";
}
function outCeld(obj){
	obj.style.backgroundColor="#ffffff";
}