/********************************************************************************* * SugarCRM Community Edition is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by SugarCRM". ********************************************************************************/ var groups_arr=new Array();var chartTypesHolder=[];var groups_count=-1;var filters_arr=new Array();var filters_count_map=new Object();var filters_count=-1;var current_filter_id=-1;var groups_count_map=new Object();var current_group_id=-1;var join_refs=new Array();var group_field=null;var has_group=null;var global_report_def=null;var goto_anchor='';var all_fields=new Object();var full_table_list=new Object();full_table_list.self=new Object();full_table_list.self.parent='';full_table_list.self.value=document.EditView.self.options[document.EditView.self.options.selectedIndex].value;full_table_list.self.module=document.EditView.self.options[document.EditView.self.options.selectedIndex].value;full_table_list.self.label=document.EditView.self.options[document.EditView.self.options.selectedIndex].text;full_table_list.self.children=new Object();function hideCheckGroups(){document.getElementById('checkGroups').style.display='none';} function table_changed(obj){if(document.EditView.report_type[1].checked){if(typeof hideCheckGroupsTimeout!='undefined')clearTimeout(hideCheckGroupsTimeout);document.getElementById('checkGroups').style.display='';hideCheckGroupsTimeout=window.setTimeout('hideCheckGroups()',6000);} current_module=document.EditView.self.options[document.EditView.self.options.selectedIndex].value;if(obj.options[obj.selectedIndex].value==''){delete_this_join(obj.id);return;} full_table_list[obj.id].value=obj.value;full_table_list[obj.id].label=obj.options[obj.options.selectedIndex].text;if(obj.id!='self'){var parent_id=full_table_list[obj.id].parent;var parent_module=full_table_list[parent_id].module;var parent_link_defs=getLinksByRelType(module_defs[parent_module].link_defs);full_table_list[obj.id].link_def=parent_link_defs[full_table_list[obj.id].value];full_table_list[obj.id].module=getRelatedModule(full_table_list[obj.id].link_def);full_table_list[obj.id].link_def.table_key=obj.id;} else{full_table_list[obj.id].module=obj.value;} if(document.getElementById('report_results')!=null){document.getElementById('report_results').style.display='none';} delete_join_rows(obj.id);if(obj.id=='self'){reload_join_rows();deleteAllFilters();deleteAllGroups(0);reload_columns();} else{joinChecked(obj);} remakeGroups();document.EditView.sort_by.value='';document.EditView.sort_dir.value='';document.EditView.summary_sort_by.value='';document.EditView.summary_sort_dir.value='';} function showDetailsClicked(obj){if(obj.checked){document.getElementById('columns_table').style.display='';document.getElementById('columns_more_div').style.display='';} else{document.getElementById('columns_table').style.display='none';document.getElementById('columns_more_div').style.display='none';}} function deleteFilter(index){var this_row=filters_arr[filters_count_map[index]].row;this_row.parentNode.removeChild(this_row);filters_arr.splice(filters_count_map[index],1);for(id in filters_count_map){if(filters_count_map[id]>filters_count_map[index]){filters_count_map[id]--;}}} function deleteGroup(index){if(typeof(groups_count_map[index])=='undefined'||typeof(groups_arr[groups_count_map[index]])=='undefined'){return;} var this_row=groups_arr[groups_count_map[index]].row;this_row.parentNode.removeChild(this_row);groups_arr.splice(groups_count_map[index],1);for(id in groups_count_map){if(groups_count_map[id]>groups_count_map[index]){groups_count_map[id]--;}} var group_by_button=document.getElementById('group_by_button');group_by_button.style.display='inline';if(groups_arr.length==1&&document.EditView.chart_type.options.length>5){chartTypesHolder.push(document.EditView.chart_type.options[5]);document.EditView.chart_type.options[5]=null;} reload_columns('add');} function getReportType(){for(i=0;i0){filter.input_name0=to_display_date(filter.input_name0);} new_input.value=filter.input_name0;new_input.name="text_input";new_input.size="30";new_input.maxsize="255";new_input.visible="true";new_input.setAttribute('id','jscal_field');cell.appendChild(new_input);row.appendChild(cell);var cell=document.createElement("td");cell.setAttribute('valign','middle');var img_element=document.createElement("img");img_element.setAttribute('src','index.php?entryPoint=getImage&themeName='+SUGAR.themes.theme_name+'&imageName=jscalendar.gif');img_element.setAttribute('id','jscal_trigger');cell.appendChild(img_element);row.appendChild(cell);Calendar.setup({inputFieldObj:new_input,buttonObj:img_element,ifFormat:cal_date_format,showsTime:false,singleClick:true,step:1,weekNumbers:false});var filter_row=filters_arr[filters_count_map[current_filter_id]];filter_row.input_field0=new_input;filter_row.input_field1=null;} function addFilterNoInput(row,filter){var cell=document.createElement("td");cell.setAttribute('valign','middle');var new_input=document.createElement("input");new_input.type="hidden";new_input.value=filter.qualifier_name;new_input.name="text_input";cell.appendChild(new_input);row.appendChild(cell);} function addFilterInputEmpty(row,filter){var cell=document.createElement("td");cell.setAttribute('valign','middle');var new_input=document.createElement("input");new_input.type="hidden";new_input.value=filter.qualifier_name;new_input.name="text_input";cell.appendChild(new_input);row.appendChild(cell);var cell=document.createElement("td");row.appendChild(cell);var filter_row=filters_arr[filters_count_map[current_filter_id]];filter_row.input_field0=new_input;filter_row.input_field1=null;} function addFilterInputSelectMultiple(row,options,filter){var cell=document.createElement('td');row.appendChild(cell);var select_html_info=new Object();var options_arr=new Array();var select_info=new Object();select_info['size']='5';select_info['multiple']=true;select_html_info['select']=select_info;var selected_map=new Object();for(i=0;i";row.appendChild(cell);the_table.appendChild(row);if(groups_arr.length==1&&document.EditView.chart_type.options.length>5){chartTypesHolder.push(document.EditView.chart_type.options[5]);document.EditView.chart_type.options[5]=null;} else if(groups_arr.length==2){document.EditView.chart_type.options[5]=chartTypesHolder.pop();}} var default_filter={column_name:'',qualifier_name:'',input_name0:'',input_name1:''};function addFilter(filter){filters_arr[filters_arr.length]=new Object();filters_count++;filters_count_map[filters_count]=filters_arr.length-1;current_filter_id=filters_count;if(typeof(filter)=='undefined'){filter=default_filter;} var the_table=document.getElementById('filters');var row=document.createElement('tr');filters_arr[filters_count_map[filters_count]].row=row;row.valign="top";var module_cell=document.createElement('td');module_cell.valign="top";row.appendChild(module_cell);filters_arr[filters_count_map[filters_count]].module_cell=module_cell;addModuleSelectFilter(module_cell,filter);var column_cell=document.createElement('td');column_cell.valign="top";row.appendChild(column_cell);filters_arr[filters_count_map[filters_count]].column_cell=column_cell;addColumnSelectFilter(column_cell,filter);var qualify_cell=document.createElement('td');qualify_cell.valign="top";row.appendChild(qualify_cell);filters_arr[filters_count_map[filters_count]].qualify_cell=qualify_cell;addFilterQualify(qualify_cell,filter);var input_cell=document.createElement('td');input_cell.valign="top";row.appendChild(input_cell);filters_arr[filters_count_map[filters_count]].input_cell=input_cell;addFilterInput(input_cell,filter);var cell=document.createElement('td');cell.valign="top";row.appendChild(cell);var cell=document.createElement('td');cell.innerHTML="";row.appendChild(cell);the_table.appendChild(row);} function deleteAllFilters(){var the_table=document.getElementById('filters');var rows=the_table.rows;for(i=rows.length-1;i>=0;i--){the_table.removeChild(rows[i]);} return;} function deleteAllGroups(index){if(typeof(groups_arr[groups_count_map[index]])!='undefined'){var this_row=groups_arr[groups_count_map[index]].row;this_row.parentNode.removeChild(this_row);groups_arr.splice(groups_count_map[index],1);for(id in groups_count_map){if(groups_count_map[id]>groups_count_map[index]){groups_count_map[id]--;}} var group_by_button=document.getElementById('group_by_button');group_by_button.style.display='inline';} return;} function remakeGroups(){document.EditView['report_offset'].value=0;if(typeof(document.EditView.show_columns)!='undefined'&&document.EditView.show_columns.checked){module_defs[current_module].group_by_field_defs=new Object();for(i=0;i-1) filter_module=filter_module.substr(0,objName.indexOf("_div"));if(objName.indexOf("_div")>-1&&objName.substr(0,objName.indexOf("_div"))==filter_module){deleteFilter(index);} else{var filter={column_name:filter_row.module_select[filter_row.module_select.selectedIndex].value,qualifier_name:'',input_name0:'',input_name1:''};refreshFilterModule(filter_row.module_select,filter,index);}} for(var index in groups_arr){current_group_id=index;var group_row=groups_arr[groups_count_map[index]];var group_module=group_row.module_select[group_row.module_select.selectedIndex].value;if(objName.indexOf("_div")>-1) group_module=group_module.substr(0,objName.indexOf("_div"));if(objName.indexOf("_div")>-1&&objName.substr(0,objName.indexOf("_div"))==group_module){deleteGroup(index);} else{var group={column_name:group_row.module_select[group_row.module_select.selectedIndex].value};refreshGroupModule(group_row.module_select,group,index);refreshGroupColumn(group_row.column_select,group,index);refreshGroupQualify(group_row.qualify_select,group,index);}}} function delete_this_join(this_id){delete_join_rows(this_id);this_obj=document.getElementById(this_id+"_div");this_obj.parentNode.removeChild(this_obj);parent_id=full_table_list[this_id].parent;if(full_table_list[parent_id]!=null){delete full_table_list[parent_id].children[this_id];} delete full_table_list[this_id];joinChecked(this_obj);} function delete_join_rows(parent_id){all_fields=new Array();if(full_table_list[parent_id]!=null&&full_table_list[parent_id].children!=null){var children_list=full_table_list[parent_id].children;for(var child in children_list){delete_join_rows(child);delete full_table_list[child];delete full_table_list[parent_id].children[child];}} var children_div=document.getElementById(parent_id+"_children");if(children_div!=null){children_div.innerHTML='';children_div.style.display='none';}} function add_related(parent_id,my_id){var options=new Array();var option_info=new Object();option_info['value']='';option_info['text']=lbl_none;option_info['selected']=true;options[options.length]=option_info;var mod_name=full_table_list[parent_id].module;if(mod_name==null){alert(lbl_alert_cant_add);return(false);} if(module_defs[mod_name]==null){return(false);} var link_defs=getLinksByRelType(module_defs[mod_name].link_defs);var selected_linked_field;for(linked_field_name in link_defs){var linked_field=link_defs[linked_field_name];var selected=false;var option_info=new Object();option_info['text']=linked_field['label'];option_info['value']=linked_field_name;option_info['selected']=false;options[options.length]=option_info;} var select_html_info=new Object();var select_info=new Object();if(my_id==null){var id_num=0;while(document.getElementById(parent_id+'_link_'+id_num)!=null){id_num++;} select_info['name']=parent_id+'_link_'+id_num;} else{select_info['name']=my_id;} select_info['id']=select_info['name'];select_info['onchange']='table_changed(this);';select_html_info['select']=select_info;select_html_info['options']=options;full_table_list[select_info['id']]=new Object();full_table_list[select_info['id']].parent=parent_id;full_table_list[select_info['id']].children=new Object();full_table_list[parent_id].children[select_info['id']]=select_info['id'];children_div=document.getElementById(parent_id+"_children");if(children_div.style.display=='none'){children_div.style.display='';} new_child_div=document.createElement('div');new_child_div.style.marginLeft='10px';new_child_div.style.marginTop='5px';new_child_div.style.marginBottom='5px';new_child_div.innerHTML=""+LBL_RELATED+""+buildSelectHTML(select_html_info)+' '+lbl_add_related+' '+lbl_del_this+' '+ buildOuterJoinHTML(select_html_info)+'';new_child_div.id=select_info['name']+'_div';children_div.appendChild(new_child_div);} function reload_join_rows(type){} function build_join_rows(module,joins_table,level){join_refs=new Array();if(typeof(level)=='undefined'){level=0;} level++;var link_defs=getLinksByRelType(module_defs[module].link_defs,'one');if(level==1){} if(level<5){var tr=joins_table.insertRow(joins_table.rows.length);var td=tr.insertCell(tr.cells.length);var hidden_input='';join_index=0;for(linked_field_name in link_defs){var linked_field=link_defs[linked_field_name];var input_elem=document.createElement('input');input_elem.type='hidden';input_elem.name='link_'+linked_field['name'];input_elem.id='link_'+linked_field['name'];input_elem.value=linked_field['name'];join_index++;join_refs.push(input_elem);td.appendChild(input_elem);}} if(level==1){var options=new Array();var option_info=new Object();option_info['value']='';option_info['text']=lbl_none;option_info['selected']=selected;options[options.length]=option_info;var link_defs=getLinksByRelType(module_defs[module].link_defs,'many');var selected_linked_field;var first=true;for(linked_field_name in link_defs){if(first){selected_linked_field=link_defs[linked_field_name];first=false;} var linked_field=link_defs[linked_field_name];var selected=false;var option_info=new Object();option_info['value']=linked_field['name'];option_info['text']=linked_field_name.substring(0,1).toUpperCase()+linked_field_name.substring(1,linked_field_name.length);option_info['selected']=selected;options[options.length]=option_info;} var select_html_info=new Object();var select_info=new Object();select_info['name']='joined';select_info['id']='multijoin';select_info['onchange']='joinChecked(this);';select_html_info['select']=select_info;var tr=joins_table.insertRow(joins_table.rows.length);var td=tr.insertCell(tr.cells.length);select_html_info['options']=options;}} function getSelectedLinkJoins(link_array){var link_join_array=new Object();var outer_check=document.getElementById("outer_joined");if(outer_check!=null){link_name=document.forms.EditView.joined;if(outer_check.checked){link_join_array[link_name.value]=1;} else{link_join_array[link_name.value]=0;}} return link_join_array;} function getSelectedLinks(){var joins_array=new Array();for(var index in full_table_list){if(index=='self'){continue;} if(full_table_list[index]!=null&&full_table_list[index].value!=''){joins_array.push(index);}} return joins_array;} function getRelatedModule(link_def){if(typeof link_def=='undefined'){return;} var rel_name=link_def.relationship_name;var rel_def=rel_defs[rel_name];if(typeof(rel_def)=='undefined'){return'';} if(link_def.bean_is_lhs){return rel_def['rhs_module'];} else{return rel_def['lhs_module'];}} function viewJoinChanged(obj){reload_columns('join');} function getSelectedLinkDefs(module){if(typeof(module)=='undefined'){module=current_module;} var new_links=new Object();var links=getSelectedLinks() var type='one';for(var i in links){if(typeof full_table_list[links[i]].link_def=='undefined'){return;} var linked_field=full_table_list[links[i]].link_def;var selected=false;var relationship=rel_defs[linked_field['relationship_name']];var rel_type=get_rel_type(linked_field,relationship);new_links[links[i]]=linked_field;} return new_links;} function moduleIsVisible(module){if(typeof(visible_modules[module])=='undefined'){return false;} return true;} function getLinksByRelType(link_defs,type){var new_links=new Object();for(var i in link_defs){var linked_field=link_defs[i];var module=getRelatedModule(linked_field);if(!moduleIsVisible(module)){continue;} var selected=false;var relationship=rel_defs[linked_field['relationship_name']];var rel_type=get_rel_type(linked_field,relationship);if(typeof(type)=='undefined'||rel_type==type){new_links[i]=link_defs[i];}} return new_links;} function getAllFieldsMapped(module){var all_fields=new Array();var summary_fields_str='';for(var k in module_defs[module].field_defs){all_fields["self:"+module_defs[module].field_defs[k].name]={"field_def":module_defs[module].field_defs[k],"linked_field_name":"self","label_prefix":module_defs[module].label};} for(var k in module_defs[module].summary_field_defs){all_fields["self:"+module_defs[module].summary_field_defs[k].name]={"field_def":module_defs[module].summary_field_defs[k],"linked_field_name":"self","label_prefix":module_defs[module].label};summary_fields_str+='|'+"self:"+module_defs[module].summary_field_defs[k].name;} all_fields["count"]=all_fields["self:count"];var link_defs=getSelectedLinkDefs(module);for(var i in link_defs){var join_module=getRelatedModule(link_defs[i]);if(typeof(module_defs[join_module])=='undefined'){continue;} for(var j in module_defs[join_module].field_defs){all_fields[i+":"+module_defs[join_module].field_defs[j].name]={"field_def":module_defs[join_module].field_defs[j],"linked_field_name":i,"label_prefix":link_defs[i].label};} for(var j in module_defs[join_module].summary_field_defs){var sum_field_def=module_defs[join_module].summary_field_defs[j];if(typeof(sum_field_def.field_def_name)!='undefined'){var field_def=module_defs[join_module].field_defs[sum_field_def.field_def_name];if(typeof(field_def.custom_type)!='undefined'){continue;}} all_fields[i+":"+module_defs[join_module].summary_field_defs[j].name]={"field_def":module_defs[join_module].summary_field_defs[j],"linked_field_name":i,"label_prefix":link_defs[i].label};}} return all_fields;} function doRename(obj){var label=prompt("Rename label:\n"+obj.default_label,obj.text);if(label!=null){obj.text=label;obj.saved_text=label;}} function saveLabel(type,obj){if(type=='column'){var columns_ref=object_refs['display_columns'];} else if(type=='detailsummary'){var columns_ref=object_refs['display_summary'];} else{return;} if(typeof(obj.lastIndex)!='undefined'&&obj.lastIndex!=-1){var current_option=columns_ref.options[obj.lastIndex];current_option.text=obj.value+' ['+current_option.default_label+']';current_option.saved_text=obj.value;} else{this.value='';this.lastIndex=-1;}} function reload_columns(reload_type){document.getElementById('column_label_editor').value='';if(typeof(reload_type)=='undefined'){reload_type='default';} current_module=document.EditView.self.options[document.EditView.self.options.selectedIndex].value;display_columns_ref=object_refs['display_columns'];hidden_columns_ref=object_refs['hidden_columns'];display_summary_ref=object_refs['display_summary'];display_summary_ref.onchange=function(){var current_option=this.options[this.selectedIndex];document.getElementById('detailsummary_label_editor').lastIndex=this.selectedIndex;if(typeof(current_option.saved_text)=='undefined'){document.getElementById('detailsummary_label_editor').value=current_option.text;} else{document.getElementById('detailsummary_label_editor').value=current_option.saved_text;}};hidden_summary_ref=object_refs['hidden_summary'];display_columns_ref.onchange=function(){var current_option=this.options[this.selectedIndex];document.getElementById('column_label_editor').lastIndex=this.selectedIndex;if(typeof(current_option.saved_text)=='undefined'){document.getElementById('column_label_editor').value=current_option.text;} else{document.getElementById('column_label_editor').value=current_option.saved_text;}};if(reload_type=='default'||reload_type=='regular'){if(reload_type=='default'){visible_fields_map=new Object();document.EditView.show_details.checked=false;document.getElementById('summary_table').style.display='none';document.getElementById('summary_more_div').style.display='none';document.getElementById('columns_table').style.display='';document.getElementById('columns_more_div').style.display='';visible_summary_fields_org=module_defs[current_module].default_summary_columns;visible_summary_fields=new Array();for(i=0;i0){view_join_value=view_join.options[view_join.selectedIndex].value;} view_join.options.length=0;if('self'==view_join_value){selected=true;} else{selected=false;} var select_counter=0;view_join.options[view_join.options.length]=new Option(module_defs[current_module].label,'self',selected);for(var i in full_table_list){if(i=="self"){continue;} var table_def=full_table_list[i];var selected=false;select_counter++;if(i==view_join_value){selected=true;} else{selected=false;} var label=table_def['label'];if(i!='self'){label=full_table_list[full_table_list[i].parent].label+' > '+label;} view_join.options[view_join.options.length]=new Option(label,i,selected);if(selected){view_join.selectedIndex=select_counter;}} var selected_module=current_module;current_prefix='self';var table_key=view_join.options[view_join.selectedIndex].value;var field_defs=new Object();if(table_key!='self'){current_prefix=table_key;selected_module=full_table_list[table_key].module;field_defs=module_defs[selected_module].field_defs;} else{field_defs=module_defs[selected_module].field_defs;} all_fields=getAllFieldsMapped(current_module);for(i=0;i0){selected_link_value=view_join_summary.options[view_join_summary.selectedIndex].value;} view_join_summary.options.length=0;if('self'==selected_link_value){selected=true;} else{selected=false;} view_join_summary.options[view_join_summary.options.length]=new Option(module_defs[current_module].label,'self',selected);var summary_select_counter=0;for(var i in full_table_list){if(i=="self"){continue;} var linked_field=full_table_list[i];var selected=false;if(i==selected_link_value){selected=true;} else{selected=false;} var label=linked_field['label'];if(i!='self'){label=full_table_list[full_table_list[i].parent].label+' > '+label;} summary_select_counter++;view_join_summary.options[view_join_summary.options.length]=new Option(label,i,selected);if(selected){view_join_summary.selectedIndex=summary_select_counter;}} var selected_module=current_module;current_prefix='self';var sum_table_key=view_join_summary.options[view_join_summary.selectedIndex].value;if(sum_table_key!=''&&sum_table_key!='self'){current_prefix=sum_table_key;selected_module=full_table_list[sum_table_key].module;} var valid_groups=new Object();var group_by_table=document.getElementById('group_by_tbody');has_group=null;for(i=0;i0&&has_group!=null){document.getElementById('no_chart_text').style.display='none';document.EditView.numerical_chart_column.disabled=false;document.EditView.chart_type.disabled=false;document.EditView.chart_type.selectedIndex=1;document.EditView.chart_description.disabled=false;} else{document.getElementById('no_chart_text').style.display='';document.EditView.numerical_chart_column.disabled=true;document.EditView.chart_type.disabled=true;document.EditView.chart_type.selectedIndex=0;document.EditView.chart_description.disabled=true;}} function set_readonly(form){if(form.save_report.checked){form.save_report.value='on';form.save_report_as.readOnly=false;form.save_report_as.focus();} else{form.save_report.value='off';form.save_report_as.readOnly=true;}} function addSelectOptionAttrs(info,obj){for(i=0;i";} text+="";return text;} function buildOuterJoinHTML(info){var text;var checked;checked='';if(report_def.link_joins!=null){for(key in report_def.link_joins){if(report_def.link_joins[key]==1){checked='CHECKED';}}} text=" "+lbl_outer_join_checkbox;text+='';return text;} function updateOuterJoin(obj){table_key=obj.id.replace("outer_","");if(obj.checked==true){full_table_list[table_key].optional=true;} else{full_table_list[table_key].optional=false;}} function saved_chart_drilldown(group_value,group_key,id){var report_url='index.php?module=Reports&page=report&action=index&id='+id+'#'+group_value;document.location=report_url;} function chart_drilldown(group_value,is_saved_report,id){var anch=document.getElementById(group_value);var elems=document.anchors;for(var i in elems){var elem=elems[i];if(typeof(elem.name)!='undefined'&&elem.name!=''&&typeof(elem.id)!='undefined'&&elem.id!=''&&elem.id==elem.name){if(group_value==elem.name){elem.focus();window.scrollBy(0,300);}}}} function expandCollapseComboSummaryDiv(divId){if(document.getElementById(divId)){if(document.getElementById(divId).style.display=="none"){document.getElementById(divId).style.display="";document.getElementById("img_"+divId).innerHTML=document.getElementById("img_"+divId).innerHTML.replace(/advanced_search/,"basic_search");document.getElementById('expanded_combo_summary_divs').value+=divId+" ";} else{document.getElementById(divId).style.display="none";document.getElementById("img_"+divId).innerHTML=document.getElementById("img_"+divId).innerHTML.replace(/basic_search/,"advanced_search");document.getElementById('expanded_combo_summary_divs').value=document.getElementById('expanded_combo_summary_divs').value.replace(divId,"");}}}