try{$("#btnupdate").remove();$("#throbber").hide()}catch(e){}function mapListUpdate(a,b){if(a.length==0){alert("Network error during updating.")}jdata=$("<div>"+a+"</div>");$("#mutators fieldset").fadeOut("fast",function(){$(this).remove()});$("#mutators .noMutatorsMsg").fadeOut("fast",function(){$(this).remove()});$("#map").fadeOut("fast",function(){$("#map option").remove();x=jdata.children("#map");if($.browser.msie){x=x.contents()}else{x=x.contents().clone()}$("#map").append(x).fadeIn("fast");x=jdata.children("#mutators");$("#mutators").append(x.contents().clone()).fadeIn("fast");x=jdata.children("#mutatorGroupCount");$('input[name="mutatorGroupCount"]').val(x.val());$(".mutatorGroup input:radio, .mutatorGroup input:checkbox").click(function(){changeHistory=new Array();updateSelection(this,this.checked)})});$("#throbber").hide()}function ajaxError(a,c,b){$("#throbber").hide();if(a.status==403){document.location=pageUri}else{if(confirm("Network error during updating. Try again?")){$("#gametype").change()}}}var changeHistory;
$(".mutatorGroup input:radio, .mutatorGroup input:checkbox").click(function(){changeHistory=new Array();updateSelection(this,this.checked)});function updateSelection(b,a){if(jQuery.inArray(b,changeHistory)!=-1){return}changeHistory[changeHistory.length]=b;if(b.value!=""){jQuery.each($('input[value="'+b.value+'"]'),function(c,d){d.checked=a;updateSelection(d,a)})}if(a){jQuery.each($('input[name="'+b.name+'"]'),function(c,d){if(d==b){return}if(d.value==""){return}updateSelection(d,false)})}if($('input[name="'+b.name+'"]:checked').length==0&&$('input[name="'+b.name+'"]').length>1){$('input[name="'+b.name+'"]:first').attr("checked","checked")}}$(document).ready(function(){$("#btnupdate").remove();$("#gametype").after(' <div id="throbber"><span>Loading...</span></div>');$("#throbber").hide();$("#gametype").change(function(){$("#throbber").fadeIn();requestData={ajax:1,gametype:$("#gametype").val()};requestData.mutatorGroupCount=$('input[name="mutatorGroupCount"]').val();$('input[name^="mutgroup"]:checked').each(function(){requestData[this.name]=this.value
});$.ajax({type:"POST",url:pageUri+"+data",data:requestData,success:mapListUpdate,error:ajaxError})})});