///
if (navigator.appName == "Microsoft Internet Explorer") {ie=true;} else {ie=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 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 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
}
//
submOut=false;
function mOver(obj){
	memSRC = obj.src;
	obj.src =  memSRC.substr(0,memSRC.length-4) + "_over" + memSRC.substring(memSRC.length-4);
	smClose();
}
function mOut(obj){
	obj.src =  memSRC	
}
function OsmOver(){
	document.getElementById('m_serv').src =  'img/m_servicios_over.gif';
	document.getElementById('subMenu').style.display='block';
	submOut=false;
}
function OsmOut(){
	submOut=true;
}
function smClose(){
	document.getElementById('subMenu').style.display='none';
	document.getElementById('m_serv').src =  'img/m_servicios.gif';
	smReset();
}
_timerSM=0;
function smTimer(){
	if(submOut){
		_timerSM++;
		if(_timerSM>15){
			smClose();
		}
	}	
}
function smReset(){
	submOut=false;
	_timerSM=0;
}
//
function expandir(obj){
	with(document.getElementById(obj)){
		if(style.display=="none"){
			style.display="block";
		}else{
			style.display="none";
		}
	}
}
function verFoto(obj){
	document.getElementById("imgCont").src=obj.src;
}
//
function cancelarReserva(sistema,id){
	esOK=window.confirm('Esta seguro que desea Cancelar esta reserva?');
	if(esOK){
		if (sistema == 0){
			wl('ht_misreservas.asp?c=1&id='+id);
		}else{
			wl('ht_cancelando.asp?id='+id+'&s='+sistema);
		}
	}
}
///
esHome=false;
window.onload=function(){
	window.setInterval(smTimer,50);
	if(esHome){
		IniciarMoverNov();
	}
}
//
function overCel(obj){
	document.getElementById(obj).style.backgroundColor='#EFF5E5';
}
function outCel(obj){
	document.getElementById(obj).style.backgroundColor='#ffffff';
}
//
//
_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 #8EA8C1';
}
function err(obj){
	obj.style.border='1px solid #D98200';
}

//AJAX
function newAjax(){
	var http_request = false;
	if (window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');			
		}
	} else if (window.ActiveXObject) {
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}	
	if (!http_request) {            
		return false;
	}
	return http_request;
}


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 verReglasTarifa(id){
	var w = window.open("ar_reglastarifas.asp?id="+id,"reglas","width=440,height=550,scrollbars=yes");
	w.focus();
	return false;
}

/*
function getHTTPObject(){
	try{
        xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(oc){  
            xmlHttp = null;
        }
    }
    if(!xmlHttp && typeof XMLHttpRequest != "undefined"){
        xmlHttp = new XMLHttpRequest();
    }
    return xmlHttp;
}
var ajax = getHTTPObject();
var memEr = "";
function EnviarErrorJS(er, url, linea){
	if(memEr!==er){
		ajax.open("GET", 'includes/errorjs_x_mail.asp?error='+er+'&url='+url+'&linea='+linea, true);
    	ajax.send(null);
		memEr=er;
	}
	return true;
}
window.onerror=EnviarErrorJS;
*/