function isIE() { return navigator.appName.indexOf("Internet Explorer") >= 0; } function isIE6() { // from http://ajaxian.com/archives/detecting-ie7-in-javascript return typeof document.body.style.maxHeight == "undefined"; } function isIE7() { return isIE() && !isIE6(); } var IsSafari = null; function tx_isSafari() { if (IsSafari == null) { IsSafari = navigator.userAgent.indexOf("Safari") >= 0; } return IsSafari; } function isFirefox() { return navigator.userAgent.indexOf("Firefox") >= 0; } // see http://www.bigbold.com/snippets/posts/show/701 String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); }; /* * Client side handler for DA ajax requests which update the dom. * Application must include prototype.js for this to work. */ function fireDirectActionAjax(element, url, afterEffect) { var ajax = new Ajax.Request( url, {method: 'get', onSuccess: function(xmlhttp) { var responseText = getResponseText(xmlhttp); tx_handleUpdatesFromDirectAction(responseText, afterEffect); } } ); return false; } /* handle the updates coming back from DirectActionService */ function tx_handleUpdatesFromDirectAction(responseText, afterEffect) { if (!handleAjaxExceptionPage(responseText)) { //responseText = tx_stripHeadTagFromAjaxResponse(responseText); var domUpdates = eval(responseText); for (var elementId in domUpdates) { $(elementId).innerHTML = domUpdates[elementId]; } if (afterEffect != undefined) { afterEffect(); } } } /* Trick to execute embedded JS code in an AJAX response. Norton sometimes strips