function CM_WEBCOMPONENT_MYACCOUNT(strName) {
	var me = this;

	this.strName = strName;
	this.objFundContainer = null;

	this.arrOnRequireLogin = new Array();
	this.arrOnConfirmRegistration = new Array();
	this.objFundHttpRequest = new DHL.NET.HTTPREQUEST()
	this.blnChanging = false;

	CM_WEBCOMPONENT_MYACCOUNT.prototype.addOnRequireLoginListener = function addOnRequireLoginListener(ptFunction) {
		if(ptFunction) {
			this.arrOnRequireLogin.push(ptFunction);
		}
	}

	CM_WEBCOMPONENT_MYACCOUNT.prototype.onRequireLoginEvent = function onRequireLoginEvent(strFormToDisplay) {
		for(var intI = 0; intI < this.arrOnRequireLogin.length; intI++) {
			this.arrOnRequireLogin[intI](strFormToDisplay);
		}
	}
	CM_WEBCOMPONENT_MYACCOUNT.prototype.onConfirmRegistration = function(strFormName) {
		for(var intI = 0; intI < this.arrOnConfirmRegistration.length; intI++) {
			this.arrOnConfirmRegistration[intI](strFormName);
		}
	}
	CM_WEBCOMPONENT_MYACCOUNT.prototype.addOnConfirmRegistration = function(ptFunction) {
		this.arrOnConfirmRegistration.push(ptFunction);
	}
	CM_WEBCOMPONENT_MYACCOUNT.prototype.setFundContainer = function setFundContainer(objContainer) {
		this.objFundContainer = objContainer;
	}

	CM_WEBCOMPONENT_MYACCOUNT.prototype.onRefreshFund = function onRefreshFund() {
		if(!this.blnChanging) {
			this.blnChanging = true;

			var blnError = false;
			var objUrlFavorite = new DHL.NET.URL.getCurrent();

			strAttributes = "refreshFund=1";

			this.objFundHttpRequest.open('POST', objUrlFavorite, true);

			this.objFundHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			this.objFundHttpRequest.setRequestHeader('Content-length', strAttributes.length);
			this.objFundHttpRequest.setRequestHeader('Connection', 'close');

			this.objFundHttpRequest.onreadystatechange(function() {
				CM_WEBCOMPONENT_MYACCOUNT.onReceiveNewFund();
			});
			this.objFundHttpRequest.send(strAttributes);
		}
	}

	CM_WEBCOMPONENT_MYACCOUNT.onForgotUserNameResponse = function onForgotUserNameResponse() {
		if(me.objFundHttpRequest.getReadyState() == 4	&& me.objFundHttpRequest.getStatus() == 200) {
			if(me.objFundHttpRequest.getResponseText()){
				me.blnChanging = false;
				alert(me.objFundHttpRequest.getResponseText());
			}
		}
	}
	
	CM_WEBCOMPONENT_MYACCOUNT.prototype.showPictureHelp = function showPictureHelp() {
		document.getElementById(this.strName + 'PictureHelpBox').style.display = 'block';
	}
	CM_WEBCOMPONENT_MYACCOUNT.prototype.hide = function hide() {
		document.getElementById(this.strName + 'PictureHelpBox').style.display = 'none';
	}
	
	CM_WEBCOMPONENT_MYACCOUNT.prototype.onForgotPassword = function onForgotPassword(objForm) {
		if(!this.blnChanging) {
			this.blnChanging = true;

			var blnError = false;
			var objUrlAuth = new DHL.NET.URL.getCurrent();
			var objErrorContainer = document.getElementById(this.strName + "ErrorContainer");
			objErrorContainer.style.display="none";
			objForm["btnSend"].disabled = true;

			//validate email address
			objForm["email"].value = objForm["email"].value.replace(/\r\n|\n|\t/gi, ",");
			var arrEmail = DHL.NET.EMAIL.parseMultiEmail(objForm["email"].value);
			if(
				arrEmail &&
				arrEmail.length
			) {
				strAttributes = "frmName=" + this.strName + "&" +
					"action=forgotpassword" + "&" +
					"email=" + objForm["email"].value;
	
				this.objFundHttpRequest.open('POST', objUrlAuth, true);
	
				this.objFundHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				this.objFundHttpRequest.setRequestHeader('Content-length', strAttributes.length);
				this.objFundHttpRequest.setRequestHeader('Connection', 'close');
	
				this.objFundHttpRequest.onreadystatechange(function() {
					CM_WEBCOMPONENT_MYACCOUNT.onForgotPasswordResponse();
				});
				this.objFundHttpRequest.send(strAttributes);
			}
			else {
				this.blnChanging = false;
				objForm["btnSend"].disabled = false;
				objErrorContainer.innerHTML = "&nbsp;Please enter a valid email address";
				objErrorContainer.style.color="red";
				objErrorContainer.style.display="block";
			}
		}
	}

	CM_WEBCOMPONENT_MYACCOUNT.onForgotPasswordResponse = function onForgotUserNameResponse() {
		if(me.objFundHttpRequest.getReadyState() == 4	&& me.objFundHttpRequest.getStatus() == 200) {
			if(me.objFundHttpRequest.getResponseText()){
				me.blnChanging = false;
				document.getElementById(me.strName + "divForgotPassword").innerHTML = 
					"<table border=0 cellpadding=0 cellspacing=0>" + 
						"<tr>" +
							"<td>" +
								"Thank you, Any login information associated with this email address were sent." +
							"</td>" +
						"</tr>" +
						"<tr>" +
						"	<td height=25 colspan=3>" +
							"<div align=\"center\">" +
								"<a href=\"#\" onclick=\"document.getElementById('" + me.strName + "divForgotPassword').style.display='none';" +
									"document.getElementById('" + me.strName + "divAuth').style.display='block';return false;\">"+
										"Return to login"+
								"</a>" +
							"</div>" +
							"</td>" +
						"</tr>" +
					"</table>";
				if(document.getElementById('flash-displaybox')) {
					parent.updateText(4);
				}
			}
		}
	}

	CM_WEBCOMPONENT_MYACCOUNT.prototype.setFundContainer = function setFundContainer(objContainer) {
		this.objFundContainer = objContainer;
	}

	CM_WEBCOMPONENT_MYACCOUNT.prototype.onRefreshFund = function onRefreshFund() {
		if(!this.blnChanging) {
			this.blnChanging = true;

			var blnError = false;
			var objUrlFavorite = new DHL.NET.URL.getCurrent();

			strAttributes = "refreshFund=1";

			this.objFundHttpRequest.open('POST', objUrlFavorite, true);

			this.objFundHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			this.objFundHttpRequest.setRequestHeader('Content-length', strAttributes.length);
			this.objFundHttpRequest.setRequestHeader('Connection', 'close');

			this.objFundHttpRequest.onreadystatechange(function() {
				CM_WEBCOMPONENT_MYACCOUNT.onReceiveNewFund();
			});
			this.objFundHttpRequest.send(strAttributes);
		}
	}

	CM_WEBCOMPONENT_MYACCOUNT.onReceiveNewFund = function onReceiveNewFund() {
		if(me.objFundHttpRequest.getReadyState() == 4	&& me.objFundHttpRequest.getStatus() == 200) {
			if(me.objFundHttpRequest.getResponseText()){
				me.blnChanging = false;
				if(me.objFundHttpRequest.getResponseText()) {
					me.objFundContainer.innerHTML = "$" + me.objFundHttpRequest.getResponseText();
				}
			}
		}
	}
	
	CM_WEBCOMPONENT_MYACCOUNT.prototype.forgotPassword = function (strEmail) {
		objForm = document.getElementById('forgot' + this.strName);
		objForm["email"].value = strEmail;
		this.onForgotPassword(objForm);
	}

}