function LightBook(ImageObject) {
	var regex = /(.*)unlit\/(.*)\.(\w\w\w)$/;
	var result = ImageObject.src.match(regex);
	ImageObject.src = result[1] + "lit/" + result[2] + "-lit." + result[3];
}

function UnlightBook(ImageObject) {
	var regex = /(.*)lit\/(.*)-lit\.(\w\w\w)$/;
	var result = ImageObject.src.match(regex);
	ImageObject.src = result[1] + "unlit/" + result[2] + "." + result[3];
}

function CloseEBook() {
	if (eBookPopupWindow != null) {
		if (!eBookPopupWindow.closed) {
			eBookPopupWindow.close();
			eBookPopupWindow = null;
		}
	}	
}

function radioChange(change) {
	document.audioform.audioradio[change].checked=true;
	CloseEBook();
}

function displayStateInfo () {

	// decodeURIComponent does not work with Mac IE, so just look for spaces
	var unencodedStateName = stateName.replace(/\%20/g, ' ');

	// write out state and audio buttons
	document.write('<p><b>Your state is ' + unencodedStateName + '.<\/b> ');

	var curPath = window.location.pathname;
	var regex = /\/eservices\/\w\w\w\/\w\w\-\w\w\w\w/;
	var result = curPath.match(regex);
	if (result) {
		document.write('(<a href="../../state.html">change state<\/a>)<\/p>\n');
	} else {
		document.write('(<a href="state.html">change state<\/a>)<\/p>\n');
	}

	// done
	return 1;

} // displayAudioControls


function gotoURL(submitURL) {
	window.location = submitURL;
}

function popupURL(submitURL, width, height, chrome) {
	var attributes = ''; 
	if (chrome == true) {
		wattributes = 'width='+width+',height='+height+",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes";
	} else {
		wattributes = 'width='+width+',height='+height+",menubar=yes,scrollbars=yes,resizable=yes";
	}
	window.open(submitURL,'Printer_Version',wattributes);
}

//   getQueryParams() : Array
//
//   getGlobalText -- moved to functionality.js 2/28/04 TS


function getQueryParams() {
  
	var queryString = window.location.search.substring(1); 

	// Array to store parameters
	var queryParams = new Array();
 
 	// save full query string as parameter
 	queryParams['QUERY_STRING'] = queryString;
 	
	// multi-value separator
	multivalueSeparator = ', ';
	
	if (queryString.length < 1) { return queryParams; }

	var params = queryString.split('&');
	
	for (p in params) {
		var curParam = params[p];

		var paramParts = curParam.split('=');

		// if param missing 
		if (paramParts.length == 1) {
			paramParts[1] = '';
		}
		
		// unencode value
		paramParts[1] = paramParts[1].replace('+', ' ');
		paramParts[1] = unescape(paramParts[1]);
		
		if (queryParams[paramParts[0]]) {
			// parameter already exits, append additional value
			queryParams[paramParts[0]] += multivalueSeparator + paramParts[1];
		} else {
			// create new parameter in array
			queryParams[paramParts[0]] = paramParts[1];
		}
	}
	
	return queryParams;
  
} // getQueryParams

function gotoURLBasedOnRadio(radioButton, checkedValue, checkedURL, uncheckedURL, uncheckedMessage) {
	for (i = 0; i < radioButton.length; i++) {
		if (radioButton[i].checked) {
			if (radioButton[i].value == checkedValue) {
				window.location = checkedURL;
				return;
			} else {
				window.location = uncheckedURL;
				return;
			}
		}
	}
	alert(uncheckedMessage);
}

function gotoURLBasedOnCheckbox(URLcheckBox, checkedURL, uncheckedMessage) {
	if (URLcheckBox.checked) {
		window.location = checkedURL;
		return;
	}
	alert(uncheckedMessage);
}

function gotoURLBasedOnSelect(URLSelect) {
	if ((URLSelect.selecedIndex != -1) && URLSelect.options[URLSelect.selectedIndex].value) {
		window.location = URLSelect.options[URLSelect.selectedIndex].value;
	}
}

function gotoRoleURLBasedOnSelect(URLSelect) {
	if ((URLSelect.selecedIndex != -1) && URLSelect.options[URLSelect.selectedIndex].value) {
		gotoRoleURL(URLSelect.options[URLSelect.selectedIndex].value);
	}
}

//   getQueryParams() : Array
function getQueryParams() {
  
	var queryString = window.location.search.substring(1); 

	// Array to store parameters
	var queryParams = new Array();
 
 	// save full query string as parameter
 	queryParams['QUERY_STRING'] = queryString;
 	
	// multi-value separator
	multivalueSeparator = ', ';
	
	if (queryString.length < 1) { return queryParams; }

	var params = queryString.split('&');
	
	for (p in params) {
		var curParam = params[p];

		var paramParts = curParam.split('=');

		// if param missing 
		if (paramParts.length == 1) {
			paramParts[1] = '';
		}
		
		// unencode value
		paramParts[1] = paramParts[1].replace('+', ' ');
		paramParts[1] = unescape(paramParts[1]);
		
		if (queryParams[paramParts[0]]) {
			// parameter already exits, append additional value
			queryParams[paramParts[0]] += multivalueSeparator + paramParts[1];
		} else {
			// create new parameter in array
			queryParams[paramParts[0]] = paramParts[1];
		}
	}
	
	return queryParams;
  
} // getQueryParams

// COOKIE FUNCTIONS

LOGIN_COOKIE_NAME = 'ERIGHTS';

function cookieVal(cookieName)
{
	thisCookie = document.cookie.split("; ")
	for (i=0; i<thisCookie.length; i++)
		{
		if (cookieName == thisCookie[i].split("=")[0])
			{
			return thisCookie[i].split("=")[1]
			}
		}
	return 0;
}

function setCookie(name, value)
{
	// set expiration 1 year in future
	var expireDate= new Date();
	expireDate.setFullYear(expireDate.getFullYear() + 1);
	var expString = "";
	if (expireDate != null) {
		if (expireDate.toGMTString) {
			expString = "; expires=" + expireDate.toGMTString();
		} else if (expireDate.toUTCString) {
			expString = "; expires=" + expireDate.toUTCString();
		}
	}
	// set path to root
	pathStr = "; path=/";
	
	// set domain to .eduplace.com if web-based
	if (window.location.hostname.indexOf('eduplace.com') != -1) {
		domainStr = "; domain=.eduplace.com";
	} else {
		domainStr = '';
	}
	document.cookie = escape(name) + "=" + escape(value) + expString + pathStr + domainStr + "; ";
} 


