///
if (navigator.appName == "Microsoft Internet Explorer") {ie=true;} else {ie=false;}
///
win_ancho=screen.availWidth;
win_alto=screen.availHeight;
function Ampliar(path){
	win_w=330;
	win_h=485;
	posLeft=(win_ancho/2)-(win_w/2);
	posTop=(win_alto/2)-(win_h/2);
	winB = window.open('mapa.asp?path='+path, 'mapa', 'width='+win_w+', height='+win_h+', top='+posTop+', left='+posLeft+', scrollbars=no, status=no, resizable=no, toolbar=no, menubar=no');
	winB.focus();
	return false;
}
function wl(ruta){
	window.location=ruta;
}
function volver(){
	window.history.back();
}
function Imprimir(pagina) {
	win_w=695;
	win_h=500;
	posLeft=(win_ancho/2)-(win_w/2);
	posTop=(win_alto/2)-(win_h/2);
	winB = window.open(pagina, 'ventanaF', 'width='+win_w+', height='+win_h+', top='+posTop+', left='+posLeft+', scrollbars=yes, status=no, resizable=yes, toolbar=no, menubar=no');
	winB.focus();
}
function EnviarXmail(pagina) {
	win_w=300;
	win_h=195;
	posLeft=(screen.availWidth/2)-(win_w/2);
	posTop=(screen.availHeight/2)-(win_h/2);
	winB = window.open('enviarpormail.asp?pagina='+pagina, 'ventanaF', 'width='+win_w+', height='+win_h+', top='+posTop+', left='+posLeft+', scrollbars=no, status=no, resizable=no, toolbar=no, menubar=no');
	winB.focus();
}
///
function Cachear(){
	cacheOver=[];
	for(im=0; im<Cachear.arguments.length; im++){
		imagenCachear = Cachear.arguments[im];
		cacheOver[im] = new Image();
		cacheOver[im].src = imagenCachear;
	}	
}
function BipCache(){
	var DI=document.images;
	for(i=0;i<DI.length; i++){
		if(DI[i].onmouseover){
			if(DI[i].onmouseover.toString().toLowerCase().indexOf('rollover')>-1){
				path=DI[i].src;
				ext=path.substr(path.length-4,4);
				img=path.substr(0,path.length-4);
				Cachear(img+'_over'+ext);
			}
		}
	}
}
//
function soloEmail(e){
	arrayBlock = [' ','ñ','Ñ','[',']',',',';',':','{','}','(',')','+','*','/','=','&','%','$','#','!','<','>','|','°','?','¿','¡','\'','"'];
	var tecla = (e.keyCode) ? e.keyCode : e.which;
	if(e.ctrlKey && tecla==118 || tecla==39){
		return false;
	}
	var l = String.fromCharCode(tecla)
	for(var i=0; i<arrayBlock.length; i++){
		if(arrayBlock[i] == l){
			return false;
		}
	}
}
function soloNumeros(e){
	tecla = (e.keyCode) ? e.keyCode : e.which;
	if(e.ctrlKey && tecla==118 || tecla==39){
		return false;
	}
    if (tecla==8 || tecla==0 || tecla==13) return true;
    patron = /\d/;
    te = String.fromCharCode(tecla); 
    return patron.test(te); 
}
function filtrarTecla(e){		
	arrayBlock = ['[',']',',',';',':','{','}','(',')','+','*','/','=','&','%','$','#','!','<','>','|','°','?','¿','¡','\'','"',0,1,2,3,4,5,6,7,8,9];
	var tecla = (e.keyCode) ? e.keyCode : e.which;
	if(tecla==32 || tecla==13){
		return true;
	}
	if(e.ctrlKey && tecla==118 || tecla==39){
		return false;
	}
	var l = String.fromCharCode(tecla)
	for(var i=0; i<arrayBlock.length; i++){
		if(arrayBlock[i] == l){
			return false;			
		}
	}
}

//
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 ""
	}
  }
}
//
memSRC = "";
function rollOver(obj){
	memSRC = obj.src;
	obj.src =  memSRC.substr(0,memSRC.length-4) + "_over" + memSRC.substring(memSRC.length-4);
}
function rollOut(obj){
	obj.src =  memSRC
}
//
function expandir(obj){
	with(document.getElementById(obj)){
		if(style.display=="none"){
			style.display="block";
		}else{
			style.display="none";
		}
	}
}
//
function overCel(obj){
	obj.style.backgroundColor='#EFF5E5';
}
function outCel(obj, id){
	color='#F9F9F2';
	if(id=='1'){
		color='#F2F8F9';	
	}
	obj.style.backgroundColor=color;
}
//
_yscroll=_scrollto=0;
function scrollerTo(posv){
	_yscroll = getTopScroll();
	_scrollto=posv;
	intervalScroll=setInterval(scrollerMove,50);
}
function scrollerMove(){
	_yscroll += (_scrollto-_yscroll)/2;
	_ymove=Math.round(_yscroll);
	if(_ymove==_scrollto){
		clearInterval(intervalScroll);
	}
	window.scrollTo(0,_ymove);
}
function getTopScroll(){
	if(self.pageYOffset){		
		scrolTop = self.pageYOffset;
	}else if (document.documentElement && document.documentElement.scrollTop){
		scrolTop = document.documentElement.scrollTop;
	}else if (document.body){
		scrolTop = document.body.scrollTop;
	}
	return scrolTop;
}
//
function enfoco(obj){
	obj.style.border='1px solid #ADC0D1';
}
function err(obj){
	obj.style.border='1px solid #D98200';
}
function Alpha(obj,valor){
	obj.style.filter='alpha(opacity='+valor+')';
	punto='.';
	if(valor==100){punto='';}
	obj.style.MozOpacity=punto+valor;
}
