//Browser detection
var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1);
var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
var olNs6 = (document.getElementById) ? true : false;
var olIe4 = (document.all) ? true : false;
var olIe5 = false;
var olIe55 = false;

//Microsoft Browser Version detection
if (olIe4) {
	var versNum=parseFloat(navigator.userAgent.match(/MSIE (\d\.\d+)\.*/i)[1]);
	if (versNum >= 5){
		olIe5=true;
		olIe55=(versNum>=5.5&&!olOp) ? true : false;
		if (olNs6) olNs6=false;
	}
	if (olNs6) olIe4 = false;
}

function OpenNewWindow(sURL, sWinName) {
	//Opens new browser window, typically Feedback or Help
	newWindow = window.open(sURL, sWinName, 'width=600,height=475,location=0,menubar=0,resizable=0,scrollbars=1,status=0,toolbar=0');
	newWindow.focus();
}

function openLiveSupport() {
	winLP = window.open('http://server.iad.liveperson.net/hc/10172293/?cmd=file&file=visitorWantsToChat&onlineURL=http://service.onesource.com/onlineSurvey.asp&site=10172293&referrer='+document.location,'chat10172293','width=472,height=320');
	winLP.focus();
	return false;
}

function isEmailValid(emailStr) {

	/* The following variable tells the rest of the function whether or not
	to verify that the address ends in a two-letter country or well-known
	TLD.  1 means check it, 0 means don't. */

	var checkTLD=1;

	/* The following is the list of known TLDs that an e-mail address must end with. */

	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

	/* The following pattern is used to check if the entered e-mail address
	fits the user@domain format.  It also is used to separate the username
	from the domain. */

	var emailPat=/^(.+)@(.+)$/;

	/* The following string represents the pattern for matching all special
	characters.  We don't want to allow special characters in the address.
	These characters include ( ) < > @ , ; : \ " . [ ] */

	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

	/* The following string represents the range of characters allowed in a
	username or domainname.  It really states which chars aren't allowed.*/

	var validChars="\[^\\s" + specialChars + "\]";

	/* The following pattern applies if the "user" is a quoted string (in
	which case, there are no rules about which characters are allowed
	and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
	is a legal e-mail address. */

	var quotedUser="(\"[^\"]*\")";

	/* The following pattern applies for domains that are IP addresses,
	rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
	e-mail address. NOTE: The square brackets are required. */

	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

	/* The following string represents an atom (basically a series of non-special characters.) */

	var atom=validChars + '+';

	/* The following string represents one word in the typical username.
	For example, in john.doe@somewhere.com, john and doe are words.
	Basically, a word is either an atom or quoted string. */

	var word="(" + atom + "|" + quotedUser + ")";

	// The following pattern describes the structure of the user

	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

	/* The following pattern describes the structure of a normal symbolic
	domain, as opposed to ipDomainPat, shown above. */

	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

	/* Finally, let's start trying to figure out if the supplied address is valid. */

	if (emailStr.length==0) {
		alert("Please enter an Email Address");
		return false;
	}

	/* Begin with the coarse pattern to simply break up user@domain into
	different pieces that are easy to analyze. */

	var matchArray=emailStr.match(emailPat);

	if (matchArray==null) {

		/* Too many/few @'s or something; basically, this address doesn't
		even fit the general mould of a valid e-mail address. */

		alert("Email Address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];

	// Start by checking that only basic ASCII characters are in the strings (0-127).

	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("The Email Address (user name) contains invalid characters.");
			return false;
	   }
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("The Email Address (domain name) contains invalid characters.");
			return false;
	   }
	}

	// See if "user" is valid

	if (user.match(userPat)==null) {

		// user is not valid

		alert("The Email Address (user name) doesn't seem to be valid.");
		return false;
	}

	/* if the e-mail address is at an IP address (as opposed to a symbolic
	host name) make sure the IP address is valid. */

	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {

		// this is an IP address

		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Email Address destination IP is invalid!");
				return false;
		   }
		}
		return true;
	}

	// Domain is symbolic name.  Check if it's valid.

	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The Email Address (domain name) does not seem to be valid.");
			return false;
	   }
	}

	/* domain name seems valid, but now make sure that it ends in a
	known top-level domain (like com, edu, gov) or a two-letter word,
	representing country (uk, nl), and that there's a hostname preceding
	the domain or country. */

	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
		alert("The Email Address must end in a well-known domain or two letter " + "country.");
		return false;
	}

	// Make sure there's a host name preceding the domain.

	if (len<2) {
		alert("The Email Address is missing a hostname!");
		return false;
	}

	// If we've gotten this far, everything's valid!
	return true;
}