// eBookBrowserCompatibility
function eServicesBrowserCompatibility () {

	var user = navigator.userAgent.toLowerCase();
	var win = 0;
	var mac = 0;
	var prob = 0;
	var brows;
	var vers;
	var result;
	var pattern;
	
	//alert(user);
	
	
	//// determine windows or mac
	if (user.indexOf('win') != -1) {
		win = 1;
	}
	else if (user.indexOf('mac') != -1) {
	 	mac = 1;
	}
	else {
		browserCompatibility = 'unknown';
	} 
	
	
	//// determine browser type
	if (typeof document.all != "undefined") {
		brows = 'ie';
	}
	else if (typeof document.getElementById != "undefined") {
		if (user.indexOf("netscape") != -1) {
			brows = 'ns';
		}
		else if(user.indexOf("gecko") != -1) { 
			brows = 'moz'; 
		}
		if (user.indexOf("safari") != -1 || (typeof document.childNodes != "undefined" && typeof document.all == "undefined" && typeof navigator.taintEnabled == "undefined")) { 
			brows = 'saf';
		}
	}
	else if ((user.indexOf('mozilla') != -1) && (parseInt(navigator.appVersion) >= 4)) {
		brows = 'ns';
	}
	else {
		browserCompatibility = 'unknown';
	}
	
	
	//// determine browser version
	//// if ie
	if (brows == 'ie') {
		pattern = /msie (\d+\.\d*)/;
		result = user.match(pattern);
		vers = result[1];
		//alert("Version = " + brows + vers);
		if (win && vers < 5.5) {
			//alert("We may have a problem...");
			browserCompatibility = 'no';
		}
		else if (mac && vers < 5) {
			//alert("We may have a problem...");
			browserCompatibility = 'no';
		}
		else if (mac && vers >= 5.2) {
			//alert("We may have a problem...");
			browserCompatibility = 'os10ie';
		}
	}
	
	//// if netscape
	else if (brows == 'ns') {
		pattern = /netscape\/(\d+\.\d*)/;
		result = user.match(pattern);
		if (result != null) {
			vers = result[1];
			//alert("Version = " + brows + vers);
		}
		else {
			pattern = /mozilla\/(\d+\.\d*)/;
			result = user.match(pattern);
			if (result != null) {
				vers = result[1];
				//alert("Version = " + brows + vers);
			}
		}
		if (vers < 7) {
			browserCompatibility = 'no';
			//alert("We may have a problem..."); 
		}
	}
	//else if (brows != 'moz' && brows != 'saf') {
	//	alert("We may have a problem..."); 
	//}
	
	if (browserCompatibility == "") { 
		browserCompatibility = "yes"; 
	}
	
	browserUserAgent = navigator.userAgent.toLowerCase();
	browserVersion = brows + vers;
	
} // eBookBrowserCompatibility


// Header/Footer Functions //
function displayHeader(headerType) {

	var adminHostDomain = 'https://secure.eservices.eduplace.com';
	if (window.location.host.indexOf('dev') != -1) {
		adminHostDomain = 'https://secure.dev.eservices.eduplace.com';
	}
	// branding
	//document.write('	<div id="hm_logo">Houghton Mifflin</div>\n');
	//document.write('	<div id="hm_logo"><img src="/eservices/images/logo_hm.gif" alt="Houghton Mifflin" /></div>\n'); esm
	
	//document.write('	<div id="school_eservices">School Division eServices</div>\n'); esm

	// navigation
	document.write('<div id="top_nav">\n');
	
	
		// display nav bar (state, welcome and logout)
		document.write('		<div id="page_nav">\n');
		document.write('			<div id="account_info">\n');
		if (role == 'classroomuser') {
			displayAccountInfo('classroom_portal:' + username);
		} else if  (role == 'unknown') {
			displayAccountInfo('unknown_portal:' + username);
		} else {
			displayAccountInfo('portal:' + username);
		}
		document.write('			<\/div><!-- end account_info -->\n');
		document.write('			<div id="state_info">\n');
		displayStateInfo();
		document.write('			<\/div><!-- end state_info -->\n');
		document.write('		<\/div><!-- end page_nav -->\n');
	
	
	document.write('	<div id="esv_logo"><img src="/eservices/graphics/logo_l1_esv.gif" alt="Houghton Mifflin Education Place eServices" width="219" height="102" /><\/div>\n');
	document.write('		<div id="login">\n');
	document.write('		<ul>\n');

	if (	(headerType == 'reg')
		||	(headerType == 'login')
	   )
	{
		// document.write('			<li id="contact_us"><a href="/eservices/help/contact_us.html" target="_blank">Contact Us</a></li>\n');
		// document.write('			<li id="help"><a href="/eservices/help/login.html" target="_blank">Help</a></li>\n');
	} else if (headerType && headerType.indexOf('use') == 0) {
		// document.write('			<li id="signout"><a href="' + adminHostDomain + '/eservicesadmin/logout.do">Sign out</a></li>\n');
		// document.write('			<li id="contact_us"><a href="/eservices/help/contact_us.html" target="_blank">Contact Us</a></li>\n');
		// document.write('			<li id="help"><a href="/eservices/help/index.html" target="_blank">Help</a></li>\n');
	} else if ( (headerType == 'error') ||	(headerType == 'logout') ) {
		// document.write('			<li id="contact_us"><a href="/eservices/help/contact_us.html" target="_blank">Contact Us</a></li>\n');
		// document.write('			<li id="help"><a href="/eservices/help/index.html" target="_blank">Help</a></li>\n');
	} else if (headerType == 'help') {
		// document.write('			<li id="contact_us"><a href="/eservices/help/contact_us.html">Contact Us</a></li>\n');
	} else if (headerType == 'contact') {
		// document.write('			<li id="help"><a href="/eservices/help/index.html">Help</a></li>\n');
	} else {
		//document.write('			<li id="signout"><a href="' + adminHostDomain + '/eservicesadmin/logout.do">Sign out</a></li>\n');
		document.write('			<li id="home"><a href="/eservices/index.html">Home</a></li>\n');
		// document.write('			<li id="contact_us"><a href="/eservices/help/contact_us.html" target="_blank">Contact Us</a></li>\n');
		// document.write('			<li id="help"><a href="/eservices/help/roles.html#admin" target="_blank">Help</a></li>\n');
	}

	document.write('		</ul>\n');
	document.write('			</div><!-- end login -->\n');
	document.write('		</div><!-- end top_nav -->\n');
	
} // displayHeader


