/*FUNCION EVENTO*/
	function addEvent(obj, evType, fn){if(obj.addEventListener){obj.addEventListener(evType, fn, false); return true;}else if(obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; }else {return false; }}
	
/*______________________________________________________________________________________________________________________________________________ FUNCTION AJAX*/
	function NuevoAjax(){var xmlhttp=false;try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp = false;}}if(!xmlhttp && typeof XMLHttpRequest!='undefined'){xmlhttp = new XMLHttpRequest();}return xmlhttp;}
/*________________________________________________________________________________________________________________________________________________ FONT SIZE*/
	var SIZE_FONT=12;
	var SIZE_FONT_MIN=12;
	var SIZE_FONT_MAX=18;
	function STYLE_TEXT(estado)
	{
		if(estado=="+")
		{
			if(SIZE_FONT < SIZE_FONT_MAX)
			{
				SIZE_FONT = SIZE_FONT + 1;
				document.getElementById('TEXTO').style.fontSize=SIZE_FONT+"px";
			}
		}
		else
		{
			
			if(SIZE_FONT > SIZE_FONT_MIN)
			{
				SIZE_FONT = SIZE_FONT - 1;
				document.getElementById('TEXTO').style.fontSize=SIZE_FONT+"px";
			}
		}
	}
/*_________________________________________________________________________________________________________________________________________________ AMPLIAR_IMG*/
	function AMPLIAR_IMG(SRC)
	{
		document.getElementById('IMG_NOTICIA').innerHTML="<img src='"+SRC+"' class='articulo_img' width='250px'>";
		//PNG_loader();
	}
/*_______________________________________________________________________________________________________________________________________________ CARGAR NOTICIAS*/
	function LOAD_NOTICIAS(IN)
	{
		/*solo si cumple los requisitos*/
		var preloader;
		preloader = document.getElementById('CONTENIDO_NOTICIA');
		
		
		ajax=NuevoAjax();
		ajax.open("POST", "plugins/noticias_detalle.php",true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==1){
				preloader.innerHTML = "<br /><br /><center><img src='img/icons/loading.gif' /><br /><br /><br /><br /><br /><br /><br /></center>";
			}else if(ajax.readyState==4){
				if(ajax.status==200){
					preloader.innerHTML = ajax.responseText;
					noticias_repositorio = new fx.Height('IMG_NOT', {duration: 400}); noticias_repositorio.hide();
				}else if(ajax.status==404){
					preloader.innerHTML = "La página no existe";
				}else{
					preloader.innerHTML = "Error:".ajax.status;
				}
			}
		}
		ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		ajax.send("IN="+IN) 
		
	}
/*______________________________________________________________________________________________________________________________________________ REFRESCAR RUTAS*/
	function JS_refresh_ruta(ruta)
	{
		//alert(ruta);
		window.location.href=ruta;
	}
/*______________________________________________________________________________________________________________________________________________ POSICION*/
	function TAMANO_WEB()
	{
	
	
		var largo_scroll = document.documentElement.scrollHeight;
		var ancho_scroll = document.documentElement.scrollWidth;
		
		var posicion_top_scroll = document.documentElement.scrollTop;
		var posicion_left_scroll = document.documentElement.scrollLeft;
		
		var offset_ancho = document.documentElement.offsetWidth;
		var offset_alto = document.documentElement.offsetHeight;
		
		var cliente_ancho = document.documentElement.clientWidth;
		var cliente_alto = document.documentElement.clientHeight;
		
		/**/
		var ANCHO_PAGE 	= document.body.clientWidth;
		var ALTO_PAGE 	= document.body.clientHeight;
		
		var ANCHO_WIN 	= screen.width;
		var ALTO_WIN 	= screen.height;
		
		
		//alert(offset_alto+"--"+cliente_alto+"'")
		if(offset_alto > ALTO_PAGE)
		{
			//alert("el contenido es largo no necesita ser forzado");
		}
		else
		{
			//alert("el contenido es chico debe ser forzado");
			var new_alto=ALTO_PAGE - 288;
			document.getElementById('BLOQUE_CENTRAL').style.height=new_alto+"px";
		}
	}
