		function MWJSCrypt (OrigString, SeedIn)
		{
			// ----------- DO NOT EVER change the value of "Ref" ----------- //
			Ref="0123456789abcdefghijklmnopqrstuvwxyz._~ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			// ----------- DO NOT EVER change the value of "Ref" ----------- //
			var CipherVal = parseInt(SeedIn);// converts SeedIn to an integer value
			if ( isNaN(CipherVal))
			{ 
				// error if SeedIn is not a number.
				document.writeln("<b>*** Error!! ***</b><br/>function MWJScrpyt parameter("+
				SeedIn+") is not a number.");
				throw new Error("function MWJScrpyt parameter("+
				SeedIn+") is not a number.");
				return("");
			}
			else
			{
				if ( (CipherVal < 1) || (CipherVal > 99999999))
				{
					// error if SeedIn is not a number.
					document.writeln("<b>*** Error!! ***</b><br/>function MWJScrpyt parameter("+
					SeedIn+") seed range error.");
					throw new Error("function MWJScrpyt parameter("+SeedIn+") seed range error.");
					return("");
				}
				else
				{
					var Temp="";
					for (Count=0; Count < OrigString.length; Count++)
					{
						// loops until end of password
						var TempChar = OrigString.substring (Count, Count+1); //get 1 char
						var Conv = Ref.indexOf(TempChar); // returns index of ref
						
						if ( Conv == -1 )
						{
							// error if password has invalid characters
							document.writeln("<b>*** Error!! ***</b><br/>"+
							"Password contains invalid character.");
							throw new Error("function MWJScrpyt, Password"+
							" contains invalid character.");
							return("");
						}
						
						var Cipher=Conv^CipherVal; // logical 'or'
						var NewCipher = Cipher % Ref.length; // mod by length of Ref
						Cipher=Ref.substring(NewCipher, NewCipher+1) ;// call to function
						Temp += Cipher;// adds the new chars one by one
					}
					return (Temp);// returns the encrypted password
				}
			}
		}
		
		function dynamicLink(UserID)
		{
      // generate an "seed" for encrypting the password using the date and time 
      var now = new Date(); // reference to object date 
      var time = now.getHours() + now.getMinutes() + now.getSeconds(); // retrieve time from server 
      var date = now.getMonth() + now.getDay() + now.getYear(); //retrieve the date

			var seed = 8675309; //(date + time) ; // use the timestamp for a seed value
			//var userid = "Prescriba"; //(note: these values should not be hardcoded)
			var password = "Universal2010"; //(note: these values should not be hardcoded)
			var account = "universal"; //(note: these values should not be hardcoded)
			var epassword = MWJSCrypt (password, seed);
			var urlRoot = " https://custompoint.rrd.com/xs2/"+ 
				"?Option=2" +
				"&username=" + UserID + 
				"&password=" + epassword + 
				"&account=" + account +
				"&datetime=" + seed + 
				"&Module=CO" + 
				"&URL=windowclose.htm" + 
				"&ReturnText=Logout and Close Window";

			window.open(urlRoot);
		}
		