function displayAccountInfo(displayMode) {

	var adminHostDomain = 'https://secure.eservices.eduplace.com';
	if (window.location.host.indexOf('dev') != -1) {
		adminHostDomain = 'https://secure.dev.eservices.eduplace.com';
	}

	var curUsername = '';
	if (displayMode && displayMode.indexOf('classroom_portal:') == 0) {
		curUsername = displayMode.substr(17);
		displayMode = 'classroom_portal';
	} else if (displayMode && displayMode.indexOf('unknown_portal:') == 0) {
		curUsername = displayMode.substr(15);
		displayMode = 'unknown_portal';
	} else if (displayMode && displayMode.indexOf('program_portal:') == 0) {
		curUsername = displayMode.substr(15);
		displayMode = 'program_portal';
	} else if (displayMode && displayMode.indexOf('portal:') == 0) {
		curUsername = displayMode.substr(7);
		displayMode = 'portal';
	}

	// write out account info
	if (displayMode == 'classroom_portal') {
		document.write('		<ul>\n');
		document.write('			<li id="username"><strong>Welcome ' + curUsername + '!</strong></li>\n');
		document.write('		<\/ul>\n');
		document.write('		<ul class="inline">\n');
		document.write('			<li id="logout"><a href="' + adminHostDomain + '/eservicesadmin/logout.do">Sign out</a></li>\n');
		document.write('		</ul>\n');
	} else if (displayMode == 'unknown_portal') {
		document.write('		<ul>\n');
		document.write('			<li id="username"><strong>Welcome ' + curUsername + '!</strong></li>\n');
		document.write('		<\/ul>\n');
		document.write('		<ul class="inline">\n');
		document.write('			<li id="logout"><a href="' + adminHostDomain + '/eservicesadmin/logout.do">Sign out</a></li>\n');
		document.write('		</ul>\n');
	} else if (displayMode == 'program_portal') {
		document.write('		<ul>\n');
		document.write('			<li id="username"><strong>Welcome ' + curUsername + '!</strong></li>\n');
		document.write('		<\/ul>\n');
		document.write('		<ul class="inline">\n');
		document.write('			<li id="logout"><a href="' + adminHostDomain + '/eservicesadmin/logout.do">Sign out</a></li>\n');
		document.write('		</ul>\n');
	} else if (displayMode == 'portal') {
		document.write('		<ul>\n');
		document.write('			<li id="username"><strong>Welcome ' + curUsername + '!</strong></li>\n');
		document.write('		<\/ul>\n');
		document.write('		<ul class="inline">\n');
		//document.write('		<ul>\n');
		document.write('			<li id="view_account"><a href="' + adminHostDomain + '/eservicesadmin/myaccount.do?activetab=myaccount">View Account</a></li>\n');
		document.write('			<li id="logout"><a href="' + adminHostDomain + '/eservicesadmin/logout.do">Sign out</a></li>\n');
		document.write('		</ul>\n');
	} else {
		document.write('		<ul>\n');
		document.write('			<li id="username"><strong>Welcome ' + curUsername + '!</strong></li>\n');
		document.write('		<\/ul>\n');
		document.write('		<ul class="inline">\n');
		document.write('			<li id="logout"><a href="' + adminHostDomain + '/eservicesadmin/logout.do">Sign out</a></li>\n');
		document.write('		</ul>\n');
	}
	
} // displayAccountInfo


function displayNav(tab) {

	// determine active tab
	var myAccountTabState = '';
	if (tab == 'myAccount') {
		myAccountTabState = ' id="current"';
	}
	var eServicesTabState = '';
	if (tab == 'eServices') {
		eServicesTabState = ' id="current"';
	}
	var classroomsTabState = '';
	if (tab == 'classrooms') {
		classroomsTabState = ' id="current"';
	}
	var teachersTabState = '';
	if (tab == 'teachers') {
		teachersTabState = ' id="current"';
	}
	
	if (role == 'single') {
		document.write('		  <ul>\n');
		document.write('			<li' + myAccountTabState + '><a href="javascript:gotoRoleURL(\'va.1.html\')">My Account</a></li>\n');
		document.write('		  </ul>\n');
	} else if (role == 'teacher') {
		document.write('		  <ul>\n');
		document.write('			<li' + myAccountTabState + '><a href="javascript:gotoRoleURL(\'va.1.html\')">My Account</a></li>\n');
		document.write('			<li' + classroomsTabState + '><a href="javascript:gotoRoleURL(\'va.15mu.html\')">Classrooms</a></li>\n');
		document.write('		  </ul>\n');
	} else if (role == 'admin') {
		document.write('		  <ul>\n');
		document.write('			<li' + myAccountTabState + '><a href="javascript:gotoRoleURL(\'va.1.html\')">My Account</a></li>\n');
		document.write('			<li' + eServicesTabState + '><a href="javascript:gotoRoleURL(\'va.4.html\')">eServices</a></li>\n');
		document.write('			<li' + classroomsTabState + '><a href="javascript:gotoRoleURL(\'va.15mu.html\')">Classrooms</a></li>\n');
		document.write('			<li' + teachersTabState + '><a href="javascript:gotoRoleURL(\'va.15su.html\')">Teachers</a></li>\n');
		document.write('		  </ul>\n');
	}
	
} // displayNav


