/********************************************** * cabo_utilities.js * *********************************************** * Cabo/JSUI version 0.5 November, 1999 * * Written by Robert Hoexter * * Oracle Corporation * **********************************************/ // Set global boolean variables describing browser and version var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) var Nav4plus = ((navigator.appName == "Netscape") && (parseFloat(navigator.appVersion) > 4.04)) var Nav5 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 5)) var IE4 = ((navigator.appName.indexOf("Microsoft") > -1)) && (parseInt(navigator.appVersion) == 4); var IE5 = ((navigator.appName.indexOf("Microsoft") > -1)) && (parseInt(navigator.appVersion) == 5); var anyIE = (IE4 || IE5) var anyNav = (Nav4 || Nav4plus || Nav5) //Directory variables used to construct paths as needed var image_dir = "images/"; var jslib_dir = "jslib/"; //Code to either determine the baseHref based upon this location, or to write whatever has been loaded //into a variable "baseHref" in the top page if (top.baseHref) { var hrefLocation = top.baseHref + ""; } else { var hrefLocation = document.location + ""; //if (hrefLocation.indexOf(".") > -1) hrefLocation = hrefLocation.substr(0,hrefLocation.lastIndexOf("/")+1); //removing the file name makes href='#' revert to the parent directory, rather than the top of any given page... //so, can't be done. Seems OK though, since a filename in the base HREF appears to be ignored anyway } //special code to write a base-href into any page loaded as a frame in Netscape if (anyNav && self.location != top.location) document.write("") // Common routines returning source html for empty "spacer" frames - function blankframe() { return "" } function grayframe() { return "" } // Common parsed parameter values for all constructor functions, and common regular expressions // Included here to avoid the possibility of duplicate and conflicting definitions. /********************************************************************************** regular expressions used to replace tokens in the HTML for table cells **********************************************************************************/ var repact = /AaAaA/; //Action, generic href action: "" var repval = /VvVvV/; //value, generic value used for display widgets var repurl = /UuUuU/; //URL, as part of anchor tag: "" var repfun = /JjJjJ/; //javascript function call var repcol = /CcCcC/; //column, when refering back to data table to update object var reprow = /RrRrR/; //row, when refering back to data table to update object var repsiz = /ZzZzZ/; //size, for text fields etc. " header-chars var p_headerchars = "headerchars:"; //maximum number of characters on a header line before wrapping var p_minwidth = "minwidth:"; //minimum width for column, set by a sized gif in the header var p_maximize = "maximize:"; //designate the specific column to 100% to force it to expand and take up slack var p_hidden = "hidden:"; //column attribute - allows columns to be hidden. (flag on col object array in table) var p_stripe = "stripe:"; //vertical stripes var p_banding = "banding:"; //horizontal striping var p_sortable = "sortable:"; //sort the array by the contents. Complicated! var p_disabled = "disabled:"; //for individual cells or whole columns var p_options = "options:"; //for poplists items? var p_optionsarray = "optionsarray:"; var p_defaultvalue = "defaultvalue:"; */ // Common routine used by all constructor libraries to parse and trim name:value; pairs function parsevalues (arg, obj, validargs) { while (arg.charAt(0) == " ") { arg = arg.substring(1) } while (arg.charAt(arg.length-1) == " ") { arg = arg.substr(0,arg.length-1); } var name_arg = arg.substring(0,arg.indexOf(":")); var search_arg = name_arg + ":"; var value_arg = arg.substring(arg.indexOf(":")+1); while (value_arg.charAt(0) == " ") { value_arg = value_arg.substring(1) } while (value_arg.charAt(arg.length-1) == " ") { value_arg = value_arg.substr(0,value_arg.length-1); } if (validargs.indexOf(search_arg) > -1) obj[name_arg] = value_arg; }