if (typeof(newsletterSubscriptionObject) == 'undefined') 
{
    newsletterSubscriptionObject = function(objectName, useAlertResponse)
    {
    	this.objectName       = objectName;
    	this.useAlertResponse = useAlertResponse; 
    }
}
newsletterSubscriptionObject.prototype.init = function()
{
	var currentObject     = this;		
	this.defaultValue     = $('#' + this.objectName + '_Email').val();	
	$('#' + this.objectName + '_Email').toggleVal();	
	$('#' + this.objectName + '_Submit').click(function() { currentObject.submit() } );
	$('#' + this.objectName + '_Email').setEnterHandler(function() { currentObject.submit() } );
	$('#' + this.objectName + '_Email').keypress(function(e) {if (e.which == 0 || e.which == 27) {$('.dropper').hide(); $('#Newsletter_Sign').show();} });
}
newsletterSubscriptionObject.prototype.submit = function()
{
	var currentObject = this;
	$('#' + this.objectName + '_Body').hide();		
	var email = $('#' + this.objectName + '_Email').val(); 
	$.post(rootUrl + 'wsdl/main.ajax.php', { 
		    	action: 'addNewsletterSubscriber', 
		  		email: email 
		  },
		  function(responseData) { 
		  		currentObject.onGetResponse(responseData); 
		  },
		  "json");
}
newsletterSubscriptionObject.prototype.onGetResponse = function(responseData)
{
	if (responseData.Response.Code == 1)
	{
		$('#' + this.objectName + '_Body').show();
		systemAlert(responseData.Response.Message);
	}
	else
	{
		$('#' + this.objectName + '_Email').val(this.defaultValue);
		if (!this.useAlertResponse)
		{
		}
		else
		{
			$('#' + this.objectName + '_Body').show();		
			$('.dropper').hide();
			$('#Newsletter_Sign').show();
			systemAlert(responseData.Response.Message);
		} 
	}
}