// JavaScript Document

/* 
	A través de ajax cargamos contenido html al elemento que le pasemos
	up_url => a que url le hacemos la petición de ajax
	p_params => parametros que le pasamos a la petición
	p_elemento => elemento html donde cargamos la petición
*/
function cargarObjetos(p_url, p_params, p_elemento)
{
		new Ajax.Updater(p_elemento, p_url, {
		  parameters: p_params,	
		  method: 'post',
		  evalScripts: true,
		  onSuccess: function(transport) {
			transport.responseText;
		  }
	});
}

function respuestaAjax(p_url, p_params, p_cargarpagina)
{
	new Ajax.Request( p_url, {
		  parameters: p_params,	
		  method: 'post',
		  evalScripts: true,
		  onSuccess: function(transport) {
			//transport.responseText;	
			},
		  onComplete: function(){
			  //transport.responseText;	
			location.href=p_cargarpagina;  
		  }
	});	
}

function initEditorTextarea()
{
tinyMCE.init({
		mode : "textareas",
		theme : "advanced",
		plugins : "advlink,searchreplace,paste,youtube",

		theme_advanced_buttons1: "bold,italic,underline,strikethrough,bullist,numlist,separator,undo,redo,separator,link,unlink,code,separator,cut,copy,paste,pastetext,pasteword,separator,search,replace,separator,youtube",
		theme_advanced_buttons2: "",
		theme_advanced_buttons3: "",
		relative_urls : false,
    	convert_urls : false,

		theme_advanced_disable : "paste,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,hr,anchor,image,cleanup,help,formatselect,styleselect,charmap,visualaid,removeformat",

		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_path_location : "bottom",
		content_css : "example_full.css",
		plugin_insertdate_dateFormat : "%Y-%m-%d",
		plugin_insertdate_timeFormat : "%H:%M:%S",
		extended_valid_elements : "object[width|height],param[name|value],embed[src|type|width|height],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
		external_link_list_url : "example_link_list.js",
		external_image_list_url : "example_image_list.js",
		flash_external_list_url : "example_flash_list.js",
		file_browser_callback : "fileBrowserCallBack",
		theme_advanced_resize_horizontal : true,
		theme_advanced_resizing : true
	});	
}


