jQuery(document).ready(function(){ jQuery("input[id*=checkboxall]").click(function() { var checked_status = this.checked; jQuery("input[id*=checklist]").each(function() { this.checked = checked_status; }); }); jQuery("input[id*=checkinvert]").click(function() { jQuery("input[id*=checklist]").each(function() { var status = this.checked; if (status == true) { this.checked = false; } else { this.checked = true; } }); }); }); function wpml_submitserial(form) { jQuery('#wpml_submitserial_loading').show(); var formdata = jQuery(form).serialize(); jQuery.post(wpmlajaxurl + '?action=wpmlserialkey', formdata, function(response) { jQuery('#wpmlsubmitserial').html(response); jQuery.colorbox.resize(); }); } function wpml_deleteserial() { jQuery('#wpml_submitserial_loading').show(); jQuery.post(wpmlajaxurl + '?action=wpmlserialkey&delete=1', false, function(response) { jQuery.colorbox.close(); parent.location.reload(1); }); } function jqCheckAll(checker, formid, name) { jQuery('input:checkbox[name="' + name + '[]"]').each(function() { jQuery(this).attr("checked", checker.checked); }); } function wpml_scroll(selector) { var targetOffset = jQuery(selector).offset().top; jQuery('html,body').animate({scrollTop: targetOffset}, 500); } function wpml_getlistfields(list_id, wpoptinid, divid, poststring, getpost, tabi) { jQuery('#listfieldsdiv' + wpoptinid).slideUp('slow'); if (getpost == "N") { var poststring = jQuery("#optinform" + wpoptinid).serialize(); } jQuery("#widget_loading" + wpoptinid).show(); jQuery.post(wpmlajaxurl + "action=wpmlgetlistfields&id=" + list_id + "&wpoptinid=" + wpoptinid + "&tabi=" + tabi + "", poststring, function(data) { jQuery("#widget_loading" + wpoptinid).hide(); jQuery("#" + divid).html(data).slideDown('slow'); }); } function wpml_subscribe(wpoptinid, form) { jQuery('#wpml-' + wpoptinid + 'button').button('option', 'disabled', true); jQuery('.wpmlerror').slideUp('slow'); var formvalues = jQuery("#optinform" + wpoptinid).serialize(); var updatediv = "optinform" + wpoptinid; var mytime = new Date().getTime(); jQuery("#widget_loading" + wpoptinid).show(); jQuery.post(wpmlajaxurl + 'action=wpmlsubscribe&mytime=' + mytime + '&divid=' + wpoptinid + '&id=' + wpoptinid, formvalues, function(response) { jQuery('#' + updatediv).html(response); jQuery('#wpml-' + wpoptinid + 'button').button('option', 'disabled', false); if (wpmlScroll == "Y") { wpml_scroll(jQuery('#' + updatediv)); } }); } function wpml_titletoslug(title) { var title = title.toLowerCase(); var slug = title.replace(/[^0-9a-z]+/g, ""); jQuery('#Field_slug').val(slug); } function wpml_tinymcetag(tag) { if (window.tinyMCE && tag != "") { window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tag); } wpml_scroll('#wp-content-editor-container'); }