(function(a){foswiki.Form={KEYVALUEPAIR_DELIMITER:";",formData2QueryString:function(e,k){if(!e){return null}var b=k||{};var g="";var c;var l="";for(i=0;i<e.elements.length;i++){c=e.elements[i];switch(c.type){case"text":case"hidden":case"password":case"textarea":case"select-one":g+=(c.name+"="+encodeURI(c.value)+foswiki.Form.KEYVALUEPAIR_DELIMITER);break;case"select-multiple":var h=false;for(var f=0;f<c.options.length;f++){var d=c.options[f];if(d.selected){if(b.collapseMulti){if(h){g+=(","+encodeURI(d.text))}else{g+=(c.name+"="+encodeURI(d.text));h=true}}else{g+=(c.name+"="+encodeURI(d.text)+foswiki.Form.KEYVALUEPAIR_DELIMITER)}}}if(b.collapseMulti){g+=foswiki.Form.KEYVALUEPAIR_DELIMITER}break;case"radio":if(c.checked){g+=(c.name+"="+encodeURI(c.value)+foswiki.Form.KEYVALUEPAIR_DELIMITER)}break;case"checkbox":if(c.checked){if(b.collapseMulti&&(c.name===l)){if(g.lastIndexOf("&")==g.length-1){g=g.substr(0,g.length-1)}g+=(","+encodeURI(c.value))}else{g+=(c.name+"="+encodeURI(c.value))}g+=foswiki.Form.KEYVALUEPAIR_DELIMITER;l=c.name}break}}g=g.substr(0,g.length-1);return g},makeSafeForTableEntry:function(c){if(!c){return null}var b;for(i=0;i<c.elements.length;i++){b=c.elements[i];switch(b.type){case"text":case"password":case"textarea":b.value=foswiki.String.makeTextSafeForTableEntry(b.value);break}}},getFormElement:function(b,c){return document[b][c]},setFocus:function(c,e){try{var b=foswiki.Form.getFormElement(c,e);b.focus()}catch(d){}},initBeforeFocusText:function(c,b){c.FP_defaultValue=b;if(!c.value||c.value==b){foswiki.Form._setDefaultStyle(c)}},clearBeforeFocusText:function(b){if(!b.FP_defaultValue){b.FP_defaultValue=b.value}if(b.FP_defaultValue==b.value){b.value=""}a(b).addClass("foswikiInputFieldFocus").removeClass("foswikiInputFieldBeforeFocus")},restoreBeforeFocusText:function(b){if(!b.value&&b.FP_defaultValue){foswiki.Form._setDefaultStyle(b)}a(b).removeClass("foswikiInputFieldFocus")},_setDefaultStyle:function(b){b.value=b.FP_defaultValue;a(b).addClass("foswikiInputFieldBeforeFocus")}}})(jQuery);jQuery(document).ready(function(a){a('input[type="text"].foswikiDefaultText').each(function(b,c){foswiki.Form.initBeforeFocusText(this,this.title)}).focus(function(){foswiki.Form.clearBeforeFocusText(this)}).blur(function(){foswiki.Form.restoreBeforeFocusText(this)});a(".foswikiCheckAllOn").click(function(c){var b=a(this).parents("form:first");a(".foswikiCheckBox",b).attr("checked",true)});a(".foswikiCheckAllOff").click(function(c){var b=a(this).parents("form:first");a(".foswikiCheckBox",b).attr("checked",false)})});