/* * This function parses comma-separated name=value argument pairs from * the query string of the URL. It stores the name=value pairs in * properties of an object and returns that object. * Thanks to Javascript: Definitive Guide */ function getArgs() { var args = new Object( ); var query = location.search.substring(1); // Get query string var pairs = query.split(","); // Break at comma for(var i = 0; i < pairs.length; i++) { var pos = pairs[i].indexOf('='); // Look for "name=value" if (pos == -1) continue; // If not found, skip var argname = pairs[i].substring(0,pos); // Extract the name var value = pairs[i].substring(pos+1); // Extract the value args[argname] = unescape(value); // Store as a property // In JavaScript 1.5, use decodeURIComponent( ) instead of unescape( ) } return args; // Return the object } function put_msg() { var args = getArgs(); // Get arguments // logout if (args.logout) document.writeln("
Successfully Logged Out.
"); // Detect the new error messages if ( args.ep ) { var pos = args.ep.indexOf('&'); // Look for "name=value" var argval = args.ep.substring(0,pos); // Extract the name if ( pos == -1 ) argval = args.ep // Timeout if ( argval == "timeout" ) document.writeln("Session Expired.
"); // failed login else if ( argval == "flogin" ) document.writeln("Incorrect Username or Password.
"); // user not allowed to access submission opt else if ( argval == "user_not_allowed_subopt_id" ) document.writeln("Web Access Unavailable.
"); // user not allowed to access submission opt else if ( argval == "subopt_miss_configured" ) document.writeln("Web Access Unavailable.
"); // user not allowed to access submission opt else if ( argval == "urlapierror" ) document.writeln("URL API error.
"); // max attempts reached else if ( argval == "mats" ) document.writeln("Too Many Failed Login Attempts.
"); // General server error else if ( argval == "srverror" ) document.writeln("Server not responding. Please try again.
"); // Catch everyting else. else document.writeln(" There has been an error detected: " + argval + "
Please try again.