// ==========================================
// These functions used by page "idtaken.asp"
// ==========================================

// This clears out the input text box and takes the focus off on load.
function presetPage() {
	document.form1.ALTUSERIDOPTION.blur();
}

function CheckSpaces(inputVal) {
	var oneChar;
	for (var i = 0; i < inputVal.length; i++) {
		oneChar = inputVal.charAt(i);
		if (oneChar == " " || oneChar == "\t" || oneChar == "\n" || oneChar == "\r") {
			return false;
		}
	}
	return true;
}

function CheckUserID(inputVal) {
		var oneCharCode;
		var msg = "";
		var	useridLength = inputVal.length;

		if (useridLength < 4 || useridLength > 19) {
			msg = msg + "- User ID must be between 4-19 characters.\n\n";
		}

		if (CheckSpaces(inputVal) == false) {
			msg = msg + "- User ID must have no spaces.\n\n";
		}

		oneCharCode = inputVal.charCodeAt(0);

		if (oneCharCode < "0".charCodeAt() || (oneCharCode > "9".charCodeAt() && oneCharCode < "A".charCodeAt())
			|| (oneCharCode > "Z".charCodeAt()&& oneCharCode < "a".charCodeAt()) || oneCharCode > "z".charCodeAt()) {
			msg = msg + "- Leading character for User ID must be alphanumeric\n (i.e. [0-9, a-z]).\n\n";
		}

		for (var i = 1; i < inputVal.length; i++) {
			oneCharCode = inputVal.charCodeAt(i)
			if ((oneCharCode < "0".charCodeAt() || (oneCharCode > "9".charCodeAt() && oneCharCode < "A".charCodeAt())
				|| (oneCharCode > "Z".charCodeAt() && oneCharCode < "a".charCodeAt()) || oneCharCode > "z".charCodeAt()) &&
				oneCharCode != "-".charCodeAt() && oneCharCode != "-".charCodeAt() && oneCharCode != "_".charCodeAt() &&
				oneCharCode != ".".charCodeAt() && oneCharCode != "@".charCodeAt()) {
				msg = msg + "- Valid characters include:\n 0-9, a-z, underscore, hyphen, period, @ symbol.\n\n";
			}
		}
		return msg;
	}

function InputVerify() {
	// Check for Alternate UserID Selection
	num=0;
	cEntries=0;
	var errmsg;
	var userid;
	var checkSelection = window.document.form1.ALTUSERID;

	// Single Value
	if (checkSelection.checked) {
		num++;
	}

	// Only gets executed when there is an array of radio buttons
	for (var k=0; k< checkSelection.length; k++) {
		cEntries++;
		if ( checkSelection[k].checked ) {
			num++;
		}
	}

	if (num == 0) {
		errorString = "You must make at least one alternate User ID selection!";
		alert ("Missing required information: \r\n\r\n\t" + errorString);
		return false;
	}


	// If there is only one Radio Button (i.e. "Your Own Alternative")
	// and there is no information in the input box, then display an error message.
	if (checkSelection.checked	&& !document.form1.ALTUSERIDOPTION.value) {
		errorString = "Add text for your own alternative.";
		alert ("Missing required information: \r\n\r\n\t" + errorString);
		return false;
	}

	// Only gets executed when there is an array of radio buttons.
	// If the last radio button is the "Your Own Alternaltive" and there is no
	// information in the input box, an error message is displayed.
	for (var k=0; k< checkSelection.length; k++) {
		if (checkSelection[cEntries-1].checked	&& !document.form1.ALTUSERIDOPTION.value)
		{
			errorString = "Add text for your own alternative.";
			alert ("Missing required information: \r\n\r\n\t" + errorString);
			return false;
		}
	}

	if (checkSelection.checked && document.form1.ALTUSERIDOPTION) {
		userid = document.form1.ALTUSERIDOPTION.value;
		errmsg = CheckUserID(userid);
		if ( errmsg.length != 0)
		{
			alert (errmsg);
			return false;
		}
	}
}

//If the "Your Own Alternative" radio button is selected, set focus to the textbox.
function textOn(object) {
   document.form1.ALTUSERIDOPTION.focus();
}

//If any other radiobox is selected in the array, change the focus, declare the value of the textbox false, and clear the text box.
function textOff(object) {
    object.ALTUSERIDOPTION.value = '';
}

//When you click in the textbox, it changes the focus to be the "Your Own Alternative" radio button.
function radioOn(object) {
	var checkSelection = document.form1.ALTUSERID;

	for (var k=0; k < checkSelection.length; k++) {
		if (checkSelection[k].value!='ALT') {
			checkSelection[k].checked=false;
		}
		else {
			checkSelection[k].checked=true;
		}
	}
}

