
	// Display status message based on status code inputed into function
	
	function statusCodeMessage(statusCode)
	{
		switch (statusCode) 
		{
		case 03: document.write("<strong><font color='red'>The Web ID number or PIN that you entered is incorrect or it has already been used. Please try again. If you require assistance, please call 1-800-SASKTEL</font></strong><br><br>"); break
		case 04: document.write("<strong><font color='red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The username you've chosen is being used by someone else.  Please choose another username.</font></strong><br><br>"); break
		//case 05: reserved for field validation - do not use 
		//case 09: document.write("<strong><font color='red'>There are no accounts that are eligible for eBill.  This may be for one of the following reasons: <ul><li>Your account is new.  After you have received a paper bill, you may sign up to eBill.</li><li>The account is not eligible for eBill.  See ?? to see if you are eligible. </li></ul> If none of the above situations apply, please call 1-800-SASKTEL for assistance.</font></strong><br><br>"); break
		case 14: document.write("<strong><font color='red'>The username you've chosen is being used by someone else.  Please choose another username.</font></strong><br><br>"); break	
		case 15: document.write("<BR><strong><font color='green'>This account has been enabled under your online profile.<br><a href='https://secure4.i-doxs.net/SaskTel/subaccount.asp'><u>Click here</u></a> and choose 'Manage my eBills' from the left hand menu to add this account to eBill.</font></strong><br><br>"); break
		case 16: document.write("<BR><strong><font color='red'>The Web ID number or PIN that you entered is either incorrect, discontinued or has already been used.</font></strong><br><br>"); break	
		case 17: document.write("<BR><strong><font color='red'>Please complete both fields to activate that account.</font></strong><br><br>"); break	
		case 19: document.write("<BR><strong><font color='green'>Your online profile has been updated.  Click on 'My online profile' to continue.</font></strong><br><br>"); break	
		case 20: document.write("<BR><strong><font color='green'>Your password has been changed.</font></strong><br><br>"); break	
		case 21: document.write("<strong><font color='red'>The existing password you entered is incorrect.  Please try again.</font></strong><br><br>"); break	
		case 22: document.write("<strong><font color='red'>The new password you entered is invalid.  Your password must be a minimum of 8 characters.  Please try again.</font></strong><br><br>"); break	
		case 23: document.write("<strong><font color='red'>Your new password does not match the confirmed password.  Please try again.</font></strong><br><br>"); break	
		case 24: document.write("<BR><strong><font color='green'>Your password has been reset</font></strong><br><br>"); break	
		case 25: document.write("<strong><font color='red'>The username you entered is incorrect.  Please try again.  If you've forgotten your username, please refer to the Contact us link.</font></strong><br><br>"); break	
		case 26: document.write("<strong><font color='red'>The Challenge answer you entered is incorrect.  Please try again.  If you require assistance, please refer to the Contact us link.</font></strong><br><br>"); break	
		case 27: document.write("<strong><font color='red'>We are experiencing technical problems with updating your profile within all of our systems.  We will contact you via e-mail as soon as we have this problem resolved.</font></strong><br><br>"); break	
		case 28: document.write("<strong><font color='red'>The username you entered is incorrect.  Please try again.  If you've forgotten your username, call 1-800-SASKTEL.</font></strong><br><br>"); break	
        case 29: document.write("<strong><font color='red'>You have not signed up to this service.  Please sign up if you wish to access this service.</font></strong><BR><BR></font") ; break
		case 30: document.write("<BR><strong><font color='green'>Please use your new Username and Password to log in.</font></strong><br><br>"); break	
		case 32: document.write("<BR><strong><font color='green'>Please use your reset Password to log in.</font></strong><br><br>"); break	
		case 31: document.write("<strong><font color='red'>You have entered an incorrect Username or Password.  Please try again.</font></strong><br><br>"); break
		case 33: document.write("<strong><font color='red'>You have had three invalid login attempts.  Your Web ID is now locked for 30 minutes, you may try again in 30 minutes, or call 1-800-SASKTEL.</font></strong><br><br>"); break
        case 40: document.write("<BR><strong><font color='green'>You have successfully signed up for the requested service.</font></strong><br><br>"); break
        case 44: document.write("<BR><strong><font color='green'>You have successfully canceled the requested service.</font></strong><br><br>"); break
        case 45: document.write("<strong><font color='red'>We are currently experiencing system problems and are unable to enable your Customer Account Number. Please try again later.</font></strong><br><br>"); break   
		case 46: document.write("<strong><font color='green'>This is your first time logging in with your new Web ID.  Please review and make the necessary changes to your profile below.</font></strong><br><br>"); break            
		case 47: document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='green'>Your Web ID and PIN have been accepted.</font></strong><br><br>"); break
		case 48: document.write("<BR><strong><font color='green'>You have Successfully Logged In!</font></strong><br><br>"); break
		case 50: document.write("<strong><font color='red'>You have entered an incorrect Mobility Account or Unit Number.  Please try again.</font></strong><br><br>"); break     
        case 51: document.write("<BR><strong><font color='green'>You have successfully signed up for the requested service. However, we were unable to update your profile to reflect this change. Therefore the list of services given is not accurate. We sincerely apologize for your inconvenience and we will have this problem resolved quickly.</font></strong><br><br>"); break
        case 52: document.write("<strong><font color='green'>You have successfully canceled the requested service. However, we were unable to update your profile to reflect this change. Therefore the list of services given is not accurate. We sincerely apologize for your inconvenience and we will have this problem resolved quickly.</font></strong><br><br>"); break
			  case 53: document.write("<strong><font color='red'>You must enter a valid Telco Account and/or a valid Mobility Account and Unit Number.  Please try again.</font></strong><br><br>"); break     
		case 54: document.write("<strong><font color='red'>This account has already been enabled for online services with a Web ID.</font></strong><br><br>"); break
		}
	}

	// Parse out status code arguments from URL
	
	var arguments = unescape(document.location.search);	
	//var arguments = "TYPE=33554433&REALMOID=06-0003b1e1-303e-1f5e-afe1-8336245f0006&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=$SM$gFUxInPQe3g%2bvgVSFYBx0D%2fb9HSl%2fPvaLa617orc0jC6QJbjLi242A%3d%3d&TARGET=$SM$https%3a%2f%2fsecure%2esasktel%2ecom%2fwam%2fprofile%2fmanageprofile%2ehtm%3fstatusCode%3d30";
	
	if (arguments.indexOf("profileregistration") < 0)
	{
		var statusIndex = arguments.indexOf("statusCode");
		var statusVariableText = arguments.substring(statusIndex,statusIndex + 14);
	
		var statusCodeText = statusVariableText.substring(11,14);
		statusCodeNum = parseInt( statusCodeText , 10 );
		if (statusCodeNum > 0)
		{
			document.write("<span class='StoryConnection'>");
			statusCodeMessage(statusCodeNum);
			document.write("</span>");
		}
	}

