///
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();
	return false;
}
///
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 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(var i=0;i<DI.length; i++){
		if(DI[i].className){
			if(DI[i].className.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);
				DI[i].onmouseover=new Function('rollOver(this)');
				DI[i].onmouseout=new Function('rollOut(this)');
			}
		}
	}
}
//
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 GE(obj){
	return document.getElementById(obj);
}
function verFoto(obj){
	document.getElementById("imgCont").src=obj.src;
}
//
_yscroll=_scrollto=0;
function scrollerTo(posv){
	_yscroll = getTopScroll();
	_scrollto=posv;
	intervalScroll=setInterval(scrollerMove,50);
	return false;
}
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 VerLegal(num){
	vPath = ['','legal.html','legal.html?c=1'];
	vWidth = [0,425,700];
	win = window.open(vPath[num],'legal','width='+vWidth[num]+',resizable=yes,scrollbars=yes,top=0,left=0,height='+screen.height);
	win.focus();
	return false;
}
//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;
}
var Zf_vs = [11,13,14,16];
var Zf_c = 0;
function ZoomFont(t){
	if(t==1){
		if(Zf_c<3) Zf_c++;
	}else{
		Zf_c = 0;
	}
	GE('descText').style.fontSize = Zf_vs[Zf_c] + 'px';
	return false;
}
function LogOut(){
	ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Est%C3%A1 seguro que desea salir?')){
		return true;
	}else{
		ht[0].style.filter = ";
		return false;
	}
}