function displayTitles(tab, tabRoot) {

	var tabCategory = '';
	if (tab == 'eServices') {
		tabCategory = 'eServices';
		tabRootURL = 'va.4.html';
	} else if (tab == 'classrooms') {
		tabCategory = 'Classrooms';
		if (role == 'teacher') {
			tabRootURL = 'va.15mu_twc.html';
		} else {
			tabRootURL = 'va.15mu.html';
		}
	} else if (tab == 'teachers') {
		tabCategory = 'Teachers';
		tabRootURL = 'va.15su.html';
	}

	var schoolName = '';
	var teacherName = 'David Jones - davidjones';
	var anotherSchoolOptions = '';
	if (school == 'PS-SCH') {
		schoolName = 'PS-SCH School Division of Houghton Mifflin Company';
		if (tab == 'eServices') {
			anotherSchoolOptions = '					<option value="va.4cit.html?school=PS-CIT">PS-CIT</option>\n';
			anotherSchoolOptions += '					<option value="va.4csr.html?school=PS-CSR">PS-CSR</option>\n';
		} else if (tab == 'classrooms') {
			anotherSchoolOptions = '					<option value="va.15mu_cit.html?school=PS-CIT">PS-CIT</option>\n';
			anotherSchoolOptions += '					<option value="va.15mu_csr.html?school=PS-CSR">PS-CSR</option>\n';
		} else if (tab == 'teachers') {
			anotherSchoolOptions = '					<option value="va.15su_cit.html?school=PS-CIT">PS-CIT</option>\n';
			anotherSchoolOptions += '					<option value="va.15su_csr.html?school=PS-CSR">PS-CSR</option>\n';
		}
	} else if (school == 'PS-CIT') {	
		schoolName = 'PS-CIT';
		if (tab == 'eServices') {
			anotherSchoolOptions = '					<option value="va.4.html?school=PS-SCH">PS-SCH School Division of Houghton Mifflin Company</option>\n';
			anotherSchoolOptions += '					<option value="va.4csr.html?school=PS-CSR">PS-CSR</option>\n';
		} else if (tab == 'classrooms') {
			anotherSchoolOptions = '					<option value="va.15mu.html?school=PS-SCH">PS-SCH School Division of Houghton Mifflin Company</option>\n';
			anotherSchoolOptions += '					<option value="va.15mu_csr.html?school=PS-CSR">PS-CSR</option>\n';
		} else if (tab == 'teachers') {
			anotherSchoolOptions = '					<option value="va.15su.html?school=PS-SCH">PS-SCH School Division of Houghton Mifflin Company</option>\n';
			anotherSchoolOptions += '					<option value="va.15su_csr.html?school=PS-CSR">PS-CSR</option>\n';
		}
	} else if (school == 'PS-CSR') {	
		schoolName = 'PS-CSR';
		if (tab == 'eServices') {
			anotherSchoolOptions = '					<option value="va.4.html?school=PS-SCH">PS-SCH School Division of Houghton Mifflin Company</option>\n';
			anotherSchoolOptions += '					<option value="va.4cit.html?school=PS-CIT">PS-CIT</option>\n';
		} else if (tab == 'classrooms') {
			anotherSchoolOptions = '					<option value="va.15mu.html?school=PS-SCH">PS-SCH School Division of Houghton Mifflin Company</option>\n';
			anotherSchoolOptions += '					<option value="va.15mu_cit.html?school=PS-CSR">PS-CSR</option>\n';
		} else if (tab == 'teachers') {
			anotherSchoolOptions = '					<option value="va.15su.html?school=PS-SCH">PS-SCH School Division of Houghton Mifflin Company</option>\n';
			anotherSchoolOptions += '					<option value="va.15su_cit.html?school=PS-CSR">PS-CSR</option>\n';
		}
	}
	
	if (tabRoot) {
		// just display schoolName if Psskey Admin or Teacher username if teacher w/classrooms
		if (role == 'teacher') {
			document.write('			<h1>' + tabCategory + ' for: ' + teacherName + '</h1>\n');
		} else {
			document.write('			<h1>' + tabCategory + ' for: ' + schoolName + '</h1>\n');
		}	
	} else {
		// display schoolName as link back to tab page
		if (role == 'teacher') {
			document.write('			<h1><a href="javascript:gotoRoleURL(\'' + tabRootURL + '\')">' + tabCategory + ' for: ' + teacherName + '</a></h1>\n');
		} else {
			document.write('			<h1><a href="javascript:gotoRoleURL(\'' + tabRootURL + '\')">' + tabCategory + ' for: ' + schoolName + '</a></h1>\n');
		}
	}
	document.write('\n');

	if (tabRoot && (role != 'teacher')) {
		document.write('			<form class="school_select" name="switch_customer">\n');
		document.write('				<select name="customer_select" onchange="javascript:gotoRoleURLBasedOnSelect(this)">\n');
		document.write('					<option value="">Select Another School...</option>\n');
		document.write(anotherSchoolOptions);
		document.write('				</select>\n');
		document.write('			</form>\n');
	}
	
} // display titles

function displayFooter() {

	document.write('<div id="footer">\n');
	document.write('	<p class="legal">Copyright &#169; Houghton Mifflin Company. All rights reserved.</p>\n');
	document.write('	<ul class="legal">\n');
	document.write('		<li class="first"><a href="http://www.hmco.com/privacy_policy.html">Privacy Policy</a></li>\n');
	document.write('		<li><a href="http://www.hmco.com/privacy_policy.html#coppa">Children\'s Privacy Policy</a></a></li>\n');
	document.write('		<li><a href="http://www.hmco.com/terms_and_conditions.html">Terms and Conditions of Use</a></li>\n');
	document.write('		<li><a href="/eservices/help/contact_us.html" target="_blank">Contact Us</a></li>\n');
	document.write('	</ul>\n');
	document.write('</div>\n');

} // displayFooter


// Form functions //
function errorFieldClass(fieldname) {

	var pageMsg = extractPageMsg();

	if (fieldname == 'username') {
		if (	(pageMsg == 'ra.2.uaiu')
			||	(pageMsg == 'va.7.uaiu')
			||	(pageMsg == 'va.8.uaiu')
		   )
		{
			return ' error';
		} else {
			return '';
		}
	} else {
		return '';
	}
	
} // fieldClass


function displayErrorFieldPrompt(fieldname) {

	var pageMsg = extractPageMsg();

	if (fieldname == 'username') {
		if (	(pageMsg == 'ra.2.uaiu')
			||	(pageMsg == 'va.7.uaiu')
			||	(pageMsg == 'va.8.uaiu')
		   )
		{
			document.write('<p class="error">Enter a different username.</p>');
		}
	}

} // displayErrorFieldPrompt


function setCheckBoxes(formName, fieldName, checkValue) {
	
	if (!document.forms[formName]) {
		return;
	}
	
	var curFieldNum = 1;
	var curCheckBox = document.forms[formName].elements[fieldName + curFieldNum.toString()];


	while (curCheckBox) {
		curCheckBox.checked = checkValue;
		
		curFieldNum += 1;
		curCheckBox = document.forms[formName].elements[fieldName + curFieldNum.toString()];
	}

} // setCheckBoxes


// Registration Functions //
var regType = 'order';
var regValue = '123456';
var regTitle = 'Register eServices for Order: ' + regValue;
var regMsg = 'You must have a Houghton Mifflin account to register this order\'s eServices. Follow the instructions below.';
function extractRegParams () {
	var queryParams = getQueryParams();
	
	if (queryParams['order'] != null) {
		regType = 'order';
		regValue = queryParams['order'];
		regTitle = 'Register eServices for Order: ' + regValue;
		regMsg = 'You must have a Houghton Mifflin account to register this order\'s eServices. Follow the instructions below.';
	} else if (queryParams['passkey'] != null) {
		regType = 'passkey';
		regValue = queryParams['passkey'];
		regTitle = 'Register eService for Passkey: ' + regValue;
		regMsg = 'You must have a Houghton Mifflin account to register this passkey\'s eService. Follow the instructions below.';
	} else if (queryParams['targeturl'] != null) {
		regType = 'targeturl';
		regValue = queryParams['targeturl'];
		regTitle = 'Requested Page: ' + regValue;
		regMsg = 'You must have a Houghton Mifflin account to access this page. Please login.';
	}
	
} // extractRegParams

function displayRegTitle() {

	document.write(regTitle);
					
} // displayRegTitle

function embedRegRequest() {
	document.write('<input type="hidden" name="' + regType + '" value="' + regValue + '"\n');
} // embedRegRequest


