function show_hide_clauses(a){if(a.val()!=""){a.parent().nextAll("span").show()}else{a.parent().nextAll("span").hide()}}AJAX.registerTeardown("tbl_relation.js",function(){$("select.referenced_column_dropdown").unbind("change")});AJAX.registerOnload("tbl_relation.js",function(){$("select.referenced_column_dropdown").each(function(a,b){show_hide_clauses($(b))});$("select.referenced_column_dropdown").change(function(){show_hide_clauses($(this))})});