function CM_WEBCOMPONENT_SHOWREGISTER(strName) {
	this.strName = strName;
	this.objShowRegistration = null;
	this.blnDisplayConfirmation = true;
	this.objShowHandle = null;
	this.blnRequireBuy = true;
	this.objPrivateUrl = null;
	this.objBuyUrl = null;
	this.intModelId = 0;
	this.strStrShowType = "DHL_FMS_SHOW::FREE";
	
	this.blnIgnoreResponse = false;
	this.objMessageBox = new DHL.UTIL.MESSAGEBOX(document);
	
	this.arrShowListener = new Array();
	this.arrHideListener = new Array();

	var me = this;
	this.objMessageBox.addListener(DHL.UTIL.MESSAGEBOX.EVENT_HIDE, function(){
		me.cancelRequest();
	});
	this.objMessageBox.addListener(DHL.UTIL.MESSAGEBOX.EVENT_SHOW, function(){
		me.show();
	});
	this.objMessageBox.addListener(DHL.UTIL.MESSAGEBOX.EVENT_HIDE, function(){
		me.hide();
	});
}
var PUBLIC = CM_WEBCOMPONENT_SHOWREGISTER.prototype;

PUBLIC.show = function() {
	for(var intI = 0; intI < this.arrShowListener.length; intI++) {
		this.arrShowListener[intI]();
	}
}

PUBLIC.hide = function() {
	for(var intI = 0; intI < this.arrShowListener.length; intI++) {
		this.arrHideListener[intI]();
	}
}

PUBLIC.addHideListener = function(ptFunction) {
	this.arrHideListener.push(ptFunction);
}

PUBLIC.addShowListener = function(ptFunction) {
	this.arrShowListener.push(ptFunction);
}

PUBLIC.setBuyUrl = function(objUrl) {
	this.objBuyUrl = objUrl;
}

PUBLIC.setPrivateUrl = function(objUrl) {
	this.objPrivateUrl = objUrl;
}

PUBLIC.requireBuy = function(blnRequireBuy) {
	this.blnRequireBuy = blnRequireBuy;
}

PUBLIC.setMessageBoxTemplate = function(objTemplate) {
	this.objMessageBox.setTemplate(objTemplate);
}

PUBLIC.setModelId = function(intModelId) {
	this.intModelId = intModelId;
}

PUBLIC.setShowType = function(strShowType) {
	this.strShowType = strShowType;
}

PUBLIC.dhlBuy = function(){
	var me = this;
	this.objMessageBox.alert('You need to add funds to your account');
	this.objMessageBox.addListener(DHL.UTIL.MESSAGEBOX.EVENT_RESPONSE, function(){
		if(me.objMessageBox.getClientResponse()) {
			me.redirectToBuy();
		}
	});
}

PUBLIC.cancelRequest = function() {
	this.blnIgnoreResponse = true;
}

PUBLIC.redirectToBuy = function() {
	document.location = this.objBuyUrl.toString();
}

PUBLIC.goPrivate = function(intModelId, strShowType) {
	if(this.blnRequireBuy) {
		this.dhlBuy();
	}
	else {
		if(!intModelId) {
			intModelId = this.intModelId;
		}
		if(!strShowType) {
			strShowType = this.strShowType;
		}
	
		this.objShowHandle = new DHL.SITE.FMS_SHOWRESPONSE_HANDLE();
		var me = this;
		this.objShowHandle.setCallback(function(objShowRegistration) {
				me.sendToPrivate(objShowRegistration, me.objPrivateUrl);
		});
		this.objShowHandle.setBuyCallback(function(objShowRegistration) {
				me.redirectToBuy();
		});
		this.objShowHandle.setMessageBox(this.objMessageBox);
		
		this.objShowRegistration = new DHL.SITE.FMS_SHOWREGISTRATION(
			intModelId, strShowType
		);
		var me = this;
		this.objShowRegistration.setPrivateCallback(function(objShowRegistration) {
			me.objShowHandle.handleResponse(objShowRegistration);
		});
		this.objShowRegistration.registerShow();

		this.objMessageBox.message("Please Wait ... ");
		this.blnIgnoreResponse = false;
	}
}

PUBLIC.sendToPrivate = function (objShowRegistration, objPrivateUrl) {
	var objUrl = objPrivateUrl;
	objUrl.setAttribute('check', this.objShowRegistration.getRandomCheck());
	objUrl.setAttribute('type', this.objShowRegistration.getShowType());
	objUrl.setAttribute('modelId', this.objShowRegistration.getModelId());
	document.location = objUrl.toString();	
}