function gAjaxFailure( t ) { var debug = false; var message = 'AJAX failure: Error ' + t.status + ' -- ' + t.statusText; alert( message + ( debug ? '\n\n' + t.responseText : '' ) ); gLogException( new Error( message ), message + '\n\nContent Returned:\n\n' + t.responseText ); } function gEvalJSON( t, functionName ) { try { return t.responseText.evalJSON(); } catch( ex ) { if( ex != 'End' ) gLogException( ex, "Error in " + functionName + "(). Response Text: " + t.responseText ); } } function gIsValidJSON( t ) { try { t.responseText.evalJSON( true ); return true; } catch( ex ) { return false; } } function gHighlightErrorFields( errorFields, listItemId ) { if( errorFields != null ) { for( var i=0; i < errorFields.length; i++ ) { try { $( errorFields[ i ] + listItemId ).style.backgroundColor = '#FF6699'; } catch( ex ) { } } } } function gClearHighlightedErrorFields( theForm ) { for( var i = 0; i < theForm.elements.length; i++ ) { if( theForm.elements[i].type == "text" || theForm.elements[i].type == "textarea" || theForm.elements[i].type == "password" || theForm.elements[i].type == "select-one" ) { theForm.elements[i].style.backgroundColor = '#FFFFFF'; } } } function gFocusFirstErrorField( errorFields, listItemId ) { try { $( errorFields[ 0 ] + listItemId ).focus(); } catch( ex ) { } } function gLogException( ex, message ) { var opt = { method: 'post', postBody: "logJavaScriptException=true&exception=" + ex.message + "&message=" + escape( message ) } new Ajax.Request( '/code/utils_code.jsp', opt ); } function gLogError( comment, message ) { var opt = { method: 'post', postBody: "logJavaScriptException=true&exception=" + comment + "&message=" + escape( message ) } new Ajax.Request( '/code/utils_code.jsp', opt ); } var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i