if (navigator.appName == "Microsoft Internet Explorer") {ie=true;} else {ie=false;}
function GE(obj) {
	return document.getElementById(obj);
}
///
var _win_ancho=screen.availWidth;
var _win_alto=screen.availHeight;
function VerVideos(o){
	var _path = o.href;
	var _win_w=460;
	var _win_h=380;
	var _posLeft = (_win_ancho/2)-(_win_w/2);
	var _posTop = (_win_alto/2)-(_win_h/2);
	winB = window.open(_path, 'ventanaF', 'width='+_win_w+', height='+_win_h+', top='+_posTop+', left='+_posLeft+', scrollbars=yes, status=no, resizable=no, toolbar=no, menubar=no');
	winB.focus();
	return false;
}
function wl(ruta){
	window.location=ruta;
}
function volver(){
	window.history.back();
}
///
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 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 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 getStyle(oElm, strCssRule){
    var strValue = "";
    if(document.defaultView && document.defaultView.getComputedStyle){
        strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
    }
    else if(oElm.currentStyle){
        strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1){
            return p1.toUpperCase();
        });
        strValue = oElm.currentStyle[strCssRule];
    }
    return strValue;
}