try{ document.execCommand('BackgroundImageCache', false, true); }catch(e){}

trim = function(str){
	if(str && typeof(str)=='string'){
		var i = 0, x = (l = str.length) - 1;
		while(i<l && str.charAt(i)==" ") i++;
		while(x>0 && str.charAt(x)==" ") x--;
		str = str.substring(i, x + 1);
	}
	return str;
}

controlCaracteristicasDestacadas = function(){
	if(Nav.esIE || Nav.esIE7) window.detachEvent('onload', controlCaracteristicasDestacadas);
	else if(Nav.esMz) window.removeEventListener('load', controlCaracteristicasDestacadas, false);
	
	var cont = document.getElementById('destacadas');
	var nodos = null;
	var x, i, altoMax = 0;
	if(cont){
		for(i = 0; i < cont.childNodes.length; i++){
			altoMax = x = 0;
			nodos = new Array;
			while(x < 3){
				if(cont.childNodes[i].tagName){
					if(altoMax < cont.childNodes[i].offsetHeight) altoMax = cont.childNodes[i].offsetHeight;
					x++;
					nodos.push(cont.childNodes[i]);
				}
				i++;
				if(i >= cont.childNodes.length) break;
			}
			for(x = 0; x < nodos.length; x++) nodos[x].style.height = altoMax+'px';
			nodos = null;
			i--;
		}
	}
}

controlarCaracteristicasDestacadas = function(){
	if(Nav && (Nav.esIE || Nav.esIE7)) window.attachEvent('onload', controlCaracteristicasDestacadas);
	else if(Nav && Nav.esMz) window.addEventListener('load', controlCaracteristicasDestacadas, false);
	
}

mostrarContenido = function(id, event){
	if(Nav && (Nav.esIE || Nav.esIE7) && event){
		event.cancelBubble = true;
		event.returnValue = false;
	}
	else if(Nav && Nav.esMz && event){
		event.preventDefault();
		event.stopPropagation();
	}
	
	var desde = hasta = 0, obj = document.getElementById(id);
	//
	if(parseInt(obj.style.height) == 0 || obj.style.height=='') desde = 0, hasta = obj.scrollHeight;
	else if(parseInt(obj.style.height) == obj.scrollHeight) desde = obj.scrollHeight, hasta = 0;
	
	if(desde != hasta){
		var tm = new Tween(obj.style, 'height', Tween.strongEaseOut, desde, hasta, 2, 'px');
		tm.start();
	}
}
//
Navegador = function(){
	this.esIE = false;// Internet Explorer
	this.esMz = false;// Mozilla
	this.esOp = false;// Opera
	this.esNs = false;// Netscape
	
	if(window.navigator.appVersion.search(RegExp("MSIE","im"))!=-1){
		if(window.navigator.appVersion.search(RegExp("6","im"))!=-1)this.esIE = true;
		else if(window.navigator.appVersion.search(RegExp("7","im"))!=-1)this.esIE7 = true;		
	}
	else if(window.navigator.appName.search(RegExp("Opera","im"))!=-1) this.esOp = true;
	else if(window.navigator.appName.search(RegExp("Netscape","im"))!=-1) this.esMz = true;
}
var Nav = new Navegador();
//
function ieHover() {
	if(!(Nav.esIE || Nav.esIE7)) return false;
	
	var e = Array('li');
	var c = Array('pregunta');
	for(var i = 0; i < e.length; i++){
		//
		for(var x = 0; x < c.length; x++){
			//
			var o = document.getElementsByTagName(e[i]);
			for(var y = 0; y < o.length; y++){
				if(o[y].className == c[x]){
					o[y].onmouseover = function(){ this.className += "hover"; }
					o[y].onmouseout  = function(){ this.className = this.className.replace(/hover/,""); }
				}
			}
		}
	}
}
//
function popupAbrir(obj, top){
	//
	obj.l.style.position = 'absolute';
	obj.c.style.position = 'absolute';
	obj.f.style.position = 'absolute';
	obj.l.style.zIndex = '15';
	obj.c.style.zIndex = '14';
	obj.f.style.zIndex = '13';
	//
	var pos = getScrollPos();
	var dim = getWindowDims();
	//
	obj.f.style.top 		= 0;
	obj.f.style.left 		= 0;
	obj.f.style.width 		= "100%";
	//
	obj.l.style.visibility 	= "visible";
	obj.f.style.visibility 	= "visible";
	obj.c.style.display  = 'block';
	//
	obj.l.style.top = (Math.round(((dim.h - obj.c.offsetHeight) / 2) + pos.y)) + "px";
	
	dim = getBodyDims();
	
	if((parseInt(obj.l.style.top) + obj.c.offsetHeight) < dim.h) obj.f.style.height = dim.h + "px";
	else obj.f.style.height = (obj.c.offsetHeight + parseInt(obj.l.style.top) + 10) + "px";
	
	obj.l.style.left = (Math.round((dim.w - obj.c.offsetWidth) / 2)) + "px";
	//
	if(Nav.esIE || Nav.esIE7){
		var s = document.getElementsByTagName('select');
		for(var i = 0; i < s.length; i++) s[i].style.visibility = 'hidden';
	}
}
function popupCerrar(obj){
	obj.f.style.visibility 	= "hidden";
	obj.l.style.visibility 	= "hidden";
	obj.f.style.top 		= 0;
	obj.f.style.left 		= 0;
	obj.f.style.height 		= 0;
	obj.l.style.top 		= 0;
	obj.l.style.left 		= 0;
	
	if(Nav.esIE || Nav.esIE7){
		var s = document.getElementsByTagName('select');
		for(var i = 0; i < s.length; i++) s[i].style.visibility = '';
	}
}

