$(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#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($) { }); $().ajaxSend(function(r,s){ $("#contentLoading").show(); }); $().ajaxStop(function(r,s){ $("#contentLoading").fadeOut("fast"); }); function loadContentO(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 $.get(url, {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(); 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(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, { 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() { loadContentO(''); } function actFoto(foto) { loadContentO(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() { loadContentF(''); } function actFotoF(foto) { loadContentF(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 }); }