infoMessage='';
function InfoMessage(message) {
	if (message != '') {
		this.doc = document;
		this.message = message;
		this.bordersize = 5;
		/*@cc_on
			/*@if (@_jscript)
				this.ie = (document.all && !window.opera) ? true : false;
			/*@else @*/
				this.ie = false;
			/*@end
		@*/
		this.ie7 = (this.ie && window.XMLHttpRequest);
		this.initialize();
	}
}
InfoMessage.prototype.initialize = function() {
	var objBody = this.doc.getElementsByTagName("body").item(0);	
	if (this.doc.getElementById('infoMain')) {
		objBody.removeChild(this.doc.getElementById("infoMain"));
	}
	var objInfoMessage = this.doc.createElement("div");
		objInfoMessage.setAttribute('id','infoMain');
		objInfoMessage.style.display = 'none';
	objBody.appendChild(objInfoMessage);
	var objContainer = this.doc.createElement("div");
		objContainer.setAttribute('id','infoContainer');
		objContainer.innerHTML = '<div id="infoInnerContainer"></div>';
	objInfoMessage.appendChild(objContainer);
	objInnerContainer = this.doc.getElementById('infoInnerContainer');
	var objCaption = this.doc.createElement("span");
		objCaption.setAttribute('id','infoCaption');
	objInnerContainer.appendChild(objCaption);
	this.show();
};
InfoMessage.prototype.show = function() {
	if (this.ie && !this.ie7)
		this.toggleSelects('hide');
	if (this.hideFlash)
		this.toggleFlash('hide');
	var pageSize = this.getPageSize();
	var objBody = this.doc.getElementsByTagName("body").item(0);
	var object = this.doc.getElementById('infoMain');
		object.style.left = ((pageSize[2]-250+17)) + "px";
		object.style.top = (this.getPageScroll() + (pageSize[3]-70+17)) + "px";
		object.style.display = '';
	this.doc.getElementById('infoMain').onclick = function() { myInfoMessage.end(); return false; }
	this.doc.getElementById('infoContainer').onclick = function() { myInfoMessage.end(); return false; }
	this.showContent();
	setTimeout('myInfoMessage.end();', 4000);
};
InfoMessage.prototype.showContent = function() {
	var object = this.doc.getElementById('infoCaption');
	object.style.display = '';
	object.innerHTML = this.message;
};
InfoMessage.prototype.end = function(caller) {
	this.doc.getElementById('infoMain').style.display = 'none';
	this.toggleSelects('visible');
	if (this.hideFlash) { this.toggleFlash('visible'); }
};
InfoMessage.prototype.appear = function(id, opacity) {
	var object = this.doc.getElementById(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + (opacity + 10) + ")";
};
InfoMessage.prototype.fade = function(id, opacity) {
	var object = this.doc.getElementById(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
	if (opacity <= 0) {
		try {
			object.display = 'none';
		} catch(err) { }
	}
};
InfoMessage.prototype.getPageScroll = function() {
	if (self.pageYOffset) {
		return this.isFrame ? parent.pageYOffset : self.pageYOffset;
	} else if (this.doc.documentElement && this.doc.documentElement.scrollTop){
		return this.doc.documentElement.scrollTop;
	} else if (document.body) {
		return this.doc.body.scrollTop;
	}
};
InfoMessage.prototype.getPageSize = function() {	
	var xScroll, yScroll, windowWidth, windowHeight;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = this.doc.scrollWidth;
		yScroll = (this.isFrame ? parent.innerHeight : self.innerHeight) + (this.isFrame ? parent.scrollMaxY : self.scrollMaxY);
	} else if (this.doc.body.scrollHeight > this.doc.body.offsetHeight){
		xScroll = this.doc.body.scrollWidth;
		yScroll = this.doc.body.scrollHeight;
	} else {
		xScroll = this.doc.getElementsByTagName("html").item(0).offsetWidth;
		yScroll = this.doc.getElementsByTagName("html").item(0).offsetHeight;
		xScroll = (xScroll < this.doc.body.offsetWidth) ? this.doc.body.offsetWidth : xScroll;
		yScroll = (yScroll < this.doc.body.offsetHeight) ? this.doc.body.offsetHeight : yScroll;
	}
	if (self.innerHeight) {
		windowWidth = (this.isFrame) ? parent.innerWidth : self.innerWidth;
		windowHeight = (this.isFrame) ? parent.innerHeight : self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = this.doc.documentElement.clientWidth;
		windowHeight = this.doc.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = this.doc.getElementsByTagName("html").item(0).clientWidth;
		windowHeight = this.doc.getElementsByTagName("html").item(0).clientHeight;
		windowWidth = (windowWidth == 0) ? this.doc.body.clientWidth : windowWidth;
		windowHeight = (windowHeight == 0) ? this.doc.body.clientHeight : windowHeight;
	}
	var pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
	var pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;
	return new Array(pageWidth, pageHeight, windowWidth, windowHeight);
};
InfoMessage.prototype.toggleFlash = function(state) {
	var objects = this.doc.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++) {
		objects[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
	}
	var embeds = this.doc.getElementsByTagName("embed");
	for (var i = 0; i < embeds.length; i++) {
		embeds[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
	}
};
InfoMessage.prototype.toggleSelects = function(state) {
	var selects = this.doc.getElementsByTagName("select");
	for (var i = 0; i < selects.length; i++ ) {
		selects[i].style.visibility = (state == "hide") ? 'hidden' : 'visible';
	}
};
function initInfoMessage() { if (infoMessage != '') myInfoMessage = new InfoMessage(infoMessage); }
function showInfoMessage(message) { infoMessage=message; initInfoMessage(); infoMessage=''; }
addOnLoad(initInfoMessage);
