function trace(obj) {
	console.log(obj);	
}

var Core = {
	init:function() {
		$('DIV.newsletter DIV.inputContainer INPUT[type=text]').click(this.newsletterInput).blur(this.newsletterInput);
	}
	,newsletterInput:function(e) {
		var el = e.currentTarget;
		var val = $(el).val();
		var type = e.type;
		if(val == "Enter E-mail" && type == "click")
			$(el).val('');
		else if(val == '' && type == "blur")
			$(el).val('Enter E-mail');
	}
	,backgroundFade:function(show,callback,noAnimate) {
		if(show) {
			var setHeight = function() {
				var body = document.body,
				html = document.documentElement;
				var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
				$(Core.modalDiv).css({'height':height+'px'});
			}
			$(window).resize(setHeight);
			
			
			var body = document.body,
			html = document.documentElement;
			var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
			this.modalDiv = document.createElement('DIV');
			document.body.appendChild(this.modalDiv);
			$(this.modalDiv).css({
					'position':'absolute',
					'backgroundColor':'#000000',
					'height':height+'px',
					'width':'100%',
					'top':'0',
					'left':'0',
					'opacity':'0',
					'zIndex':'999'
					});
			if(!noAnimate) {
				$(this.modalDiv).animate({
						'opacity':'0.6'
						},callback);
			}
			else {
				$(this.modalDiv).css({'opacity':'0.6'});	
			}
		}
		else {
			
			if(!noAnimate) {
				$(this.modalDiv).animate({
						'opacity':'0'
						},function() { $(Core.modalDiv).remove(); });
			}
			else {
				$(this.modalDiv).remove();
			}
		}
	}
	
}

$(document).ready(function() {
	Core.init();
});