// ==========================================
// These functions used by page "regpage.asp"
// ==========================================

function chkPasswordStrength(oPwd) {

	var sPwd = oPwd.value;
	var sUpperCase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var sLowerCase = 'abcdefghijklmnopqrstuvwxyz';
	var sNumbers = '0123456789';
	var sSymbols = '`¦!"£$%^&*()-=_+[]{};\'#:@~,./<>?\\|';

	var colGrey = '#999999';
	var colRed = '#ff4545';
	var colOrange = '#ffd35e';
	var colGreen = '#3abb1c';

	var oCellMin;
	var oCellMid;
	var oCellMax;

	// IE4+
	if (document.all) {
		oCellMin = pwdmin;
		oCellMid = pwdmid;
		oCellMax = pwdmax;
	}
	// NN4.x
	else if (document.layers) {
		oCellMin = document.pwdmin;
		oCellMid = document.pwdmid;
		oCellMax = document.pwdmax;

	}
	// W3C DOM (NN6 & IE5+)
	else {
		oCellMin = document.getElementById('pwdmin');
		oCellMid = document.getElementById('pwdmid');
		oCellMax = document.getElementById('pwdmax');
	}

	if (sPwd.length > 3) {

 		var hasUpperCase = Contains(sPwd, sUpperCase);
		var hasLowerCase = Contains(sPwd, sLowerCase);
		var hasNumbers = Contains(sPwd, sNumbers);
		var hasSymbols = Contains(sPwd, sSymbols);

//		alert('hasUpperCase = '+hasUpperCase
//			+'\n\nhasLowerCase = '+hasLowerCase
//			+'\n\nhasNumbers = '+hasNumbers
//			+'\n\nhasSymbols = '+hasSymbols);

		var testResult = hasUpperCase + hasLowerCase + hasNumbers + hasSymbols;

		switch (testResult) {
			case 1:
				oCellMin.style.backgroundColor = colRed;
				oCellMid.style.backgroundColor = colGrey;
				oCellMax.style.backgroundColor = colGrey;
				oCellMin.innerHTML = 'Weak';
				oCellMid.innerHTML = '&nbsp;';
				oCellMax.innerHTML = '&nbsp;';
				break;
			case 2:
				oCellMin.style.backgroundColor = colOrange;
				oCellMid.style.backgroundColor = colOrange;
				oCellMax.style.backgroundColor = colGrey;
				oCellMin.innerHTML = '&nbsp;';
				oCellMid.innerHTML = 'Medium';
				oCellMax.innerHTML = '&nbsp;';
				break;
			case 3:
				oCellMin.style.backgroundColor = colGreen;
				oCellMid.style.backgroundColor = colGreen;
				oCellMax.style.backgroundColor = colGreen;
				oCellMin.innerHTML = '&nbsp;';
				oCellMid.innerHTML = '&nbsp;';
				oCellMax.innerHTML = 'Strong';
				break;
			case 4:
				oCellMin.style.backgroundColor = colGreen;
				oCellMid.style.backgroundColor = colGreen;
				oCellMax.style.backgroundColor = colGreen;
				oCellMin.innerHTML = '&nbsp;';
				oCellMid.innerHTML = '&nbsp;';
				oCellMax.innerHTML = 'Strong';
				break;
		}
	}
	else {
		oCellMin.style.backgroundColor = colGrey;
		oCellMid.style.backgroundColor = colGrey;
		oCellMax.style.backgroundColor = colGrey;
		oCellMin.innerHTML = '&nbsp;';
		oCellMid.innerHTML = 'Unrated';
		oCellMax.innerHTML = '&nbsp;';
	}
}

function Contains(sIn, sTest) {
	for (var i = 0; i < sIn.length; i++) {
		//alert(sTest.indexOf(sIn.charAt(i)));
		if (sTest.indexOf(sIn.charAt(i)) > -1) {
			return 1;
		}
	}
	return 0;
}

function fixUserID(oID, e) {
	// Get hold of event for each browser
	var evt=(e)?e:(window.event)?window.event:null;


	if(evt){
		// Get the key code
		var key=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));

		if (key == 13) {
			if (document.all) {
				evt.returnValue=false;
			}
			else {
				return false;
			}
		}
		else {
			if (key >= 65 && key <= 90) {
				oID.value+=String.fromCharCode(key+32);
				if (document.all) {
					evt.returnValue=false;
				}
				else {
					return false;
				}
			}

			var theKey;
			theKey = String.fromCharCode(key);
			var strValidChars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-.@';


			if (strValidChars.indexOf(theKey)==-1) {
				if (document.all) {
					evt.returnValue=false;
				}
				else {
					return false;
				}
				alert('"'+theKey.replace(' ','<SPACE>')+'" is not a valid OneSource User ID character.\n\nOnly use 0-9, a-z, underscore "_", hyphen "-", dot "." or "@" sign.\n\nOneSource User IDs are NOT case sensitive.');
			}
		}
	}
}

