var popNewsletter = function(){
	return {
		addToLoadEvent : function() {
			var f = function() { popNewsletter.init() };
			if (window.addEventListener)
	 			window.addEventListener('load', f, false);
	  		else if (window.attachEvent)
				window.attachEvent('onload', f);
		},
		init : function() {
			var newsletterTextbox = document.getElementById("champ_inscription_textbox");
			this.defaultTextboxValue = "Votre adresse e-mail...";
			// Evenements divers
			var thisPopNewsletter = this;
			newsletterTextbox.onfocus = function() {
				if(this.value == thisPopNewsletter.defaultTextboxValue) {
					this.value = "";
				}
			};
			newsletterTextbox.onblur = function() {
				if(this.value == "") {
					this.value = thisPopNewsletter.defaultTextboxValue;
				}
			};
			document.getElementById("valid_inscription").onclick = function() {
				thisPopNewsletter.submitForm();
			};
		},
		submitForm : function() {
			var emailValue = document.getElementById("champ_inscription_textbox").value;
			if(emailValue != "" && emailValue != this.defaultTextboxValue)
				location.href = "/fr/views/compteclient/inscriptionnewsletterlight.aspx?a="+emailValue;
		}
	};
}();

popNewsletter.addToLoadEvent();
