Element.extend({
	setOpacity:function(opacity) {
				if (opacity == 0){
	                        if (this.style.visibility != "hidden") this.style.visibility = "hidden";
	                } else {
	                        if (this.style.visibility != "visible") this.style.visibility = "visible";
	                }
	                if (!this.currentStyle || !this.currentStyle.hasLayout) this.style.zoom = 1;
					
	                if (window.ie) {
						var tmpFilter = this.style.filter;
						tmpFilter = tmpFilter.split("progid");
						if (tmpFilter.length == 0)
							this.style.filter = (opacity == 1) ? '' : "alpha(opacity=" + opacity * 100 + ")";
						else {
							var newFilter = ((opacity == 1) ? '' : "progid:DXImageTransform.Microsoft.Alpha(opacity=" + opacity * 100 + ") \n") 
							tmpFilter.each(function(item) {
								if(item.length == 0) return;
								if(item.indexOf("opacity") != -1) return;
								newFilter = newFilter + "\nprogid" + item;
							});
							this.style.filter = newFilter;
						}
					}
	                this.style.opacity = this.$tmp.opacity = opacity;
	                return this;
	}
});
window.addEvent("domready",function() {
	var elms = $ES("#quote, #online_chat");
	elms.each(function (item) {
		if(window.ie && item.id == "quote") return;
		item.setStyle("opacity",0.5);
		
		item.fx = new Fx.Styles(item, {duration:300, wait:false});
		
		item.addEvent("mouseenter",function () {
				this.fx.start({
						'opacity': [0.5,1]
					});		
		});
		item.addEvent("mouseleave",function () {
				if(window.ie && this.id == "quote") return;
				this.fx.start({
						'opacity': [1,0.5]
					});
		});
	});
});

var myloChat = {
	open:function(lang) {
		pageTracker._trackPageview("/chatActive/" + myloLang + "/");
		var prefix = "./";
		if((new String(window.location)).indexOf("/" + lang + "/") == -1)
			prefix = "/" + lang + "/";
		window.open(prefix + 'chat_form',"","status=0,scrollbars=0,menubar=0,statusbar=0,resizable=1, width=300,height=500,location=0");
	}
};