//Creado con Ardora - www.webardora.net
//bajo licencia Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)
//para otros usos contacte con el autor
var aUser="";var personalJob;
$(document).ready(function() {aUser = $("#cabe_form .ui-widget-header").text().trim();$(".fg-button:not(.ui-state-disabled)").hover(function(){$(this).addClass("ui-state-hover");},function(){$(this).removeClass("ui-state-hover");})
.mousedown(function(){$(this).parents(".fg-buttonset-single:first").find(".fg-button.ui-state-active").removeClass("ui-state-active");if( $(this).is(".ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active") ){ $(this).removeClass("ui-state-active"); }
else { $(this).addClass("ui-state-active"); }}).mouseup(function(){if(! $(this).is(".fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button") ){$(this).removeClass("ui-state-active");}});
$("#gravar").dialog({autoOpen: false,modal: true,height: 200,width: 300,modal:true,buttons:{"OK" : function(){var retorno =1;if (jQuery.trim(document.entraDatos.titulo.value).length==0){ retorno = 0;}
if (retorno == 0){alert("Debe de introducir un texto ou frase.");$(this).dialog("close");document.entraDatos.titulo.focus();}else{document.entraDatos.submit();}},"Cancelar": function(){$(this).dialog("close")}}});
$("#borrar").dialog({autoOpen: false,modal: true,height: 200,width: 300,buttons:{"OK" : function(){var retorno =1;if (jQuery.trim(document.entraDatos.titulo.value).length==0){ retorno = 0;}
if (retorno==0){alert("Como mínimo, debes de introducir un título.");$(this).dialog("close");document.entraDatos.titulo.focus();}else{ if ($("#speedA").val() != "0") {deleteItem($("#speedA").val());}}},"Cancelar": function(){ $(this).dialog("close")}}});
$("#profe").dialog({autoOpen: false,modal: true,height: 575,width: 925,buttons:{"Pechar": function(){ $(this).dialog("close")}}});
CKEDITOR.config.language = "gl";
   CKEDITOR.replace( "comenta",
   {
      skin : "v2",
      toolbar : [ [ "Source", "-", "Bold", "Italic", "Underline", "Strike","-","Link","Unlink", "-", "MyButton" ],
      ["Cut","Copy","Paste","PasteText","-"] ]
   });
if ( $("#speedA").length ) {if (document.entraDatos.speedA.value!="0"){$("#b_borra").css("visibility", "visible");}else{$("#b_borra").css("visibility", "hidden");}
}else{$("#b_borra").css("visibility", "hidden");}
});
function showDialog(){$("#gravar").dialog("open");return false;}
function showDialogBorrar(){if (document.entraDatos.speedA.value!="0"){$("#borrar").dialog("open");}return false;}
function showDialogProfe(){$("#profe").dialog("open");return false;}
function deleteItem(oldItem) {$.ajax({type: "POST",dataType: "json",async: false,url: "ardoraAjaxJson.php",
data: {"action": "deleteItem","item": oldItem.trim(),"author": aUser}});window.open("index.php","_self");}