function gotoRegURL(submitURL) {
	if (submitURL.indexOf('?') != -1) {
		window.location = submitURL + '&' + regType + '=' + regValue;
	} else {
		window.location = submitURL + '?' + regType + '=' + regValue;
	}
}


function loginSubmitURL(loginForm) {

	var nextURL = '';
	if (regType == 'order') {
		nextURL = 'ra.4.html';
	} else if (regType == 'passkey') {
		if (isPasskeyMU(regValue)) {
			nextURL = 'ra.8.html';
		} else {
			nextURL = 'ra.6.html';
		}
	} else if (regType == 'targeturl') {
		window.location = regValue;
		nextURL = regValue;
	}
	
	setCookie(LOGIN_COOKIE_NAME, 'logged_in');

	loginForm.action = nextURL;
	return true;

} // loginSubmitURL


function isPasskeyMU (passkey) {

	if (passkey.indexOf('MU') != -1) {
		return true;
	} else {
		return false;
	}
	
} // isPasskeyMU


// Responsibilities & Agreement Message Functions //


function displayResponsibilities(responsibilitiesMsg) {

	document.write('								<textarea readonly="readonly" class="legal" cols="60" rows="6" wrap="physical" readonly title="eServices Passkey Administrator Terms of Service">');
	if (responsibilitiesMsgs[responsibilitiesMsg] != null) {
		document.write(responsibilitiesMsgs[responsibilitiesMsg]);
	} else {
		document.write('Could not find responsibilites for ' + responsibilitiesMsg + '.');
	}
	document.write('								</textarea>\n');
	
} // displayResponsibilities

function displayAgreement(agreementMsgPlaceholder) {

	document.write('								<textarea readonly="readonly" class="legal" cols="60" rows="6" wrap="physical" readonly title="eServices Passkey Administrator Terms of Service">');
	if (agreementMsg != null) {
		document.write(agreementMsg);
	} else {
		document.write('Could not find agreement for ' + agreementMsg + '.');
	}
	document.write('								</textarea>\n');
	
} // displayAgreement

// Responsibilities Messages //
var responsibilitiesMsgs = new Array();
responsibilitiesMsgs['ra.4'] = "Administrator responsibilities may include any of the following:\n";
responsibilitiesMsgs['ra.4'] += "\n";
responsibilitiesMsgs['ra.4'] += "1. creating user accounts\n";
responsibilitiesMsgs['ra.4'] += "2. adding eServices to user accounts\n";
responsibilitiesMsgs['ra.4'] += "3. distributing account and eService information to teachers and students\n";
responsibilitiesMsgs['ra.4'] += "4. managing users and eServices on an ongoing basis\n";
responsibilitiesMsgs['ra.4'] += "\n";
responsibilitiesMsgs['ra.4'] += "If you will not be the administrator for the above eServices, be sure that the person that will be administering them receives a copy of the eServices notification e-mail.";

responsibilitiesMsgs['ra.8'] = "Teacher/Administrator responsibilities may include any of the following:\n";
responsibilitiesMsgs['ra.8'] += "\n";
responsibilitiesMsgs['ra.8'] += "1. creating a classroom account\n";
responsibilitiesMsgs['ra.8'] += "2. distributing classroom account information to students (and the teacher)\n";
responsibilitiesMsgs['ra.8'] += "3. maintaining a classroom account\n";
responsibilitiesMsgs['ra.8'] += "\n";
responsibilitiesMsgs['ra.8'] += "If you will not be the teacher/administrator for the above eService, be sure that the person that will be administering the eService receives a copy of the notification e-mail.\n";


// Agreement Messages //
var agreementMsgs = new Array();


agreementMsg = "Before accepting our Online eService, you should carefully read the following License Agreement.  Clicking &quot;Agree&quot; indicates your acceptance of the terms and conditions contained in this License Agreement.  If you do not agree with them, you should click &quot;Disagree&quot;.  If you click &quot;Disagree&quot; and you purchased this eService, contact Customer Service at 800-733-2828, and your money will be refunded.\n";
agreementMsg += "\n";
agreementMsg += "Q:  HOW DO I ACCESS HOUGHTON MIFFLIN ONLINE EBOOKS?\n";
agreementMsg += "A: You have created or have been provided with a username and password that you will use to access the listed eService.  You can access the eService by pointing your browser to http://www.eduplace.com/eservices and entering your username and password when prompted.\n";
agreementMsg += "\n";
agreementMsg += "Q:  HOW MAY I USE THIS USERNAME AND PASSWORD?\n";
agreementMsg += "A:  You may use this username and password in accordance with the terms and conditions set forth in this User Agreement.  Houghton Mifflin Company and its licensors own and retain all title, copyright, trademark, and other proprietary rights in and to the content in the Online eService.\n";
agreementMsg += "\n";
agreementMsg += "&#151 If you have purchased a Single User Teacher License or Single User Student License you may use it on any computer.  You may not share the username or password with another person, and you may not otherwise license, sublicense, rent, or lease the product without permission from Houghton Mifflin Company.\n";
agreementMsg += "\n";
agreementMsg += "&#151 If you have purchased a Classroom License, you will be able to create a classroom account for that license or add the license to a classroom account you created previously.  You may not distribute the  classroom username and password to any student not in that class.  The classroom account can be used by any student in the classroom, and can be used on any computer.  The Classroom License has all the rights and restrictions set forth in the Single User Teacher and Single Use Student Licenses above.\n";
agreementMsg += "\n";
agreementMsg += "&#151 You may not remove or obscure any copyright, trademark, proprietary rights, disclaimer, or warning notice included on or embedded in any part of the Online eService.\n";
agreementMsg += "\n";
agreementMsg += "&#151 It is illegal to reverse compile, reverse assemble, reverse engineer, modify, or merge the software.  You may not create derivative works based upon the Online eService in whole or in part.\n";
agreementMsg += "\n";
agreementMsg += "Please note the school holds the licensing right to all accounts.  When the teacher or student is no longer affiliated with the licensed school and class with which the product was being used, the account may not be used.\n";  
agreementMsg += "\n";
agreementMsg += "Q:  WHAT CAN I DO IF I HAVE PROBLEMS USING MY PASSWORD OR ACCESSING THE ONLINE eBOOK?\n";
agreementMsg += "A: You should contact Customer Service at 800-733-2828.\n";
agreementMsg += "\n";
agreementMsg += "&#149 LIMITED WARRANTY.  EXCEPT AS STATED ABOVE, HOUGHTON MIFFLIN COMPANY MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n";
agreementMsg += "\n";
agreementMsg += "&#149 NO LIABILITY FOR DAMAGES.  IN NO EVENT SHALL HOUGHTON MIFFLIN COMPANY OR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THE ONLINE eBOOK BE LIABLE FOR ANY DIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, SUCH AS, BUT NOT LIMITED TO, LOSS OF BENEFITS, USE, OR DATA RESULTING FROM THE USE OF THE SOFTWARE, OR ARISING OUT OF ANY BREACH OF ANY WARRANTY.\n";
agreementMsg += "\n";
agreementMsg += "&#149 OTHER RIGHTS.  Some states do not permit exclusion of implied warranties or exclusion of incidental or consequential damages.  The above exclusions may not apply to you. This warranty provides you with specific legal rights.  There may be other rights that you may have which vary from state to state.\n";
agreementMsg += "\n";
agreementMsg += "Q:  ARE THERE ANY RESTRICTIONS ON GOVERNMENT USE OF THE PRODUCT?\n";
agreementMsg += "A:  Houghton Mifflin Company provides this product to government agencies subject to restricted rights.  Notice--Notwithstanding any lease or license agreement that may pertain to, or accompany the delivery of, this software, the rights of the government regarding its use, duplication and disclosure are set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 242.227-7013 and subparagraph (c)(1) and (2) of the Commercial Computer software -- Restricted Rights clause at FAR 52.227-19.\n";
agreementMsg += "\n";
agreementMsg += "Q:  IF I HAVE QUESTIONS ABOUT THIS LICENSE AGREEMENT, WHOM MAY I CONTACT?\n";
agreementMsg += "A:  If you have any questions about this License Agreement, you may call Customer Service at 800-733-2828.\n";

