function editorHtml(simple) {
$('#infoMsg').html('Cargando editor...');
if(simple) {
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
editor_selector : "mceEditor",
plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
}); $('#infoMsg').html('Editor HTML cargado');
} else {
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
editor_selector : "mceEditor",
plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
}); $('#infoMsg').html('Editor HTML cargado');
} }
$(document).ready(function(){
$('#embedURL').gdocsViewer({ width: 680, height:450 });
$("a[rel^='prettyPhoto']").prettyPhoto({
social_tools:'',
keyboard_shortcuts: false, /* Set to false if you open forms inside prettyPhoto */
changepicturecallback: function(){editorHtml(); ver_multimedia();}});
$(".boton").mouseup(function(){
$(this).removeClass('pulsado');
}).mousedown(function(){
$(this).addClass('pulsado');
});
});
function ver_opciones_mult() {
$('#adminMultimedia').html('
');
$('#adminMultimedia').show();
$('input[name=eliminarMultimedia]').attr('checked', false);
ver_multimedia();
}
function ver_multimedia() {
$('#embedURL').gdocsViewer({ width: 640, height:400 });
$("#selectMult").change(function () {
var str = "";
$("#selectMult option:selected").each(function () {
if($(this).val()=='pdf' || $(this).val()=='img') {
$('.MultExtra2').html('');
}
else if($(this).val()=='linkYoutube') {
$('.MultExtra2').html('Tipo video:
ID Vídeo: ');
}
else {
$('#MultExtra').html('')
}
});
});
}
var myInterval;
var VAL = false;
function inicio() {
$('#slider').nivoSlider({
effect: 'fade',
animSpeed: 1000,
pauseTime: 5000,
directionNav: false,
controlNav: false});
date('#capa_calendario', -1, -1);
$('#enlaces .desplegable').mouseover(function () {
VAL=false;
clearInterval(myInterval);
mostrar_submenu(this);
}).mouseout(function () {
VAL = true;
activeInterval();
});
$("#submenu").mouseover(function () {
VAL=false;
clearInterval(myInterval);
}).mouseout(function () {
VAL = true;
activeInterval();
});
}
function activeInterval(){
if(VAL==true){
myInterval = setInterval(remover,200);
}
}
function remover(){
$("#submenu").hide();
}
function date(id, mes, anyo) {
if(anyo!=-1 && mes!=-1) {
if(mes==13) {
anyo++;
mes=1;
}
if(mes==0) {
anyo--;
mes=12;
}
var fecha_actual = new Date(anyo, mes-1, 1);
}
else {
var fecha_actual = new Date();
fecha_actual.setDate(1);
}
anyo=fecha_actual.getFullYear();
primer_dia = fecha_actual.getDay();
if(mes==-1) {
mes = fecha_actual.getMonth() + 1;
}
//ARRAYS GENERALES
var meses = new Array("Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre");
//DETERMINAMOS EL NUMERO DE DIAS QUE TIENE EL MES ACTUAL
var diasmesact = 1;
if((mes==1)||(mes==3)||(mes==5)||(mes==7)||(mes==8)||(mes==10)||(mes==12)){
diasmesact = 31;
}
else if(mes==2){
if (anyo % 4 == 0 && (anyo % 400 == 0 || anyo % 100 != 0))
diasmesact = 29;
else
diasmesact = 28;
}
else {diasmesact = 30;
}
//PARA ASIGNAR EL NUMERO DE DIAS EN BLANCO ANTES DEL DIA 1
if(primer_dia==0)
primer_dia=7;
//ESCRIBE EL CALENDARIO EN PÁGINA
$.getJSON('/funciones.php', {to:'eventoCalendario', mes:mes, anyo:anyo, ultimoDia:diasmesact}, function(data) {
calendario="";
calendario+='| << < '+meses[mes-1]+' '+anyo+' > >> |
';
calendario+="| Dl | Dt | Dc | Dj | Dv | Ds | Dg |
";
var dia=1;
for (j = 0; j < primer_dia-1; j++) {
calendario+="| - | ";
dia++;
if(dia==8) {
calendario+="
";
dia=1;
}
}
for (i = 0; i < diasmesact; i++) {
if(dia==1) {
calendario+='';
}
fecha=(i+1)+"/"+mes+"/"+anyo;
if(data[i+1]) {
evento="title=\""+data['titulo'][i+1]+"\" class=\"evento\" href=\"/calendario/?fecha="+fecha+"\"";
}
else evento="";
var d = new Date();
if(i+1==d.getDate() && mes-1==d.getMonth() && anyo==d.getFullYear()) {
hoy="class=\"hoy\"";
}
else hoy="";
calendario+="| "+(i+1)+" | ";
dia++;
if(dia==8) {
calendario+="
";
dia=1;
}
}
if(dia<8) {calendario+="";}
calendario+="
";
$(id).html(calendario);
});
}
function cambiar_seccion(id) {
}
function abrir_noticia(id) {
$('#columna-central').load('cont-pags.html #noticia1');
}
function mostrar_submenu(id) {
$('#submenu').html('Cargando...');
var offset = $(id).position();
$('#submenu').css('left', offset.left-20);
var id_sub='#'+$(id).attr('submenu');
$('#submenu').show();
$('#submenu').load('/cont-pags.php '+id_sub);
}
function iconos_mapa() {
$.getJSON('/funciones.php?to=iconos_mapa', {}, function(data) {
for(i=0; i