//
function centrarLayer(id){
	var element = document.getElementById(id);
	if(element.style.visibility=='hidden'){
		
		var pos = getScrollPos();
		var dim = getWindowDims();
		
		var height = element.offsetHeight;
		var width = element.offsetWidth;
		
		element.style.left = (((dim.w-width)/2)+pos.x)+"px";
		element.style.top = (((dim.h-height)/2)+pos.y)+"px";
		element.style.visibility = 'visible';
	}
	else element.style.visibility = 'hidden';
}
//
function getScrollPos(){
	if(Nav.esOp) return {y:window.pageYOffset, x:window.pageXOffset};
	else if(Nav.esMz || (Nav.esIE || Nav.esIE7)) return {y:document.documentElement.scrollTop, x:document.documentElement.scrollLeft};
	else return {x:0, y:0};
}
function getWindowDims(){
	if(Nav.esOp) return {w:window.innerWidth, h:window.innerHeight, a:'a'};
	else if(Nav.esMz || (Nav.esIE || Nav.esIE7)) return {w:document.documentElement.clientWidth, h:document.documentElement.clientHeight};
	else return {w:0, h:0}
}
function getBodyDims(){
	if(Nav.esOp) return {w:document.body.clientWidth, h:document.body.clientHeight};
	else if(Nav.esMz) return {w:document.documentElement.offsetWidth, h:document.documentElement.offsetHeight, a:'Mz'};
	else if(Nav.esIE || Nav.esIE7) return {w:document.body.offsetWidth, h:document.body.offsetHeight, a:'b'};
	else return {w:0, h:0}
}
function getBodyWHAvaible(){
	if(Nav.esOp) return {w:window.innerWidth, h:window.innerHeight};
	else if(Nav.esIE || Nav.esMz || Nav.esIE7) return {w:document.documentElement.clientWidth, h:document.documentElement.clientHeight};
	else return {w:0, h:0}
}
//
var redimensionA = 0;

function redimensionar(id,desde,hasta,retraso){
	if (redimensionA == 0)
	{objeto = document.getElementById(id);
	var tm = new Tween(objeto.style,'height',Tween.strongEaseOut,desde,hasta,retraso,'px');
	tm.start();
	
	}
}
//
var disminuir = 1;
var aumentar = 0;
//
function agrandarOachicar(id,desde,hasta,retraso){
	objeto = document.getElementById(id);
	if(disminuir == 1){
		var tm = new Tween(objeto.style,'height',Tween.strongEaseOut,desde,hasta,retraso,'px');
		tm.start();		
		disminuir = 0;
		aumentar = 1;
	var img = document.getElementById('expandir');
	img.src = "img/btnExpandir.gif";
	}
	else{
		var tm = new Tween(objeto.style,'height',Tween.strongEaseOut,hasta,desde,retraso,'px');
		tm.start();		
		disminuir = 1;
		aumentar = 0;
		var img = document.getElementById('expandir');
		img.src = "img/btnContraer.gif";
	}
}
//
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
//
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//
if(Nav.esIE || Nav.esIE7){
	window.attachEvent('onload', function(){
		if(window.navigator.appVersion.search(RegExp("MSIE","im"))!=-1 && window.navigator.appVersion.search(RegExp("6.","im"))!=-1 &&//
		document.body.clientHeight < 600){
			var aux = document.getElementById('main');
			if(aux) aux.style.height = '500px';
		}
	});
}
/***************************************/
//Func:  Add/Remove/Fire Event
AddEvent = function(o, e, f){
	if(Nav.esIE || Nav.esIE7){
		o.attachEvent('on'+e, f);
	}
	else if(Nav.esMz || Nav.esOp) o.addEventListener(e, f, true);

};
RemEvent = function(o, e, f){
	if(Nav.esIE || Nav.esIE7) o.detachEvent('on'+e, f);
	else if(Nav.esMz || Nav.esOp) o.removeEventListener(e, f, true);
};
FireEvent = function(o, e){
	if(Nav.esIE || Nav.esIE7) o.fireEvent('on'+e);
	else{
		var evt = document.createEvent("Events");
		evt.initEvent(e, true, false);
		o.dispatchEvent(evt);
	}
}
