$(document).ready(function() { $(".dropdown dt a").click(function() { $(".dropdown dd ul").toggle(); }); $(document).bind('click', function(e) { var $clicked = $(e.target); if (! $clicked.parents().hasClass("dropdown")) $(".dropdown dd ul").hide(); }); $("a#abrirOpciones1").click( function() { $("div#opcion1").show("fast"); $("div#opcion1c").hide(); $("div#opcion1a").show(); } ); $("a#cerrarOpciones1").click( function() { $("div#opcion1").hide("fast"); $("div#opcion1a").hide(); $("div#opcion1c").show(); } ); $('#layer1_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $("a#abrirOpciones2").click( function() { $("div#opcion2").show("fast"); $("div#opcion2c").hide(); $("div#opcion2a").show(); } ); $("a#cerrarOpciones2").click( function() { $("div#opcion2").hide("fast"); $("div#opcion2a").hide(); $("div#opcion2c").show(); } ); $('#layer2_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $("a#abrirOpciones3").click( function() { $("div#opcion3").show("fast"); $("div#opcion3c").hide(); $("div#opcion3a").show(); } ); $("a#cerrarOpciones3").click( function() { $("div#opcion3").hide("fast"); $("div#opcion3a").hide(); $("div#opcion3c").show(); } ); $('#layer3_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $("a#abrirOpciones4").click( function() { $("div#opcion4").show("fast"); $("div#opcion4c").hide(); $("div#opcion4a").show(); } ); $("a#cerrarOpciones4").click( function() { $("div#opcion4").hide("fast"); $("div#opcion4a").hide(); $("div#opcion4c").show(); } ); $('#layer4_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $("a#abrirOpciones5").click( function() { $("div#opcion5").show("fast"); $("div#opcion5c").hide(); $("div#opcion5a").show(); } ); $("a#cerrarOpciones5").click( function() { $("div#opcion5").hide("fast"); $("div#opcion5a").hide(); $("div#opcion5c").show(); } ); $('#layer5_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $("a#abrirOpciones6").click( function() { $("div#opcion6").show("fast"); $("div#opcion6c").hide(); $("div#opcion6a").show(); } ); $("a#cerrarOpciones6").click( function() { $("div#opcion6").hide("fast"); $("div#opcion6a").hide(); $("div#opcion6c").show(); } ); $('#layer6_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $("a#abrirOpciones7").click( function() { $("div#opcion7").show("fast"); $("div#opcion7c").hide(); $("div#opcion7a").show(); } ); $("a#cerrarOpciones7").click( function() { $("div#opcion7").hide("fast"); $("div#opcion7a").hide(); $("div#opcion7c").show(); } ); $('#layer7_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $("a#abrirOpciones1f").click( function() { $("div#opcion1f").show("fast"); $("div#opcion1fc").hide(); $("div#opcion1fa").show(); } ); $("a#cerrarOpciones1f").click( function() { $("div#opcion1f").hide("fast"); $("div#opcion1fa").hide(); $("div#opcion1fc").show(); } ); $('#layer1f_form').ajaxForm({ /*target: '#content',*/ success: function() { actTarjeta(); } }); $('#layer1f_formF').ajaxForm({ /*target: '#content',*/ success: function() { actF(); } }); }); jQuery(function($) { $("#contentArea").load("/plantillas/tarjetas.php?no=1"); }); $().ajaxSend(function(r,s){ $("#contentLoading").show(); }); $().ajaxStop(function(r,s){ $("#contentLoading").fadeOut("fast"); }); function loadContentO(texto1,texto2,texto3,texto4,texto5,texto6,texto7,foto) { // Show the loading div $("#contentLoading").show(); // Hide the links // Stops the user clicking more than once and putting // excessive load on the server // Delete any pre-existingtable $("#contentArea").empty(); // Load the data url="/plantillas/tarjetas.php"; $.get(url, {texto1:texto1,texto2:texto2,texto3:texto3,texto4:texto4,texto5:texto5,texto6:texto6,texto7:texto7,foto:foto}, function(data) { // When the Ajax call finishes: // fade out the loading div $("#contentLoading").fadeOut("fast"); // bring back the links for the user to click on // append the table of data to the contentArea div $("#contentArea").append(data); // tie the table sorter functionality to the table }); } function loadContentMove(x,linea,y) { // Show the loading div $("#contentLoading").show(); // Hide the links // Stops the user clicking more than once and putting // excessive load on the server // Delete any pre-existingtable $("#contentArea").empty(); url="/plantillas/tarjetas.php"; if (y=="x") { // Load the data $.get(url, {x:x, linea:linea}, function(data) { // When the Ajax call finishes: // fade out the loading div $("#contentLoading").fadeOut("fast"); // bring back the links for the user to click on // append the table of data to the contentArea div $("#contentArea").append(data); // tie the table sorter functionality to the table }); } else { // Load the data $.get(url, {y:x, linea:linea}, function(data) { // When the Ajax call finishes: // fade out the loading div $("#contentLoading").fadeOut("fast"); // bring back the links for the user to click on // append the table of data to the contentArea div $("#contentArea").append(data); // tie the table sorter functionality to the table }); } } function loadContentMoveF(x,linea,y) { // Show the loading div $("#contentLoading").show(); // Hide the links // Stops the user clicking more than once and putting // excessive load on the server // Delete any pre-existingtable $("#contentArea").empty(); valor=document.getElementById("estadoPortada").value; if (y=="x") { // Load the data if (valor==1) { url="/plantillas/felicitaciones.php"; } else { url="/plantillas/felicitaciones.anverso.php"; } $.get(url, {x:x, linea:linea}, function(data) { // When the Ajax call finishes: // fade out the loading div $("#contentLoading").fadeOut("fast"); // bring back the links for the user to click on // append the table of data to the contentArea div $("#contentArea").append(data); // tie the table sorter functionality to the table }); } else { // Load the data if (valor==1) { url="/plantillas/felicitaciones.php"; } else { url="/plantillas/felicitaciones.anverso.php"; } $.get(url, {y:x, linea:linea}, function(data) { // When the Ajax call finishes: // fade out the loading div $("#contentLoading").fadeOut("fast"); // bring back the links for the user to click on // append the table of data to the contentArea div $("#contentArea").append(data); // tie the table sorter functionality to the table }); } } function loadContentF(texto1,texto2,texto3,texto4,texto5,texto6,texto7,foto) { // Show the loading div $("#contentLoading").show(); // Hide the links // Stops the user clicking more than once and putting // excessive load on the server // Delete any pre-existingtable $("#contentAreaF").empty(); valor=document.getElementById("estadoPortada").value; if (valor==1) { url="/plantillas/felicitaciones.php"; } else { url="/plantillas/felicitaciones.anverso.php"; } // Load the data $.get(url, {texto1:texto1,texto2:texto2,texto3:texto3,texto4:texto4,texto5:texto5,texto6:texto6,texto7:texto7, foto:foto}, function(data) { // When the Ajax call finishes: // fade out the loading div $("#contentLoading").fadeOut("fast"); // bring back the links for the user to click on // append the table of data to the contentArea div $("#contentAreaF").append(data); // tie the table sorter functionality to the table }); } function moverX(x,linea) { y="x"; loadContentMove(x,linea,y); } function moverY(x,linea) { y="y"; loadContentMove(x,linea,y); } function moverXF(x,linea) { y="x"; loadContentMoveF(x,linea,y); } function moverYF(x,linea) { y="y"; loadContentMoveF(x,linea,y); } function actTarjeta() { t1=document.getElementById('texto1').value;t2=document.getElementById('texto2').value;t3=document.getElementById('texto3').value;t4=document.getElementById('texto4').value;t5=document.getElementById('texto5').value;t6=document.getElementById('texto6').value;t7=document.getElementById('texto7').value; loadContentO(t1,t2,t3,t4,t5,t6,t7,''); } function actFoto(foto) { t1=document.getElementById('texto1').value;t2=document.getElementById('texto2').value;t3=document.getElementById('texto3').value;t4=document.getElementById('texto4').value;t5=document.getElementById('texto5').value;t6=document.getElementById('texto6').value;t7=document.getElementById('texto7').value; loadContentO(t1,t2,t3,t4,t5,t6,t7,foto); } function cambiarAnverso() { portada=document.getElementById("estadoPortada"); if (portada.value==1) { portada.value=0; actTarjeta(); } } function cambiarPortada() { portada=document.getElementById("estadoPortada"); if (portada.value==0) { portada.value=1; actTarjeta(); } } function actF() { t1=document.getElementById('texto1').value;t2=document.getElementById('texto2').value;t3=document.getElementById('texto3').value;t4=document.getElementById('texto4').value;t5=document.getElementById('texto5').value;t6=document.getElementById('texto6').value;t7=document.getElementById('texto7').value; loadContentF(t1,t2,t3,t4,t5,t6,t7,''); } function actFotoF(foto) { t1=document.getElementById('texto1').value;t2=document.getElementById('texto2').value;t3=document.getElementById('texto3').value;t4=document.getElementById('texto4').value;t5=document.getElementById('texto5').value;t6=document.getElementById('texto6').value;t7=document.getElementById('texto7').value; loadContentF(t1,t2,t3,t4,t5,t6,t7,foto); } function abrirV(url,w,h) { izquierda = (screen.width) ? (screen.width-w)/2 : 100 arriba = (screen.height) ? (screen.height-h)/2 : 100 opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=' + w + ',height=' + h + ',left=' + izquierda + ',top=' + arriba + '' window.open(url, 'w', opciones) } function comprobarFormu(f) { if (f.nombre.value=="") { alert("El formulario no se puede enviar, el campo Nombre es obligatorio"); f.nombre.focus(); } if (f.apellidos.value=="") { alert("El formulario no se puede enviar, el campo Apellidos es obligatorio"); f.nombre.focus(); } if (f.direccion.value=="") { alert("El formulario no se puede enviar, el campo Direccion es obligatorio"); f.nombre.focus(); } } function cambiarGastos() { prov=document.getElementById("provincia"); provincia=prov.options[prov.selectedIndex].value;; imprenta="gastos"; $.get("/plantillas/precios.gastos.envio.php", {imprenta: imprenta, provincia:provincia}, function(data) { // bring back the links for the user to click on // append the table of data to the contentArea div document.getElementById("gastos").value=data; // tie the table sorter functionality to the table }); imprenta="total"; $.get("/plantillas/precios.gastos.envio.php", {imprenta: imprenta, provincia:provincia}, function(data) { // bring back the links for the user to click on // append the table of data to the contentArea div document.getElementById("total").value=data; // tie the table sorter functionality to the table }); }