//show status of request on page function status(fl) { if(fl){ if($("confirm")) $('modal').setStyle('opacity',1); }else{ $('modal').setStyle('opacity',0); } } function parseSelectText(select,value) { if(typeof(select) != 'undefined'){ select = $(select); // get selectedIndex if(value){ for ( i = 0; i < select.options.length; ++i ){ option = $(select.options[i]); if( option.value == value){ option.selected = true; option.selectedIndex = i; } } } if(select.selectedIndex){ select.setStyle('color','#FD1B14'); }else{ select.setStyle('color','#000'); } // set supplied color for option for ( i = 0; i < select.options.length; ++i ){ option = $(select.options[i]); if(i == select.selectedIndex){ option.setStyle('color','#FD1B14'); }else{ option.setStyle('color','#000'); } if(select.selectedIndex == 0){ option.setStyle('color','#000'); } } // adjust first text option based on selectedIndex (select / unselect) option = $(select.options[0]); value = option.getProperty('html'); value = value.replace(/unselect/,'select'); if(select.selectedIndex != 0){ value = value.replace(/select/,'unselect'); } option.setProperty('html',value); } } function doQuery(startUpdate,select) { var actionUrl = '/thirdparty/facetsearch/facetsearchHandler.php'; showLoading(); status('loading'); parseSelectText(select); if(startUpdate){ $("start").setProperty('value',startUpdate); } new Request.HTML({ url: actionUrl, update: $('Results'), method: 'post', evalScripts: true, evalResponse: true, onComplete: function(){ initModal(); status(); }, onCancel: function(){ initModal(); status(); } }).send($('facetsearch').toQueryString()); location.replace("/search/browse/"+( $('topic_id').value ? $('topic_id').value+"/" : "0/" )+( $('user_role_id').value ? $('user_role_id').value+"/" : "0/" )+( $('consulting_activity_id').value ? $('consulting_activity_id').value+"/" : "0/" )+( $('period_dec').value ? $('period_dec').value+"/" : "0/" )+( $('abstraction_level_id').value ? $('abstraction_level_id').value+"/" : "0/" )+( $('perspective_id').value ? $('perspective_id').value+"/" : "0/" )+( $('start').value ? $('start').value+"/" : "0/" ) ); return; }