var ORIGINAL_CONTEXT_PATH = "/EasyAlgoTrader"; var IS_SUB_DIR = false; var CONTEXT_PATH = getDocumentContext(); var APPLET_CODEBASE = CONTEXT_PATH + "/ClientClassLoader"; var APPLET_WIDTH = "100%"; var APPLET_HEIGHT = "100%"; if ( ( is.ns4) || ( is.mac == true && is.ns == true) ) { APPLET_WIDTH = window.innerWidth; APPLET_HEIGHT = window.innerHeight-2; } var APPLET_ALT_STRING = ("Nexaweb has detected a problem in your " + "environment settings. Please go to "" + "http://" + window.location.host + CONTEXT_PATH + "/Nexaweb/jsp/launcher/errorJavaDisabled.jsp" " + "for more information on how to correct the problem."); // figure the context path from href and host function getDocumentContext(){ // sample context: http://server:port/blah#a?b=c // sample context: http://server:port/blah/?b=c // sample context: http://server:port/?blah var context = document.location.href; var host = document.location.host; var patchedHost = host; // http://server:port/blah#a?b=c -> http://server:port/blah#a if (context.indexOf('?') >= 0) { context = context.substring(0, context.indexOf('?')); } // http://server:port/blah#a -> http://server:port/blah if (context.indexOf('#') >= 0) { context = context.substring(0, context.indexOf('#')); } // make sure later when we compare href and host, // both will end with slash or neither // the context could be: server:port/ (likely) or server:port depending // on the server // host is like server:port if ( ( context.lastIndexOf('/') == context.length - 1) && (host.lastIndexOf('/') != host.length - 1) ) { patchedHost = host + "/"; } // note, we should use document.location.pathname to get the // client side context path, but it's broken in IE 4, so we do most // of our parsing. if ( context.indexOf(patchedHost) + patchedHost.length == context.length ) { // 1. Special case: if the client side context is the root of the server, // then the context can only be the root context = ""; } else { // 2. otherwise, we parse out the client side context, should be something like: // /blah // http://server:port/blah -> /blah if ( context.indexOf(host) >= 0 ) context = context.substring(context.indexOf(host) + host.length); // remove the last slash only when it's not the root context if (context.lastIndexOf('/') >= 1) context = context.substring(0, context.lastIndexOf('/')); } // If the context has no similarity with the ORIGINAL_CONTEXT_PATH, // then we should just return the javascript parsed context. // If they share the same starting portion, and IS_SUB_DIR is explicit, // then we should return the original one because this is likely // from the subfolder. if ( context.indexOf(ORIGINAL_CONTEXT_PATH) ==0 && IS_SUB_DIR) { return ORIGINAL_CONTEXT_PATH; } // at this point, if IS_SUB_DIR is true, it's possible failing, that's // due to the unsupported case where you have mutliple client contexts // mapping to a server context. // otherwise, we will retuen the client javascript parsed out result. return context; } function writeAppletDefinition () { writeAppletDefinitionNormal(); } function writeAppletDefinitionNormal () { var appletDef = ( "\n" ); appletDef += getAppletParameters(); // For Java disabled case, output something to the browser // This works in some of the browser, but not all. Check the below for more info. appletDef += "

Nexaweb Error Message:

You don't have JAVA enabled or installed, click here for more info.
\n"; appletDef += "
"; // for NS 6+ and Mozilla, the alt message shows up, for FireFox, nothing shows up // The following code, although looks like fixing NS only, actually worked in above cases. if ( is.ns6up && !navigator.javaEnabled() ) { document.write("

Nexaweb Error Message:

You don't have JAVA plugin enabled or installed, click here for more info.
\n"); } else { document.write( appletDef ); } } function getAppletParameters () { var params = ""; params += getAppletParameter( "qtp-record-fix", "false" ); params += getAppletParameter( "style-sheet-0", "stylesheet.xss" ); params += getAppletParameter( "launch-ui-progress-handler", "com.nexaweb.client.launcher.DefaultProgressHandler" ); params += getAppletParameter( "launch-ui-barcolor", "#00C800" ); params += getAppletParameter( "errorStartingFailed", "Nexaweb/jsp/launcher/errorStartingFailed.jsp" ); params += getAppletParameter( "initialPage", "index.nxml" ); params += getAppletParameter( "launch-requirements-minimum-height", "0" ); params += getAppletParameter( "launch-ui-display", "Loading application..." ); params += getAppletParameter( "log-configuration@default-log-level", "exception" ); params += getAppletParameter( "enableHttpRequestMethodCompatible", "false" ); params += getAppletParameter( "launch-ui-title", "" ); params += getAppletParameter( "log-configuration/consumers/consumer1", "com.nexaweb.client.log.DialogLogConsumer" ); params += getAppletParameter( "log-configuration/consumers/consumer0", "com.nexaweb.util.ConsoleLogConsumer" ); params += getAppletParameter( "debug-keys-enabled", "true" ); params += getAppletParameter( "application-type", "NXML" ); params += getAppletParameter( "ensurePreFourDotTwoMacroCompatibility", "false" ); params += getAppletParameter( "launch-ui-image-path", "classpath://com/nexaweb/client/launcher/images/nexaweblogo.gif" ); params += getAppletParameter( "display-wait-cursor-for-mco-calls", "false" ); params += getAppletParameter( "launch-requirements-jvm-version-include-0", "*" ); params += getAppletParameter( "launch-ui-fontface", "SansSerif" ); params += getAppletParameter( "launch-requirements-jvm-version-exclude-1", "1.2" ); params += getAppletParameter( "launch-requirements-error-page", "Nexaweb/jsp/launcher/errorLaunchRequirementsNotMet.jsp" ); params += getAppletParameter( "launch-requirements-jvm-version-exclude-0", "1.1" ); params += getAppletParameter( "launch-requirements-minimum-width", "0" ); params += getAppletParameter( "anti-alias-minimum-font-size", "18" ); params += getAppletParameter( "deleteNocabCookie", "Nexaweb/jsp/launcher/deleteNocabCookie.jsp" ); params += getAppletParameter( "launch-ui-bar-image-path", "classpath://com/nexaweb/client/launcher/images/animated_start.gif" ); params += getAppletParameter( "launch-ui-align", "left" ); params += getAppletParameter( "launch-requirements-jvm-vendor-include-0", "*" ); params += getAppletParameter( "launch-ui-version", "4.5.5.1826" ); params += getAppletParameter( "errorLoadingFailed", "Nexaweb/jsp/launcher/errorLoadingFailed.jsp" ); params += getAppletParameter( "errorLoadingTimedout", "Nexaweb/jsp/launcher/errorLoadingTimedout.jsp" ); params += getAppletParameter( "displayUnknownVmInStatus", "false" ); params += getAppletParameter( "allowPushInUnsupportedEnvs", "false" ); params += getAppletParameter( "launch-ui-bgcolor", "#FFFFFF" ); params += getAppletParameter( "uitest", "false" ); params += getAppletParameter( "ensurePreFourDotTwoResolutionSyntaxCompatibility", "false" ); params += getAppletParameter( "errorBuggyVM", "Nexaweb/jsp/launcher/errorBuggyVM.jsp" ); params += getAppletParameter( "timeout", "3" ); params += getAppletParameter( "useragent", "CCBot/1.0 (+http://www.commoncrawl.org/bot.html)" ); params += getAppletParameter( "errorBadVM", "Nexaweb/jsp/launcher/errorBadVM.jsp" ); params += getAppletParameter( "ensurePreFourDotTwoMcoStringArgumentCompatibility", "false" ); params += getAppletParameter( "persistent-connection-ping-latency-tolerance", "2000" ); params += getAppletParameter( "cabbase", "detect.cab,NexawebClient.cab,jfreechart.jar" ); params += getAppletParameter( "version", "Nexaweb Platform v4.5.5(build 1826 Tue, May 29 04:11:35 EDT 2007)" ); params += getAppletParameter( "launch-requirements-user-agent-include-0", "*" ); params += getAppletParameter( "persistent-connection-ping-interval", "45000" ); params += getAppletParameter( "tag-map-file-0", "customTagMappings.xml" ); params += getAppletParameter( "useRootElementAsContextInsteadOfDocument", "false" ); // The following are calculated in JavaScript // and therefore must be included individually. params += getAppletParameter("appcontext", CONTEXT_PATH ); var cookieString = document.cookie; if ( cookieString != null && cookieString.length > 0 ) { params += getAppletParameter("cookie", ""+replaceQuotes(cookieString)+""); } if ( is.ie == false || cookieString.indexOf("nexaweb-nocab=true") == -1 ) { // codebase bug #740 duplicate codebase param on mac ie if ( is.mac == false ) { params += getAppletParameter( "codebase", APPLET_CODEBASE ); } } return params; } function getAppletParameter ( name, value ) { return " \n"; } // remove all the quotes from the string and // replace with " function replaceQuotes(sourceString){ var indexPos = sourceString.indexOf("\""); while (indexPos != -1){ var stringLength = sourceString.length; sourceString = sourceString.substring(0, indexPos) + """ + sourceString.substring(indexPos + 1, stringLength); indexPos = sourceString.indexOf("\""); } return sourceString; } if ( areCookiesSupported ) { writeAppletDefinition(); }