
window.addEvent("load", function() {
	SqueezeBox.initialize();
	if (typeof window.innerWidth == "number") {
		// non-IE
		SqueezeBox.winWidth = window.innerWidth;
		SqueezeBox.winHeight = window.innerHeight;
	} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		// IE 6+ in standards compliant mode
		SqueezeBox.winWidth = document.documentElement.clientWidth;
		SqueezeBox.winHeight = document.documentElement.clientHeight;
	} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		// IE 4 compatible
		SqueezeBox.winWidth = document.body.clientWidth;
		SqueezeBox.winHeight = document.body.clientHeight;
	}
	$$("a").each(function(el) {
		if ($defined(el.className) && el.className.match(/modalWindow/i)) {
			el.removeProperty("rel").addEvent("click", function(e) {
				new Event(e).stop();
				SqueezeBox.fromElement(el, {"handler": "iframe", "size": {"x" : parseInt((SqueezeBox.winWidth / 100) * 90), "y" : parseInt((SqueezeBox.winHeight / 100) * 80)}});
				return false;
			});
		} else if ($defined(el.href) && el.href.match(/openid\.net/i)) {
			el.removeProperty("rel").addEvent("click", function(e) {
				new Event(e).stop();
				SqueezeBox.fromElement(el, {"handler": "iframe", "size": {"x" : parseInt((SqueezeBox.winWidth / 100) * 90), "y" : parseInt((SqueezeBox.winHeight / 100) * 80)}});
				return false;
			});
		}
	});

	$$("a[target=_modal]").each(function(el) {
		el.removeProperty("rel").addEvent("click", function(e) {
			new Event(e).stop();
			SqueezeBox.fromElement(el, {"handler": "iframe", "size": {"x" : parseInt((SqueezeBox.winWidth / 100) * 90), "y" : parseInt((SqueezeBox.winHeight / 100) * 80)}});
			return false;
		});
	});
});