// Manage Account Functions //
var role = 'admin';
var school = 'PS-SCH';
function extractParams () {
	var queryParams = getQueryParams();
	
	if (queryParams['role'] != null) {
		role = queryParams['role'];
	}

	if (queryParams['school'] != null) {
		school = queryParams['school'];
	}

} // extractParams

function gotoRoleURL(submitURL) {
	if (submitURL.indexOf('?') != -1) {
		if (submitURL.indexOf('school=') == -1) {
			window.location = submitURL + '&role=' + role + '&school=' + school;
		} else {
			window.location = submitURL + '&role=' + role;
		}
	} else {
		if (submitURL.indexOf('school=') == -1) {
			window.location = submitURL + '?role=' + role + '&school=' + school;
		} else {
			window.location = submitURL + '?role=' + role;
		}
	}
	
}


// Browser compatibilty message
function displayBrowserCompatibilityMsg(browserCompatibility) {

	if (browserCompatibility == 'os10ie') {
		document.write('<p class="information">Several Houghton Mifflin eServices experience intermittent errors with Internet Explorer 5.x on OS X. We recommend using one of the <a href="/eservices/help/topics.html#browsers" target="_blank">supported browsers</a>.</p>');
	} else if (browserCompatibility != 'yes') {
		document.write('<p class="information">Houghton Mifflin eServices have not been tested with this Web browser. Should you encounter problems, we recommend using one of the <a href="/eservices/help/topics.html#browsers" target="_blank">supported browsers</a>.</p>');
	}

} // displayBrowserCompatibilityMsg


// Page Message Functions

function displayRegPageMsg() {

	var pageMsg = extractPageMsg();

	if (pageMsg) {
		if (pageMsgs[pageMsg] != null) {
			document.write('<p class="' + pageMsgs[pageMsg].msg_class + '">' + pageMsgs[pageMsg].msg + '</p>\n');
		} else {
			document.write('<p class="error">Unknown message:' + pageMsg + '</p>\n');
		}
	} else {
		document.write('<p class="information">' + regMsg + '</p>\n');
	}
					
} // displayRegPageMsg


function displayPageMsg() {

	var pageMsg = extractPageMsg();

	if (pageMsg) {
		if (pageMsgs[pageMsg] == null) {
			document.write('<p class="error">Unknown message:' + pageMsg + '</p>\n');
		} else {
			if (	(pageMsgs[pageMsg].msg_class == 'warning')
				||	(pageMsgs[pageMsg].msg_class == 'error')	
				||	(pageMsgs[pageMsg].msg_class == 'information')	
			   ) 
			{
				document.write('<p class="' + pageMsgs[pageMsg].msg_class + '">' + pageMsgs[pageMsg].msg + '</p>\n');
			} else if (pageMsgs[pageMsg].msg_class == 'fix_fields') {
				document.write('	<div class="fix_fields">\n');
				document.write('		<h4>There were problems submitting your form.</h4>\n');
				document.write('		<ul>\n');
				document.write('			<li>' + pageMsgs[pageMsg].msg + '</li>\n');
				document.write('		</ul>\n');
				document.write('	</div>\n');

			}
		}
	}
					
} // displayPageMsg


function extractPageMsg() {
	var queryParams = getQueryParams();

	if (queryParams['msg'] == null) {
		return null;
	} else {
		return queryParams['msg'];
	}
	
} // extractPageMsg


// Alert Messages //
var pageMsgs = new Array();

// system error
pageMsgs['err.se'] = new Object();
pageMsgs['err.se'].msg_class = 'warning';
pageMsgs['err.se'].msg = 'There has been a system error.  Please contact Customer Service at 800-733-2828.';

pageMsgs['es.ca_not_pa'] = new Object();
pageMsgs['es.ca_not_pa'].msg_class = 'warning';
pageMsgs['es.ca_not_pa'].msg = 'A Teacher with a Classroom account cannot be an eServices Administrator. You will have to use a separate administrator account.  Please contact Customer Service at 800-733-2828 if you have any questions.';

pageMsgs['es.pa_not_ca'] = new Object();
pageMsgs['es.pa_not_ca'].msg_class = 'warning';
pageMsgs['es.pa_not_ca'].msg = 'An eService Administrator cannot administer classrooms as a teacher. You will have to use a separate teacher account.  Please contact Customer Service at 800-733-2828 if you have any questions.';

pageMsgs['es.cu_not_reg'] = new Object();
pageMsgs['es.cu_not_reg'].msg_class = 'warning';
pageMsgs['es.cu_not_reg'].msg = 'A classroom account cannot register new eServices. Log into the teacher/administrator account if you want to add addtional eServices to this classroom. Please contact Customer Service at 800-733-2828 if you have any questions.';

pageMsgs['es.cancel_reg'] = new Object();
pageMsgs['es.cancel_reg'].msg_class = 'information';
pageMsgs['es.cancel_reg'].msg = 'You have chosen to cancel the registration of one or more eServices.  If you purchased these eServices and want to cancel the eServices for a refund contact Customer Service at 800-733-2828.';

