function checkIndexType(){$select_index_type=$("#select_index_type");$size_header=$("#index_columns thead tr th:nth-child(2)");$column_inputs=$('select[name="index[columns][names][]"]');$size_inputs=$('input[name="index[columns][sub_parts][]"]');$add_more=$("#index_frm .tblFooters");if($select_index_type.val()=="SPATIAL"){$size_header.hide();$size_inputs.each(function(){$(this).prop("disabled",true).parent("td").hide()});var a=true;$column_inputs.each(function(){$column_input=$(this);if(!a){$column_input.prop("disabled",true).parent("td").hide()}else{a=false}});$add_more.hide()}else{$size_header.show();$size_inputs.each(function(){$(this).prop("disabled",false).parent("td").show()});$column_inputs.each(function(){$(this).prop("disabled",false).parent("td").show()});$add_more.show()}}AJAX.registerTeardown("indexes.js",function(){$("#select_index_type").die("change")});AJAX.registerOnload("indexes.js",function(){checkIndexType();checkIndexName("index_frm");$("#select_index_type").live("change",function(a){a.preventDefault();checkIndexType();checkIndexName("index_frm")})});