﻿var OverlayFix=new Class({

	initialize:function(el) {
		this.element=$(el);
		if (Browser.Engine.trident4){
			this.element.addEvent("trash",this.destroy.bind(this));
			this.fix=new Element("iframe",{
				properties:{
					frameborder:"0",
					scrolling:"no",
					src:"javascript:false;"
				},
				styles:{
					position:"absolute",
					border:"none",
					display:"none",
					filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"
				}
			}).inject(this.element,"after");
		}
	},

	show:function() {
		if (this.fix) this.fix.setStyles($extend(
			this.element.getCoordinates(),{
				display:"",
				zIndex:(this.element.getStyle("zIndex") || 1) - 1
			}));
		return this;
	},

	hide:function() {
		if (this.fix) this.fix.setStyle("display","none");
		return this;
	},

	destroy:function() {
		this.fix.remove();
	}

});