pageMsgs['reg.ca_reg_order'] = new Object();
pageMsgs['reg.ca_reg_order'].msg_class = 'warning';
pageMsgs['reg.ca_reg_order'].msg = 'A Teacher with a Classroom account cannot be an eServices Administrator. You will have to use a separate administrator account.  Please contact Customer Service at 800-733-2828 if you have any questions.';

pageMsgs['reg.pa_reg_class'] = new Object();
pageMsgs['reg.pa_reg_class'].msg_class = 'warning';
pageMsgs['reg.pa_reg_class'].msg = 'An eService Administrator cannot administer classrooms as a teacher. You will have to use a separate teacher account.  Please contact Customer Service at 800-733-2828 if you have any questions.';

pageMsgs['reg.class_reg'] = new Object();
pageMsgs['reg.class_reg'].msg_class = 'warning';
pageMsgs['reg.class_reg'].msg = 'A classroom account cannot register new eServices. Log into the teacher/administrator account if you want to add addtional eServices to this classroom. Please contact Customer Service at 800-733-2828 if you have any questions.';

pageMsgs['reg.order_disagree'] = new Object();
pageMsgs['reg.order_disagree'].msg_class = 'information';
pageMsgs['reg.order_disagree'].msg = 'You have chosen to cancel the registration of one or more eServices.  If you purchased these eServices and want to cancel the eServices for a refund contact Customer Service at 800-733-2828.';

pageMsgs['reg.single_disagree'] = new Object();
pageMsgs['reg.single_disagree'].msg_class = 'information';
pageMsgs['reg.single_disagree'].msg = 'You have chosen to cancel the registration of one or more eServices.  If you purchased these eServices and want to cancel the eServices for a refund contact Customer Service at 800-733-2828.';

pageMsgs['reg.class_disagree'] = new Object();
pageMsgs['reg.class_disagree'].msg_class = 'information';
pageMsgs['reg.class_disagree'].msg = 'You have chosen to cancel the registration of one or more eServices.  If you purchased these eServices and want to cancel the eServices for a refund contact Customer Service at 800-733-2828.';

pageMsgs['reg.class_cancel'] = new Object();
pageMsgs['reg.class_cancel'].msg_class = 'information';
pageMsgs['reg.class_cancel'].msg = 'You have chosen to cancel the registration of one or more eServices.  If you purchased these eServices and want to cancel the eServices for a refund contact Customer Service at 800-733-2828.';

// re-redeem single-user passkey error
pageMsgs['eservices.arp'] = new Object();
pageMsgs['eservices.arp'].msg_class = 'warning';
pageMsgs['eservices.arp'].msg = 'You have already registered the passkey SU123456.';

// Invalid username & password
pageMsgs['ra.1.iup'] = new Object();
pageMsgs['ra.1.iup'].msg_class = 'warning';
pageMsgs['ra.1.iup'].msg = 'Invalid username and password. Re-enter and try again.';

// exceeded login concurrency
pageMsgs['ra.1.elc'] = new Object();
pageMsgs['ra.1.elc'].msg_class = 'warning';
pageMsgs['ra.1.elc'].msg = 'The number of simultaneous users has been exceeded on this account. Close other browser windows or try again later. ';

// username already in use
pageMsgs['ra.2.uaiu'] = new Object();
pageMsgs['ra.2.uaiu'].msg_class = 'warning';
pageMsgs['ra.2.uaiu'].msg = '<strong>Username</strong> is already registered to another user. Enter a different username.';

// registration process failed
pageMsgs['ra.2.rpf'] = new Object();
pageMsgs['ra.2.rpf'].msg_class = 'warning';
pageMsgs['ra.2.rpf'].msg = 'An error was encountered in the registration process.  Please contact Customer Service at 1-800-733-2828.';

// invalid username & password
pageMsgs['ua.1.iup'] = new Object();
pageMsgs['ua.1.iup'].msg_class = 'warning';
pageMsgs['ua.1.iup'].msg = 'Invalid username and password. Re-enter and try again.';

// exceeded login concurrency
pageMsgs['ua.1.elc'] = new Object();
pageMsgs['ua.1.elc'].msg_class = 'warning';
pageMsgs['ua.1.elc'].msg = 'The number of simultaneous logins has been exceeded on this account. Close other browser windows or try again later.';

// invalid embedded order
pageMsgs['ua.1.ieo'] = new Object();
pageMsgs['ua.1.ieo'].msg_class = 'warning';
pageMsgs['ua.1.ieo'].msg = 'There was a problem with the URL you entered. Please carefully copy the entire URL into your browser and click &quot;Enter&quot;.';

// order passkey admin already established
pageMsgs['ua.1.pae'] = new Object();
pageMsgs['ua.1.pae'].msg_class = 'warning';
pageMsgs['ua.1.pae'].msg = 'This order has already been registered.  Login if you are the administrator for this order.';

// invalid embedded passkey
pageMsgs['ua.1.iep'] = new Object();
pageMsgs['ua.1.iep'].msg_class = 'warning';
pageMsgs['ua.1.iep'].msg = 'There was a problem with the URL you entered. Please carefully copy the entire URL into your browser and click &quot;Enter&quot;.';

// single-redemption/no admin passkey already registered
pageMsgs['ua.1.prle_srna'] = new Object();
pageMsgs['ua.1.prle_srna'].msg_class = 'warning';
pageMsgs['ua.1.prle_srna'].msg = 'This passkey has already been registered.  Login if you previously registered this passkey. Please call Customer Service at 1-800-733-2828 if you believe there is an error.';

// single-redemption/with admin passkey already registered
pageMsgs['ua.1.prle_srwa'] = new Object();
pageMsgs['ua.1.prle_srwa'].msg_class = 'warning';
pageMsgs['ua.1.prle_srwa'].msg = 'This passkey has already been registered.  Login if you previously registered this passkey. Contact the person who sent you the passkey if you believe there is an error.';

// multi-redemption/no passkey redemption limit met
pageMsgs['ua.1.prle_mrna'] = new Object();
pageMsgs['ua.1.prle_mrna'].msg_class = 'warning';
pageMsgs['ua.1.prle_mrna'].msg = 'This passkey\'s registration limit has been exceeded.  Login if you previously registered this passkey. Please call Customer Service at 1-800-733-2828 if you believe there is an error.';

// multi-redemption/with admin passkey redemption limit met
pageMsgs['ua.1.prle_mrwa'] = new Object();
pageMsgs['ua.1.prle_mrwa'].msg_class = 'warning';
pageMsgs['ua.1.prle_mrwa'].msg = 'This passkey\'s registration limit has been exceeded.  Login if you previously registered this passkey. Contact the person who sent you the passkey if you believe there is an error.';

