Modal = Class.create({
	initialize: function(a, b, c) {
		this.src = a;
		this.hgt = b;
		this.wdt = c;

		this.build();
	},
	
	build: function() {
		this.overlay = Builder.node('div', {
			style: 'height:' + document.body.clientHeight + 'px; width:100%; opacity:0.5; position:absolute; background-color:#000; top:0; left:0; z-index:9;'
		});
		
		this.container = Builder.node('div', {
		//style: 'height:' + this.hgt + 'px; background-color:#fff; width:' + this.wdt + 'px; position:absolute; top:' + (document.body.clientHeight/2-(this.hgt/2)) + 'px; left:' + ((document.body.clientWidth/2)-(this.wdt/2)) + 'px; z-index:10;',
		style: 'height:' + this.hgt + 'px; background-color:#fff; width:' + this.wdt + 'px; position:absolute; top:150px; left:' + ((document.body.clientWidth / 2) - (this.wdt / 2)) + 'px; z-index:10;',
			id: "modalC"
		});
		
		this.iframe = Builder.node('iframe', {
			src: this.src,
			style: 'height:' + this.hgt + 'px; width:' + this.wdt + 'px; overflow:hidden; border:0;',
			id: "modalI"
		});
		
		this.container.insert(this.iframe);
		
		document.body.appendChild(this.overlay);
		document.body.appendChild(this.container);
	},
	
	close: function() {
		Element.remove(this.overlay);
		Element.remove(this.container);
	}
});

var mdl;

function showPopWin(url, w, h, n) {
	mdl = new Modal(url, h, w);
}

function closeModal() {
	mdl.close();
}
