var js1_debug = false; if ( js1_debug ) { alert( "Reading javascript_standard.jsp" ); } var isNav4 = false; var isNav6 = false; var isIE = false; /* * Browser version snooper; determines your browser * (Navigator 4, Navigator 6, or Internet Explorer 4/5) */ function setBrowser() { if (navigator.appVersion.charAt(0) == '4') { if (navigator.appName.indexOf('Explorer') >= 0) { isIE = true; } else { isNav4 = true; } } else if (navigator.appVersion.charAt(0) > '4') { isNav6 = true; } } // Call so that the browser actually gets intialized setBrowser(); var popupWin; function openWindow(height, width, url) { if ( popupWin != null ) { popupWin.close(); } popupWin = window.open( url,'popupWin','width=' + width + ',height=' + height + ',left=200,top=140,scrollbars=yes,status=yes'); popupWin.focus(); } function openWindowInContext(height, width, url) { openWindow(height, width, '/print' + url); } function openResizableWindow(height, width, url) { if ( popupWin != null ) { popupWin.close(); } popupWin = window.open( url,'popupWin','width=' + width + ',height=' + height + ',left=200,top=140,scrollbars=yes,resizable=yes'); popupWin.focus(); } function openResizableWindowInContext(height, width, url) { openResizableWindow(height, width, '/print' + url); } function toFloat(val) { val = val.replace(/[^0-9\.]/g, ""); return parseFloat(val); } function reloadOpener() { var loc = window.opener.document.location; window.opener.location=loc; } function reloadOpenerAtAnchor(anchor) { var loc = window.opener.document.location.href; var pos = loc.lastIndexOf( "#" ); loc = ( pos >= 0 ) ? loc.substring( 0, pos ) : loc; var pos2 = loc.lastIndexOf( "?" ); loc = ( pos2 >= 0 ) ? loc : loc + "?"; loc = loc + "&readonly=" + Math.random(); window.opener.location.href=loc + "#" + anchor; } function redirectOpener(url) { var loc = window.opener.document.location; window.opener.location="/print" + url; } function stripArgs(url) { return url.toString().substring(url.toString().lastIndexOf("?") + 1); } function padded( val, padding ) { var s = "" + val; while ( s.length < padding ) { s = "0" + s; } return s; } // Get the value selected from a \n"); // out.writeln(" \n"); // out.writeln(" \n"); // // if ( naEnglish ) { // out.writeln(this.getSelectStub("month", "update" + this.name + "DayField();")); // out.writeln(this.getSelectStub("day")); // out.writeln(this.getSelectStub("year", "update" + this.name + "DayField();")); // out.writeln(this.getSelectStub("hour")); // out.writeln(this.getSelectStub("min")); // out.writeln(this.getSelectStub("ampm")); // out.writeln("GMT"); // } // else { // out.writeln(this.getSelectStub("day")); // out.writeln(this.getSelectStub("month", "update" + this.name + "DayField();")); // out.writeln(this.getSelectStub("year", "update" + this.name + "DayField();")); // out.writeln(this.getSelectStub("hour")); // out.writeln(this.getSelectStub("min")); // out.writeln("GMT"); // } // // this.initDateOptions(); // this.initTimeOptions(); // this.initProcessFunction(); // // window.document.writeln(text); // return text; // } // // function DateInput.prototype.initProcessFunction() { // var out = window.document; // out.writeln("<" + "script> \n"); // out.writeln("function process" + this.name + "() { \n"); // out.writeln(" dateTimeProcess('document.forms.jobspec." + this.name + "day', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "month', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "year', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "hour', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "min', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "ampm', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "'); \n"); // out.writeln("} \n"); // out.writeln("process" + this.name + "(); \n"); // out.writeln("<" + "/SCRIPT> \n"); // } // // function DateInput.prototype.initTimeOptions() { // var out = window.document; // out.writeln("<" + "script> \n"); // out.writeln("setHourOptions('document.forms.jobspec." + this.name + "hour', " + this.name + "Obj); \n"); // out.writeln("setMinOptions('document.forms.jobspec." + this.name + "min', " + this.name + "Obj); \n"); // if ( naEnglish ) { // out.writeln("setAmPmOptions('document.forms.jobspec." + this.name + "ampm', " + this.name + "Obj); \n"); // } // out.writeln("<" + "/SCRIPT> \n"); // } // // function DateInput.prototype.initDateOptions() { // var out = window.document; // out.writeln("<" + "script" + "> \n"); // out.writeln("function update" + this.name + "DayField() { \n"); // out.writeln(" setDayOptions('document.forms.jobspec." + this.name + "day', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "month', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "year'); \n"); // out.writeln("} \n"); // out.writeln(" \n"); // out.writeln("setYearOptions('document.forms.jobspec." + this.name + "year', " + this.name + "Obj); \n"); // out.writeln("setMonthOptions('document.forms.jobspec." + this.name + "month', " + this.name + "Obj); \n"); // out.writeln("setDayOptions('document.forms.jobspec." + this.name + "day', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "month', \n"); // out.writeln(" 'document.forms.jobspec." + this.name + "year', " + this.name + "Date);");/*, \n"); // out.writeln(" " + this.date + "); \n");*/ // out.writeln("<" + "/SCRIPT> \n"); // } // // function DateInput.prototype.getSelectStub(stubname, javascriptExtra) { // var text = ""; // text += " \n"; // // return text; // } // ============================================================================= // End of date input object // ============================================================================= function setSelectedValue(field, value) { for ( var i = 0; i < field.options.length; i++ ) { if ( field.options[i].value == value ) { field.options[i].selected = true; } else { field.options[i].selected = false; } } } function js1_whitespace(ch) { return ch==" " || ch=="\t" || ch=="\n" || ch=="\r"; } function js1_trim(iStr) { if (typeof iStr != "string") { return iStr; } var str = iStr; if ( str.length == 0 ) { return str; } var ch = str.substring(0, 1); while (js1_whitespace(ch)) { str = str.substring(1, str.length); if ( str.length == 0 ) { return str; } ch = str.substring(0, 1); } if ( str.length == 0 ) { return str; } ch = str.substring(str.length-1, str.length); while (js1_whitespace(ch)) { str = str.substring(0, str.length-1); if ( str.length == 0 ) { return str; } ch = str.substring(str.length-1, str.length); } return str; } function js1_strReplace(str1, str2, str3) { while(str1.indexOf(str2) != -1) { str1 = str1.replace(str2, str3); } return str1; } function js1_unencode( str ) { return unescape(str); } function js1_encode( str ) { return escape( str ); } // Problem is that unescape(str) does not turn '+' into ' ' like it should. function js1_reencode( str ) { var s0 = (str == null)? "" : str; var s1 = js1_strReplace( s0, '+', '%20' ); var s2 = unescape( s1 ); return escape( s2 ); } function js1_getArgs() { var args = new Object(); var query = location.search.substring(1); // alert( "Query: " + query ); var pairs = query.split("&"); for ( var i = 0; i < pairs.length; i++ ) { var pos = pairs[i].indexOf( '=' ); if ( pos == -1 ) { continue; } var argname = pairs[i].substring(0,pos); var value = pairs[i].substring(pos+1); // In JavaScript 1.5 use decodeURIComponent var unescaped = js1_unencode(value); args[argname] = unescaped; } return args; } function setClasses(obj, style) { if ( obj.tagName ) { obj.className = style; } } if ( js1_debug ) { alert( "Finished reading javascript_standard.jsp" ); }