rem: /* Criterion */ 
add: /* Criteria */ 
context: function search_criteria_add(id, elem_me, value1, value2, value3){    var d = document;  var search = d.getElementById(id);  search_counter++;  elements++;    if(search)   {    var row = construct_element("div", "search_row", "div_search_" + search_counter);    var field1 = construct_element("span", "search_element", "span_search_field1_" + search_counter);    var container = construct_element("span", "search_container", "span_search_container" + search_counter);    var field_add = construct_element("span", "search_element", "span_search_fieldadd_" + search_counter);    var field_remove = construct_element("span", "search_element", "span_search_fieldremove_"+search_counter);      /* Criterion */    var dropdown_criteria = construct_element("select", 0, "select_search_field1_criteria"+search_counter, "search["+search_counter+"][type]");    dropdown_criteria.setAttribute("size", "1");    dropdown_criteria.setAttribute("onchange", "javascript:search_criteria_changed(\""+row.getAttribute("id")+"\", "+search_counter+");");        for (var i=0; i<criteria.length; i++)    {      var criteria_text = d.createTextNode(criteria[i]["name"]);      var criteria_option = d.createElement("option");      criteria_option.setAttribute("value", criteria[i]["value"]);      if (value1 == criteria[i]["value"]) criteria_option.setAttribute("selected", "selected");      criteria_option.appendChild(criteria_text);      dropdown_criteria.appendChild(criteria_option);    }    /* Add */    var plus = d.createElement("a");    plus.setAttribute("href", "javascript:search_criteria_add(\""+id+"\", \""+row.getAttribute("id")+"\");");    plus.setAttribute("class", "search");    var plus_img = document.createElement("img");    plus_img.setAttribute("src", p_base + "images/icon-plus-16x16.png");    plus.appendChild(plus_img);        /* Remove */    var minus = d.createElement("a");    minus.setAttribute("href", "javascript:search_criteria_remove(\""+id+"\", \""+row.getAttribute("id")+"\");");    minus.setAttribute("class", "search");    var minus_img = document.createElement("img");    minus_img.setAttribute("src", p_base + "images/icon-minus-16x16.png");    minus.appendChild(minus_img);                field1.appendChild(dropdown_criteria);    field_add.appendChild(plus);    field_remove.appendChild(minus);            row.appendChild(field_add);    row.appendChild(field_remove);    row.appendChild(field1);    row.appendChild(container);      // ADD    var node = search.firstChild;    while (node!=null) {      if(node.nodeType == 1) {        if(node.getAttribute("id") == elem_me) {          node_next  = node.nextSibling;          if(node_next == null) {            elem_me = 0;          } else             search.insertBefore(row, node_next);        }      }      node = node.nextSibling;    }      if(elem_me == 0)       search.appendChild(row);         /* Virtual Call for initalizing*/    search_criteria_changed(row.getAttribute("id"), search_counter, value2, value3);      }}
meta: 8040	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8040/cc3f1ce326cfc8a23ca70d40ea1704d6207b348a/search.js/buggy/pentabarf/public/javascripts/search.js