
var SPACER = "/in2/templates/jez_rego/images/spacer.gif";
var selective = true;
var pngClass = "png24";
jezAddEvent(window, "load", jezFixPNGs);

jezAddEvent(window, "load", function() {
	jezKeepVertRhythm("img");
});

if (window.attachEvent && jezIEVer <= 6) { // client browser is IE <= 6
	jezAddEvent(window, "load", function() {
		// add hover state to li elements of global nav
		jezSwitchState("jezNav", "li", true);
	});
}

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.modalEmail").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) * 80), "y" : parseInt((SqueezeBox.winHeight / 100) * 80)}});
			return false;
		});
	});

	$$("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;
		});
	});
});
