(function(page) { 

	// public
	page.message = function(str) {
		
		var static = arguments.callee;
		if (!static.div) {
			// div
			static.div = document.createElement('DIV');
			static.div.style.position = (private.browserIE6()) ? 'absolute' : 'fixed';
			static.div.style.top = '0px';
			static.div.style.zIndex = '1000';
			static.div.style.fontFamily = 'Verdana, Arial, Helvetica, sans-serif';
			static.div.style.fontSize = '20px';
			static.div.style.fontWeight = 'bold';
			static.div.style.color = '#333333';
			static.div.style.display = 'none';
			static.div.className = 'page-message';
			// inner
			static.innerdiv = document.createElement('DIV');
			static.innerdiv.style.margin = '0 95px';
			static.innerdiv.style.width = '600px';
			static.innerdiv.style.height = '120px';
			static.innerdiv.style.background = '#bafdcd';
			static.innerdiv.style.border = 'solid 3px #9befb4';
			// img
			static.img = document.createElement('IMG');
			static.img.src = "../images/alert_message.png";
			static.img.style.height = '32px';
			static.img.style.width = '32px';
			static.img.style.float = 'left';
			static.img.style.paddingLeft = '10px';
			static.img.style.paddingTop = '5px';
			static.img.style.position = 'absolute';
			// text
			static.textdiv = document.createElement('DIV');
			static.textdiv.style.paddingTop = '45px';
			static.textdiv.style.textAlign = 'center';
			// append
			static.innerdiv.appendChild( static.img );
			static.innerdiv.appendChild( static.textdiv );
			static.div.appendChild( static.innerdiv );
		}
		
		// set text
		static.textdiv.innerHTML = str;
		// attach and show
		document.body.appendChild( static.div );
		$( static.div ).fadeIn(800);
		// hide after delay
		setTimeout(function() { 
			$( static.div ).slideUp(300, function() {
				if (static.div.parentNode) {
					static.div.parentNode.removeChild( static.div );
				}
			}); 
		},3000);

	}
	
	// private
	var private = {};
	private.browserIE6 = function() {
		var search = "MSIE 6";
		var string = navigator.userAgent;
		if (!string) return false;
		var match = string.indexOf( search ) != -1;
		return match;
	}
	
	
})( window.page = (window.page) ? window.page : {} );