// Detect if browser is Netscape 3 + or IE 4 +. bName = navigator.appName; bVer = parseInt(navigator.appVersion); if ((bName == "Netscape" && bVer >= 3) || (bName == "Microsoft Internet Explorer" && bVer >= 4)) { br = "n3"; } else { br = "n2"; } // end if var myGlobalHandlers = { onCreate: function() { Element.show('systemWorking'); }, onComplete: function() { if (Ajax.activeRequestCount == 0) { Element.hide('systemWorking'); } } }; Ajax.Responders.register(myGlobalHandlers); var timer = null; function cb_update(database_target){ if (timer) { var x = clearTimeout(timer); } timer = setTimeout("database_research('" + database_target + "')",500); } // end function cb_update function database_research(database_target) { // an extra line var cb_status = $F('cb_status'); var cb_approval = $F('cb_approval'); var cb_inplay = $F('cb_inplay'); var cb_keyword = $F('cb_keyword'); var cb_type = $F('cb_type'); var cb_onlineonly = $F('cb_onlineonly'); var cb_affiliation = $F('cb_affiliation'); if (cb_keyword == 'Enter Keyword') { cb_keyword = ""; } var url = 'database_records.php?cb_status='+cb_status+'&cb_approval='+cb_approval+'&cb_inplay='+cb_inplay+'&cb_keyword='+cb_keyword+'&cb_type='+cb_type+'&cb_onlineonly='+cb_onlineonly+'&cb_affiliation='+cb_affiliation; // an extra line var aj = new Ajax.Updater(database_target, url, { method: 'get' , evalScripts: true }); } // end database research function function populate_thread(thread, expand) { if (expand == true) { var url = 'thread_show.php?thread='+thread + "&expand=true"; } else { var url = 'thread_show.php?thread='+thread; } var aj = new Ajax.Updater( {success:'thread_' + thread}, url, { method: 'get', evalScripts: true }); } // end populate thread function function lock_thread(thread) { var url = 'thread_tools.php?lock='+thread; var aj = new Ajax.Updater( 'lock_' + thread, url, { method: 'get' }); } // end populate thread function function unlock_thread(thread) { var url = 'thread_tools.php?unlock='+thread; var aj = new Ajax.Updater( 'lock_' + thread, url, { method: 'get' }); } // end populate thread function function delete_thread(thread, title) { input_box=confirm('Really delete thread, "'+ title + '"?\nTHIS ACTION CANNOT BE UNDONE!'); if (input_box==true) { var url = 'thread_tools.php?delete='+thread; var aj = new Ajax.Updater( 'thread_' + thread, url, { method: 'get' }); } // end if confirmed } // end populate thread function function addAbility(abil_position, abil_add) { var next_position = abil_position+1; var prev_position = abil_position-1; var place_position = next_position; // alert ("position is " + abil_position); // alert ("next position is " + next_position); var allsWell = true; var lastValue = $F("ABIL_last"); var abilityCount = (+lastValue) + 1; var url = '/database/ability_menu.php?position=' + next_position + '&abil_count=' + abilityCount + '&add=' + abil_add; // alert ("loading ability from url: " + url); // if we're clearing a row, we need to activate the "add" icon and remove the subtract icon on the previous row if (abil_add == '') { // alert ("deleting item: " + abil_position); // alert("We're deleting DIV " + abil_position); if (lastValue == abil_position) { // alert("This is the last active menu."); var prevAdd = document.getElementById('ABIL_add_' + prev_position); var prevSub = document.getElementById('ABIL_subtract_' + prev_position); if (prevAdd) { prevAdd.style.display = "inline"; } if (prevSub) { prevSub.style.display = "none"; } } // end if deleting the last item place_position = abil_position; } else { // alert ("adding new item: " + next_position); // we don't add a row if the current row is still empty! var currValue = $F("ABIL_name_" + abil_position); // alert('Current value of ABIL_name_' + abil_position + ' is ' + currValue); // alert ("Current position value: " + currValue); if (currValue != '') { // alert ("Current position value is greater than 0"); // if we're adding a row, we need to remove the "add" icon on the current row and activate the subtract icon var currAdd = document.getElementById('ABIL_add_' + abil_position); var currSub = document.getElementById('ABIL_subtract_' + abil_position); currAdd.style.display = "none"; currSub.style.display = "inline"; // we are setting the "last value" for this field so that // we can determine whether or not a field is the "last" // one, so we do not end up with more than one "add" icon // when field rows are removed var lastValueObject = document.getElementById('ABIL_last'); lastValueObject.value = next_position; } else { // alert ("It did not work."); allsWell = false; } } // end if adding a new row // alert ("Place_position is: " + place_position); // alert ("All's well?: " + allsWell); var targetDIV = 'ABIL_DIV_' + place_position; if (allsWell) { var aj = new Ajax.Updater(targetDIV, url, {method: 'get', evalScripts: true} ); } } // end add menu function function addMenu(menu_position, menu_name, table, name_field, menu_add) { var next_position = menu_position+1; var prev_position = menu_position-1; var place_position = next_position; // alert ("position is " + menu_position); // alert ("next position is " + next_position); var allsWell = true; var lastValue = $F(menu_name + "_last"); var menu_count = (+lastValue) + 1; var url = '/add_menu.php?menu_name=' + menu_name + '&position=' + next_position + '&name_field=' + name_field + '&table=' + table + '&menu_count=' + menu_count + '&add=' + menu_add; // alert ("loading ability from url: " + url); // if we're clearing a row, we need to activate the "add" icon and remove the subtract icon on the previous row if (menu_add == '') { // alert ("deleting item: " + menu_position); // alert("We're deleting DIV " + menu_position); if (lastValue == menu_position) { // alert("This is the last active menu."); var prevAdd = document.getElementById(menu_name + '_add_' + prev_position); var prevSub = document.getElementById(menu_name + '_subtract_' + prev_position); if (prevAdd) { prevAdd.style.display = "inline"; } if (prevSub) { prevSub.style.display = "none"; } } // end if deleting the last item place_position = menu_position; } else { // alert ("adding new item: " + next_position); // we don't add a row if the current row is still empty! var currValue = $F(menu_name + "_" + menu_position); // alert('Current value of ' + menu_name + '_' + menu_position + ' is ' + currValue); // alert ("Current position value: " + currValue); if (currValue != '') { // alert ("Current position value is greater than 0"); // if we're adding a row, we need to remove the "add" icon on the current row and activate the subtract icon var currAdd = document.getElementById(menu_name + '_add_' + menu_position); var currSub = document.getElementById(menu_name + '_subtract_' + menu_position); currAdd.style.display = "none"; currSub.style.display = "inline"; // we are setting the "last value" for this field so that // we can determine whether or not a field is the "last" // one, so we do not end up with more than one "add" icon // when field rows are removed var lastValueObject = document.getElementById(menu_name + '_last'); lastValueObject.value = next_position; } else { // alert ("It did not work."); allsWell = false; } } // end if adding a new row // alert ("Place_position is: " + place_position); // alert ("All's well?: " + allsWell); var targetDIV = menu_name + '_DIV_' + place_position; if (allsWell) { var aj = new Ajax.Updater(targetDIV, url, {method: 'get', evalScripts: true} ); } } // end add menu function function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } // DONE HIDING --> function openimage(imageName,iWidth,iHeight,scrollChoice) { var features = 'width=' + iWidth + ',height=' + iHeight + ',resizable=yes,fullscreen=no,status=no,toolbar=no,scrollbars=' + scrollChoice; var windowName = 'imageView'; if (iWidth==800 && iHeight==625) { windowName = 'floorPlanView'; } pressWin = window.open(imageName,windowName,features); }