loadScript = function(url) { //var e = document.createElement("script"); //e.src = url; //e.type="text/javascript"; //document.getElementsByTagName("head")[0].appendChild(e); document.write(''); } loadScript('/BOSI/js/BOSI3.js'); loadScript('/BOSI/js/BOSI3_Forms.js'); var w3c=(document.getElementById)? true: false; var ns4=(document.layers)?true:false; var ie5=(w3c && document.all)? true : false; var ns6=(w3c && !document.all)? true: false; function formsSubmit(formsAction,formsButton,formsFocus) { document.mainform.formsAction.value = formsAction; if(typeof(formsButton) != 'undefined') { document.mainform.formsButton.value = formsButton; } if(typeof(formsFocus) != 'undefined') { document.mainform.formsFocus.value = formsFocus; } document.mainform.submit(); return false; } function cbAttachEvent(e,eventname,handler) { if(ie5) { return e.attachEvent(eventname,handler); } else { return e.addEventListener(eventname.substring(2,eventname.length),handler,false); } } function cbDetachEvent(e,eventname,handler) { if(ie5) { return e.detachEvent(eventname,handler); } else { return e.removeEventListener(eventname.substring(2,eventname.length),handler,false); } } /****************************************************************************************************************************************** Handle all the javascript actions for BOSIFORMS tables in their various modes ******************************************************************************************************************************************/ function BOSIDatatable(uid,currentSortString,scrollMode,selectMode,submitOnClick,submitOnDblClick) { // initialize the member function references // for the class prototype if (typeof(_BOSIDatatable_prototype_called) == 'undefined') { _BOSIDatatable_called = true; BOSIDatatable.prototype.init = init; BOSIDatatable.prototype.checkboxes = checkboxes; BOSIDatatable.prototype.pagedGo = pagedGo; BOSIDatatable.prototype.toggle = toggle; BOSIDatatable.prototype.select = select; BOSIDatatable.prototype.selectOne = selectOne; BOSIDatatable.prototype.deselect = deselect; BOSIDatatable.prototype.selectAll = selectAll; BOSIDatatable.prototype.deselectAll = deselectAll; BOSIDatatable.prototype.handleClick = handleClick; BOSIDatatable.prototype.handleDblClick = handleDblClick; BOSIDatatable.prototype.handleSort = handleSort; BOSIDatatable.prototype.handleQBEChange = handleQBEChange; } this.uid = uid; this.scrollMode = scrollMode; // 'paged' or 'scrolled' this.selectMode = selectMode; // 'none' (click causes onclick action) or 'single' or 'multi' this.currentSortString = currentSortString; // [a|d] this.submitOnClick = submitOnClick; this.submitOnDblClick = submitOnDblClick; this.init(); function init() { } // Handle pagination requests function pagedGo(startIndex) { var mainform = document.mainform; mainform['startIndex_'+this.uid].value=startIndex; mainform['actionVerb_'+this.uid].value='refresh'; bMainForm.doAction('controlAction',{ controlActionTarget:this.uid, focus:'CONTROL_'+this.uid }); return false; } function checkboxes() { var mainform = document.mainform; var l = mainform['selection_'+this.uid+':list']; if(l.length) { return l; } else { var nl = [l]; return nl; } } function select(index) { this.checkboxes()[index].checked = true; document.getElementById('TABLE_'+this.uid).rows[index+2].className = 'datarow selected'; } function toggle(index) { if(this.checkboxes()[index].checked) this.deselect(index); else this.select(index); } function deselect(index) { this.checkboxes()[index].checked = false; document.getElementById('TABLE_'+this.uid).rows[index+2].className = 'datarow'; } function selectOne(index) { this.deselectAll(); this.select(index); } function selectAll() { for(i=0;i=0; i--) { var o = from.options[i]; if (o.selected) { from.options[i] = null; } } if((from == this.list1 && this.sort1) || (from == this.list2 && this.sort2)) this.sort(from); if((to == this.list1 && this.sort1) || (to == this.list2 && this.sort2)) this.sort(to); from.selectedIndex = -1; to.selectedIndex = -1; this.save(); } function moveSelectionUp(obj) { if(typeof(obj)=="string") obj = document.getElementById(obj); if (!this.hasOptions(obj)) { return; } for (i=0; i=0; i--) { if (obj.options[i].selected) { if (i != (obj.options.length-1) && ! obj.options[i+1].selected) { this.swapOptions(obj,i,i+1); obj.options[i+1].selected = true; } } } this.save(); } function swapOptions(obj,i,j) { var o = obj.options; var i_selected = o[i].selected; var j_selected = o[j].selected; var temp = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected); var temp2= new Option(o[j].text, o[j].value, o[j].defaultSelected, o[j].selected); o[i] = temp2; o[j] = temp; o[i].selected = j_selected; o[j].selected = i_selected; } function sort(obj) { var o = new Array(); if (!hasOptions(obj)) { return; } for (var i=0; i (b.text+"")) { return 1; } return 0; } ); for (var i=0; i