/*
 * PrintedEasy Mailing List Box dynamic functions
 *
 * @copyright Copyright ©2Creation.com Ltd 2008
 * @author Karl Orbell
 */
var inMailingListRefresh=false;function initMailingList(){var A=$("#mailinglist-form");A.submit(function(){refreshMailingListBox();return false})}function refreshMailingListBox(){if(inMailingListRefresh){return false}inMailingListRefresh=true;var B=getOptionSet();B.ajaxReload=1;B.subscribe=1;var C=jQuery.param(B);var A=$("#ml-action").val();$.post(A,C,function(F){var E=$("<div/>").append(F);var G=false;var D=E.find("#mailinglist-box");if(D.size()){$("#mailinglist-box").replaceWith(D);G=true}if(G){initMailingList()}inMailingListRefresh=false},"html");return false}function getOptionSet(){var A=$("#mailinglist-form :input");optionSet={};A.each(function(){var B=this.type;if(B=="checkbox"||B=="radio"){if(this.checked){optionSet[this.name]=this.value}}else{if(B!="submit"&&B!="image"){optionSet[this.name]=this.value}}});return optionSet}$(document).ready(function(){initMailingList()});