
mtLibAddEvent(function(){
	if(!document.compatMode || (document.all && !document.compatMode.match(/CSS/))){
		return;
	};
	haveYourSay.init();
}, "load");

haveYourSay = {
	init : function(){
		if(!oMTLib.xmlHTTP()){
			return;
		};
		this.o = document.getElementById("haveYourSayLink");
		this.oAnim = new oMTLib.animation("haveYourSay");
		var o = document.createElement("div");
		o.id = "placeholder";
		o.style.width = document.getElementById("haveYourSay").offsetWidth + "px";
		o.style.visibility = "hidden";
		o.style.position = "absolute";
		o.style.left = "-5000px";
		document.getElementById("haveYourSay").parentNode.appendChild(o);
		o = null;
		var _self = this;
		this.o.onclick = function(){
			if(_self.bLoaded){
				_self.reset();
			}else{
				(this.sHTML) ? _self.__loaded() : _self.activate();
			};
			return false;
		};
	},
	
	activate : function(){
		this.o.className = "haveYourSayActive";
		Ajax.request({
			uri			: "lib/cms.lib.page.content.asp?sURL=" + this.o.href + "&sField=richEdit0",
			callback	: this.__loaded,
			scope		: this
		});
	},
	
	__loaded : function(oXML){
		if(oXML){
			this.sHTML = oXML.responseText;
			this.bLoaded = 1;
			document.getElementById("placeholder").innerHTML = this.sHTML;
			document.getElementById("haveYourSay").innerHTML += this.sHTML;
			this.nHeight = this.oAnim.obj.offsetHeight;
		};
		this.o.className = "";
		this.oAnim.resize(250, this.oAnim.obj.offsetWidth, this.oAnim.obj.offsetHeight + document.getElementById("placeholder").offsetHeight);
	},
	
	reset : function(){
		this.bLoaded = 0;
		this.oAnim.resize(200, this.oAnim.obj.offsetWidth, this.nHeight);
	}
}