function checkUserIDAvailability(oID, sSiteID, oFN, oLN) {
	//alert(oID.value);
	if (oID.value.length < 4) {
		alert('User ID does not meet minium length requirement of 4 characters.\n\nPlease make your User ID longer.')
	}
	else {
		OpenNewWindow('/home/isuseridavailable.asp?userid='+escape(oID.value)+'&siteid='+sSiteID+'&chkfirstname='+escape(oFN.value)+'&chklastname='+escape(oLN.value), 'UserIDAvailability');
	}
}

function ValidateForm_UserIDCheck() {

	var errmsg = "";
	var ret = true;

	var firstname = document.frmUserIDCheck.chkfirstname.value;
	if (firstname == null || Trim(firstname) == "") {
		errmsg = errmsg + "- You did not enter your First Name.\n\n";
		ret = false;
	}

	var lastname = document.frmUserIDCheck.chklastname.value;
	if (lastname == null || Trim(lastname) == "") {
		errmsg = errmsg + "- You did not enter your Last Name.\n\n";
		ret = false;
	}

	var firstname = document.frmUserIDCheck.chkfirstname.value;
	if (CheckQuotes(firstname) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in first name.\n\n";
		ret = false;
	}

	var lastname = document.frmUserIDCheck.chklastname.value;
	if (CheckQuotes(lastname) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in last name.\n\n";
		ret = false;
	}

	if (ret == false) {
		var tmp = "Please correct the following errors and try again:\n\n";
		errmsg = tmp + errmsg;
		window.alert (errmsg);
		return false;

	}
	return true;
}

function copyBackNewUserID(sNewID) {
	if (opener.document.PassInput.firstname) {
		opener.document.PassInput.firstname.value = document.frmUserIDCheck.chkfirstname.value;
	}

	if (opener.document.PassInput.lastname) {
		opener.document.PassInput.lastname.value = document.frmUserIDCheck.chklastname.value;
	}

	if (opener.document.PassInput.userid) {
		opener.document.PassInput.userid.value = sNewID;
	}
	window.close();
}

function Trim(inputVal) {
	var oneChar;
	var trimedVal = "";
	for (var i = 0; i < inputVal.length; i++) {
		oneChar = inputVal.charAt(i);
		if (oneChar != " " && oneChar != "\t" && oneChar != "\n" && oneChar != "\r") {
			trimedVal = trimedVal + oneChar;
		}
	}
	return trimedVal;
}

// function CheckSpaces() - under "idtaken.asp" section

function CheckQuotes(inputVal) {
	var oneChar;
	for (var i = 0; i < inputVal.length; i++) {
		oneChar = inputVal.charAt(i);
		if (oneChar == "\"") {
			return false;
		}
	}
	return true;
}

// function CheckUserID(inputVal) - under "idtaken.asp" section

