sortableReordered=false
function change_lists(list_type){form=$('form_change_lists')
form.action=form.action+'?'+'list_type='+list_type;form.submit();}
function cust_save_layout(form){try{form.action=form.action+'?'+
Sortable.serialize('cust_col_1')+'&'+
Sortable.serialize('cust_col_2');}catch(e){}}
function cust_reset_layout(){try{form=$('form_reset_layout')
form.submit();}catch(e){}}
function set_sortableReordered(){sortableReordered=true;setTimeout('unset_sortableReordered();',200);}
function unset_sortableReordered(){sortableReordered=false;}
function add_section(event,toggle_btn,max_items,btn_label){select_cat=$('home_section_category');select_max=$('home_section_maxitems');h_section_id=$('home_section_id');edit_mode=$('home_section_edit_mode');h_section_delete_line=$('home_section_delete_line');title=$('cust_edit_title');if(select_cat.length>0){select_cat[0].selected=true}
for(i=0;i<select_max.length;i++){if(max_items==select_max[i].value){select_max[i].selected=true;}}
h_section_id.value='';edit_mode.value='add';h_section_delete_line.style.display="none";title.innerHTML='Add a section'
toggle_element(['cust_edit'],['cust_dragdrop'],toggle_btn,btn_label,'',false,false,false);}
function edit_section(event,toggle_btn,section_id,category_id,category_name,max_items){try{if(sortableReordered==true){Event.stop(event);sortableReordered=false;return;}
select_cat=$('home_section_category');select_max=$('home_section_maxitems');h_section_id=$('home_section_id');edit_mode=$('home_section_edit_mode');h_section_delete=$('home_section_delete');h_section_delete_line=$('home_section_delete_line');title=$('cust_edit_title');for(i=0;i<select_cat.length;i++){if(category_id==select_cat[i].value){select_cat[i].selected=true;}}
for(i=0;i<select_max.length;i++){if(max_items==select_max[i].value){select_max[i].selected=true;}}
h_section_id.value=section_id;edit_mode.value='edit';h_section_delete.checked=false;h_section_delete_line.style.display="";title.innerHTML='Edit section'
hide_element($('cust_dragdrop'));show_element($('cust_edit'));}catch(e){}}
function edit_cancel(toggle_btn,btn_label){try{hide_element($('cust_edit'));show_element($('cust_dragdrop'));}catch(e){}}
function edit_save(){try{form=$('form_edit_save')}catch(e){}}