/*_________________________*/
/*VALIDAR ENVIO DE CONTACTO*/
	function enviar_contacto(button)
	{
		if(window.document.getElementById('nombre').value=="")
		{alert("El campo nombre es obligatorio");window.document.getElementById('nombre').focus();return;}
		
		if(window.document.getElementById('comentario').value=="")
		{alert("El campo comentario es obligatorio");window.document.getElementById('comentario').focus();return;}
		
		if(window.document.getElementById('email').value=="")
		{alert("El campo email es obligatorio");window.document.getElementById('email').focus();return;}
		
		var MAIL = validaMail(window.document.getElementById('email'));
		if(MAIL==1){return;}
		
		document.getElementById(button).disabled="true";
		document.getElementById(button).value="Enviando...";
		window.document.getElementById('form_contactos').submit();
	}
/*VALIDAMOS EMAIL*/
	function validaMail(obj)
	{
		var correo = obj.value;
		if (correo == "" || correo == "undefined") { return 0; }
		var listcorreo = correo.split(",");
		var campo = "";
		for (i=0; i < listcorreo.length; i++) 
		{
			campo = listcorreo[i];
			if(campo != "")
			{
				if ( campo.search(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/ig) ) 
				{ 
					alert("El correo electronico "+campo+" no es valido. \n\n Debe escribirlo de esta forma: nombre@servidor.dominio");
					obj.focus();
					obj.select();
					return 1;
				}
			}
		}
		return 0;
	}
/*CAMBIO COLOR FOCO*/
	var old_color="";
	function color_foco(nombre)
	{
		old_color=document.getElementById(nombre).className;
		document.getElementById(nombre).className="PLANTA_REG_OVER";
	}
	
	function color_focolost(nombre)
	{
		document.getElementById(nombre).className=old_color;
	}
/*ABRIR POPUP CONFIGURABLE*/
	/**
	url = determina la ruta del archivo que se quiere abrir en el popup, URL DEBE ESTA PRESENTE EN SU PROYECTO
	ancho = define el ancho de la pagina
	alto = define el alto de la imagen
	full = si full es = a 1, el popup se abrira a pantalla completa.... si es cero o blanco se abrira al tamaño que determina ancho y alto
	centrado = si centrado es = a 1, el popup se centrara en tu pantalla.... si es cero o blanco se abrira en el top de la pantalla
	scrollb= 1 = con popup con scroll...si es cero o blanco estara desabilitado
	resize= 1 popup que se puede agrandar...si es cero o blanco estara desabilitado
	*/
	function popup_configurable(url,ancho,alto,full,centrado,scrollb,resize)
	{
		var popup;
		var left_point;
		var top_point;
		var screen_height 	= screen.height;	/*ENTREGA EL ALTO DE SU PANTALLA*/
		var screen_width 	= screen.width; 	/*ENTREGA EL ANCHO DE SU PANTALLA*/
		
		/*VALIDAMOS SI EL POPUP CONTARA CON PROPIEDADES*/
			if(scrollb!=1){scrollb=0;}
			if(resize!=1){resize=0;}
			
		/*ABRIMOS EL POPUP*/
			popup=window.open(url,"pop","width="+ancho+",height="+alto+",scrollbars="+scrollb+",resizable="+resize);
			popup.focus();
		
		/*VALIDAMOS SI SE DEBE CENTRAR EL POPUP, SINO QUEDARA SIEMPRE EN EL TOP=0 LEFT=0*/
			if(centrado==1)
			{
				ancho	= ancho*1;
				alto	= alto*1;
				left_point = parseInt(screen.availWidth/2.0)-(ancho/2.0);
				top_point = parseInt(screen.availHeight/2.0)-(alto/2.0);
				popup.moveTo(left_point,top_point);
			}
			else{popup.moveTo(0,0);}
			
			
	
			
		/*DEJAMOS EL POPUP FULLSCREAM*/
			if(full==1){popup.resizeTo(parseInt(screen.availWidth),parseInt(screen.availHeight));}
	}    