function intercambiar_lista(emisor, receptor){

	emisor = document.getElementById(emisor);
	receptor = document.getElementById(receptor);
	
	items = emisor.options.length;

	
	for(i=items-1;i>=0;i--){
		if(emisor.options[i].selected == true){
			opcion = emisor.options[i];
			posicion = receptor.options.length;
	
			receptor.options[posicion] = new Option(opcion.text, opcion.value);
			emisor.options[i] = null;		
		}
	}

}

function seleccionar_toda_lista(lista){
	lista = document.getElementById(lista);
	items = lista.options.length;
	
	for(i=0;i<items;i++){
			lista.options[i].selected = true;

	}	
}


function crear_editor_size(textarea, w, h){		
	var oFCKeditor = new FCKeditor(textarea) ;						
	oFCKeditor.BasePath	= 'library/fckeditor/';			
	oFCKeditor.Height = h ;
	oFCKeditor.Width = w ;			
	oFCKeditor.ToolbarSet	= 'Basico' ;
	oFCKeditor.Config['AutoDetectLanguage'] = true ;		
	oFCKeditor.Config['DefaultLanguage'] = 'es' ;
	oFCKeditor.Config['SkinPath'] = 'http://espacios.globalmetanoia.com/library/fckeditor/editor/skins/office2003/' ;			
	oFCKeditor.ReplaceTextarea();
}


function salva_editor_recursos(texto){		
	document.getElementById('recursos').value = texto ;
	xajax_filter_recursos(xajax.getFormValues('formulario'));
}

function show_ventana_info_mod_tareas(mensaje, tipo, id, id_padre, origen){
	if(readCookie("espacios_language") == "english"){
		titulo = "Confirmation";
		cancelar = "Cancel";
		aceptar = "Accept"	
	}
	else{				
		titulo = "Confirmaci&oacute;n";
		cancelar = "Cancelar";
		aceptar = "Aceptar"	
	}
	
    switch(tipo){
		case 'proyecto':	

			llamada = "&nbsp;<input onclick=\"xajax_delete_proyecto("+id+", '"+origen+"');closeMessage('');return false;\" type='button' class='boton' value='"+aceptar+"'>";
    		break;
		case 'tarea':				
    		llamada = "&nbsp;<input onclick=\"xajax_delete_tarea("+id+", "+id_padre+", '"+origen+"');closeMessage('');return false;\" type='button' class='boton' value='"+aceptar+"'>";					    	
    		break;
		case 'subtarea':				
    		llamada = "&nbsp;<input onclick=\"xajax_delete_subtarea("+id+", "+id_padre+");closeMessage('');return false;\" type='button' class='boton' value='"+aceptar+"'>";					    	
    		break;
		case 'comentario':				
    		llamada = "&nbsp;<input onclick=\"xajax_delete_comentario("+id+", "+id_padre+");closeMessage('');return false;\" type='button' class='boton' value='"+aceptar+"'>";					    	
    		break;
		case 'finalizar_subtarea':				
    		llamada = "&nbsp;<input onclick=\"xajax_finalizar_subtarea("+id+", "+id_padre+");closeMessage('');return false;\" type='button' class='boton' value='"+aceptar+"'>";					    	
    		break;
					
    	default:
    		llamada = "";
    		break;
    }
    
    var sHTML = "<div class='ventana'>"+
	    			"<div style='overflow:auto'>"+
	    				"<div style='float:left'><img src='../../view/images/pregunta.png'></div>"+
	    				"<div style='padding-top:2px;'>&nbsp;&nbsp;<b>"+titulo+"</b></div>"+
	    			"</div>"+
	    			"<div style='padding:20px 10px 0px 10px;height:40px'>"+mensaje+"</div>"+
	    			"<div style='text-align:center;'>"+
	    				llamada+"  <input onclick=\"closeMessage('');return false;\" type='button' class='boton' value='"+cancelar+"'>"+		    				
	    			"</div>"+
    			"</div>";    		
	messageObj = new DHTML_modalMessage();
	messageObj.setShadowOffset(3);
	messageObj.setHtmlContent(sHTML);
	messageObj.setSize(300,130);
	messageObj.display();		
}