<!--
/*
 * Copyright (c) 2001 Talis Information Ltd.
 * Birmingham Research Park
 * Vincent Drive
 * Birmingham
 * B15 2SQ
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of Talis
 * Information Ltd. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Talis.
 *
 * @version $Revision: 1.8 $ $Date: 2005/05/04 10:24:53 $
 * @author $Author: pxg $
 *
 * this javascript assumes header.js has already been loaded
*/
<!--

function checkLocation(p_form){
  if (p_form.location){ // cannot directly check for null in 1.1
	  if (p_form.location.selectedIndex>0){
		return true;
	  }else{
		alert(forceChooseLocation);
		return false;
	  }
  }
  return true;
}

function doReplace(p_form){

	p_form.talissession.value=normalise( p_form.hidden_username.value+":"+p_form.hidden_password.value);
	replacePage(p_form);
}

function normalise(theText) {
 output = new String;
 Temp = new Array();
 Temp2 = new Array();
 TextSize = theText.length;
 for (i = 0; i < TextSize; i++) {
	rnd = Math.floor(Math.random() * alpha.length);
	working = alpha.indexOf(theText.charAt(i))+rnd
	if ( working >= alpha.length ){
	 working-=alpha.length
	}
	Temp[i] =  working;
	Temp2[i] = rnd;
 }
 for (i = 0; i < TextSize; i++) {
	output += alpha.charAt(Temp[i])+ alpha.charAt(Temp2[i]);
 }
 return output;
}
function doChange(p_form){
  if (checkLocation(p_form)&&lockDownButtons()){
	p_form.talissession.value=normalise( p_form.hidden_username.value+':'+p_form.hidden_password.value);
  replacePage(p_form);
  }
  return false;
}
//-->