function ValidateForm_RegPage() {

	// Extra EmailAddress validation added by Peter Duerden 20050711
	if (!isEmailValid(document.PassInput.email.value)) {
		return false;
	}

	var errmsg;
	var ret = true;
	var userid = document.PassInput.userid.value;
	document.PassInput.userid.value = userid;
	errmsg = CheckUserID(userid);

	if ( errmsg.length != 0) {
		ret = false;
	}

	var pwd = document.PassInput.pwd.value;
	var pwdLength = document.PassInput.pwd.value.length;

	if (pwdLength < 4 || pwdLength > 19) {
		errmsg = errmsg + "- Password must be between 4-19 characters.\n\n";
		ret = false	;
	}

	if (CheckSpaces(pwd) == false) {
		errmsg = errmsg + "- Password must have no spaces.\n\n";
		ret = false;
	}

	var confirmpwd = document.PassInput.confirmpwd.value;
	if (confirmpwd == null || pwd != confirmpwd) {
		errmsg = errmsg + "- You did not confirm your Password correctly.\n\n";
		ret = false;
	}

	var firstname = document.PassInput.firstname.value;
	if (firstname == null || Trim(firstname) == "") {
		errmsg = errmsg + "- You did not enter your First Name.\n\n";
		ret = false;
	}

	var firstname = document.PassInput.firstname.value;
	if (CheckQuotes(firstname) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in first name.\n\n";
		ret = false;
	}

	var lastname = document.PassInput.lastname.value;
	if (CheckQuotes(lastname) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in last name.\n\n";
		ret = false;
	}

	var phone = document.PassInput.phone.value;
	if (CheckQuotes(phone) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in phone.\n\n";
		ret = false;
	}

	var fax = document.PassInput.fax.value;
	if (CheckQuotes(fax) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in fax.\n\n";
		ret = false;
	}

	var email = document.PassInput.email.value;
	if (CheckQuotes(email) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in email.\n\n";
		ret = false;
	}

	var title = document.PassInput.title.value;
	if (CheckQuotes(title) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in title.\n\n";
		ret = false;
	}

	var address = document.PassInput.address.value;
	if (CheckQuotes(address) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in address.\n\n";
		ret = false;
	}

	var city = document.PassInput.city.value;
	if (CheckQuotes(city) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in city.\n\n";
		ret = false;
	}

	var state = document.PassInput.state.value;
	if (CheckQuotes(state) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in state.\n\n";
		ret = false;
	}

	var postalcode = document.PassInput.postalcode.value;
	if (CheckQuotes(postalcode) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in postal code.\n\n";
		ret = false;
	}


	var pwd = document.PassInput.pwd.value;
	if (CheckQuotes(pwd) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in password.\n\n";
		ret = false;
	}

	var confirmpwd = document.PassInput.confirmpwd.value;
	if (CheckQuotes(confirmpwd) == false) {
		errmsg = errmsg + "- Quotation marks not allowed in confirmation password.\n\n";
		ret = false;
	}

	var lastname = document.PassInput.lastname.value;
	if (lastname == null || Trim(lastname) == "") {
		errmsg = errmsg + "- You did not enter your Last Name.\n\n";
		ret = false;
	}

	var jobfunction = document.PassInput.jobfunction.options[document.PassInput.jobfunction.selectedIndex].value.toUpperCase();
	if (jobfunction == null || jobfunction == "NONE") {
		errmsg = errmsg + "- You did not enter a Job Function.\n\n";
		ret = false;
	}

	var email = document.PassInput.email.value;
	if (email == null || Trim(email) == "") {
		errmsg = errmsg + "- You did not enter your e-mail address.\n\n";
		ret = false;
	}
	else
	{
		if (email.indexOf('@')==-1  && email.indexOf('.')==-1) {
			errmsg = errmsg + "- The e-mail address is not valid: it is missing the @ symbol and a period.\n Please check the format: Name@company.com or List@company.com\n\n";
			ret = false;
		}
		else if (email.indexOf('@')==-1) {
			errmsg = errmsg + "- The e-mail address is not valid: it is missing the @ symbol.\n Please check the format: Name@company.com or List@company.com\n\n";
			ret = false;
		}
		else if (email.indexOf('.')==-1) {
			errmsg = errmsg + "- The e-mail address is not valid: it is missing a period.\n Please check the format: Name@company.com or List@company.com\n\n";
			ret = false;
		}
	}

	var country = document.PassInput.country.options[document.PassInput.country.selectedIndex].value.toUpperCase()
	if (country == null || country == "NONE") {
		errmsg = errmsg + "- You did not enter a Country.\n\n";
		ret = false;
	}

	if (ret == false) {
		var tmp = "Please correct the following errors and resubmit your registration:\n\n";
		errmsg = tmp + errmsg;
		window.alert (errmsg);
		return false;

	}
	return true;
}

// ===============================================
// These functions used by page "sitelistpriv.asp"
// ===============================================

function ValidateForm_SiteListPriv() {
	var UnSecurBundelsCount = document.form1.UnSecurBundelsCount.value;

	if (UnSecurBundelsCount > 0) {
		return true;
	}
	else {
		var SecurBundelsCount = document.form1.SecurBundelsCount.value;
		if (SecurBundelsCount == 0) {
			window.alert ("You could not be registered!\n No available products for your company.");
			return false;
		}
		else {
			if (SecurBundelsCount == 1) {
				if (document.form1.password.value == document.form1.checkpwd.value) {
					return true;
				}
			}
			else {
				for (var i = 0; i < SecurBundelsCount; i++) {
					if (document.form1.password[i].value == document.form1.checkpwd[i].value) {
						return true;
					}
				}
			}
			if(SecurBundelsCount>1) {
				window.alert ("Wrong passwords!\nYou could not be registered!\n Please change passwords and try again.");
				return false;
			}
			else {
				window.alert ("Wrong password!\nYou could not be registered!\n Please change password and try again.");
				return false;
			}
		}
	}
}