// JavaScript Document

	function redirijoInsertar(order, dir, page_actual, historico){
			var hist="";
			if(historico==1){
				var hist="&historico=1";
			}
			document.location.href = "edito.php?accion=creo&page="+page_actual+"&order="+order+"&dir="+dir+hist;
	}
	
	function redirijoEnviar(order, dir, page_actual){

		var cantidad_regs = $F('cantidad_regs');
		var str_regs = "";
		for (i = 1; i<=cantidad_regs; i++){
			if($F("chkn_" + i)=='on'){
				str_regs += $("chkn_" + i).name.substr(4);
				str_regs += "-";
			}
		}
		str_regs = str_regs.substr(0, str_regs.length-1);
		if (str_regs.length > 0){
			document.location.href = "acciones/enviar.php?str_regs=" + str_regs + "&order="+order+"&dir="+dir+"&page="+page_actual;
		}
	}
	
	
	function abroMenu(num){
		
		for(i=1; i<=7; i++){
			document.getElementById('btn_sup_'+i).style.display="none";
			document.getElementById('btn_ppal_'+i+'_1').style.backgroundImage='url(../img/btn2_izq.gif)';
			document.getElementById('btn_ppal_'+i+'_2').style.backgroundImage='url(../img/btn2_centro.gif)';
			document.getElementById('btn_ppal_'+i+'_3').style.backgroundImage='url(../img/btn2_der.gif)';
			document.getElementById('btn_ppal_'+i+'_2').style.color='#777777';
			
		}
		
		document.getElementById('btn_sup_'+num).style.display="";
		
		
		document.getElementById('btn_ppal_'+num+'_1').style.backgroundImage='url(../img/btn1_izq.gif)';
		document.getElementById('btn_ppal_'+num+'_2').style.backgroundImage='url(../img/btn1_centro.gif)';
		document.getElementById('btn_ppal_'+num+'_3').style.backgroundImage='url(../img/btn1_der.gif)';
		document.getElementById('btn_ppal_'+num+'_2').style.color='#333333';
		
		/*if(num==1){
			document.location.href='../usuarios/index.php';
		}else if (num==2){
			document.location.href='../noticias/index.php';
		}else if (num==3){
			document.location.href='../categorias/index.php';
		}else if (num==4){
			document.location.href='../directiva/index.php';
		}else{
			document.location.href='../estatutos/index.php';
		}*/
	}
	/*window.onload = function(){
		//$("btnConsultar").onclick = consultarLema;
		$("menu").onchange = cambiaTipo;
	}
	
	function cambiaTipo(){
		var url = "select_tipo.php";
		var pars = {id: $F("menu")};
		actualizaDatosRemotos('contenedor_tipos', url, pars);
	}	
	
	function actualizaDatosRemotos(target, url, params){
		var pars = $H(params).toQueryString();
		var Update = new Ajax.Updater(target, url, {method: "get", parameters: pars})
	}*/
	
	function redirijoFotos(order, id, page, dir, historico){
		var hist="";
		if(historico==1){
			var hist="&historico=1";
		}
		document.location.href="mas_fotos.php?order="+order+"&id="+id+"&page="+page+"&dir="+dir+hist;
	}
	function redirijoPDFs(order, id, page, dir, historico){
		var hist="";
		if(historico==1){
			var hist="&historico=1";
		}
		document.location.href="mas_pdfs.php?order="+order+"&id="+id+"&page="+page+"&dir="+dir+hist;
	}
