function show_hide_clauses(a){if(a.val()!=""){a.parent().next("span").show().next("span").show()}else{a.parent().next("span").hide().next("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))})});