// no matching e-mail
pageMsgs['ua.2.nme'] = new Object();
pageMsgs['ua.2.nme'].msg_class = 'warning';
pageMsgs['ua.2.nme'].msg = 'We are sorry, but we cannot find a username that matches the e-mail address you provided. ';
pageMsgs['ua.2.nme'].msg += ' Please try again, and make sure that you enter your e-mail address exactly as you entered it when you registered. ';
pageMsgs['ua.2.nme'].msg += 'Or, you can contact Customer Service at 1-800-733-2828.';

// no matching username
pageMsgs['ua.2.nmu'] = new Object();
pageMsgs['ua.2.nmu'].msg_class = 'warning';
pageMsgs['ua.2.nmu'].msg = 'Username does not exist.  Try again, or try &quot;Username Help&quot;.';

// incorrect security answer
pageMsgs['ua.3.isa'] = new Object();
pageMsgs['ua.3.isa'].msg_class = 'warning';
pageMsgs['ua.3.isa'].msg = 'Your answer is incorrect. Please try again, or contact Customer Service at 1-800-733-2828.';

// reset password
pageMsgs['va.1.rp'] = new Object();
pageMsgs['va.1.rp'].msg_class = 'information';
pageMsgs['va.1.rp'].msg = 'Your password has been reset. A notification e-mail has been sent to the e-mail address listed below.';

// reset password, e-mail failed
pageMsgs['va.1.rp_ef'] = new Object();
pageMsgs['va.1.rp_ef'].msg_class = 'warning';
pageMsgs['va.1.rp_ef'].msg = 'Your password has been reset successfully. The system was unable to send a notification e-mail to the e-mail address listed below.';

// modified profile
pageMsgs['va.1.mp'] = new Object();
pageMsgs['va.1.mp'].msg_class = 'information';
pageMsgs['va.1.mp'].msg = 'Your profile has been modified.';

// selected classrooms added
pageMsgs['va.5.sca'] = new Object();
pageMsgs['va.5.sca'].msg_class = 'information';
pageMsgs['va.5.sca'].msg = 'The classrooms you selected have been added to eService Users below.';

// new classrooms created
pageMsgs['va.5.ncc'] = new Object();
pageMsgs['va.5.ncc'].msg_class = 'information';
pageMsgs['va.5.ncc'].msg = 'The classrooms you created have been added to eService Users below.';

// selected classrooms removed
pageMsgs['va.5.scr'] = new Object();
pageMsgs['va.5.scr'].msg_class = 'information';
pageMsgs['va.5.scr'].msg = 'The classrooms you selected have been removed from eService Users below.';

// selected teachers added
pageMsgs['va.5.sta'] = new Object();
pageMsgs['va.5.sta'].msg_class = 'information';
pageMsgs['va.5.sta'].msg = 'The teachers you selected have been added to eService Users below.';

// new teachers created
pageMsgs['va.5.ntc'] = new Object();
pageMsgs['va.5.ntc'].msg_class = 'information';
pageMsgs['va.5.ntc'].msg = 'The teachers you created have been added to eService Users below.';

// selected teachers removed
pageMsgs['va.5.str'] = new Object();
pageMsgs['va.5.str'].msg_class = 'information';
pageMsgs['va.5.str'].msg = 'The teachers you selected have been removed from eService Users below.';

// username already in use
pageMsgs['va.7.uaiu'] = new Object();
pageMsgs['va.7.uaiu'].msg_class = 'warning';
pageMsgs['va.7.uaiu'].msg = '<strong>Username</strong> is already registered to another user. Enter a different username.';

// username already in use
pageMsgs['va.8.uaiu'] = new Object();
pageMsgs['va.8.uaiu'].msg_class = 'warning';
pageMsgs['va.8.uaiu'].msg = '<strong>Username</strong> is already registered to another user. Enter a different username.';

// reset password on classroom account
pageMsgs['va.16mu.rp'] = new Object();
pageMsgs['va.16mu.rp'].msg_class = 'information';
pageMsgs['va.16mu.rp'].msg = 'The classroom\'s password has been reset. A notification e-mail has been sent to the classroom contact.';

// reset password on classroom account, no contact email so no email notification
pageMsgs['va.16mu.rp_ne'] = new Object();
pageMsgs['va.16mu.rp_ne'].msg_class = 'information';
pageMsgs['va.16mu.rp_ne'].msg = 'The classroom\'s password has been reset.';

// reset password on classroom account, email failed
pageMsgs['va.16mu.rp_ef'] = new Object();
pageMsgs['va.16mu.rp_ef'].msg_class = 'warning';
pageMsgs['va.16mu.rp_ef'].msg = 'The classroom\'s password has been reset successfully. The system was unable to send a notification e-mail to the classroom contact.  You will have to notify users of this account about the new password.';

// modified profile
pageMsgs['va.16mu.mp'] = new Object();
pageMsgs['va.16mu.mp'].msg_class = 'information';
pageMsgs['va.16mu.mp'].msg = 'The classroom\'s profile has been modified.';

// eServices added to classroom account
pageMsgs['va.16mu.sea'] = new Object();
pageMsgs['va.16mu.sea'].msg_class = 'information';
pageMsgs['va.16mu.sea'].msg = 'The eServices you selected have been added to User eServices below.';

// eServices removed to classroom account
pageMsgs['va.16mu.ser'] = new Object();
pageMsgs['va.16mu.ser'].msg_class = 'information';
pageMsgs['va.16mu.ser'].msg = 'The eServices you selected have been removed from User eServices below.';

// reset password on teacher account
pageMsgs['va.16su.rp'] = new Object();
pageMsgs['va.16su.rp'].msg_class = 'information';
pageMsgs['va.16su.rp'].msg = 'The teacher\'s password has been reset. A notification e-mail has been sent to the teacher.';

// reset password on teacher account, e-mail failed
pageMsgs['va.16su.rp_ef'] = new Object();
pageMsgs['va.16su.rp_ef'].msg_class = 'warning';
pageMsgs['va.16su.rp_ef'].msg = 'The teacher\'s password has been reset successfully. The system was unable to send a notification e-mail to the teacher. You will have to notify the teacher about the new password.';

// modified profile
pageMsgs['va.16su.mp'] = new Object();
pageMsgs['va.16su.mp'].msg_class = 'information';
pageMsgs['va.16su.mp'].msg = 'The teacher\'s profile has been modified.';

// eServices added to teacher account
pageMsgs['va.16su.sea'] = new Object();
pageMsgs['va.16su.sea'].msg_class = 'information';
pageMsgs['va.16su.sea'].msg = 'The eServices you selected have been added to User eServices below.';

// eServices removed to teacher account
pageMsgs['va.16su.ser'] = new Object();
pageMsgs['va.16su.ser'].msg_class = 'information';
pageMsgs['va.16su.ser'].msg = 'The eServices you selected have been removed from User eServices below.';



