document.write ("<script type='text/javascript' src='/menu/shared/script/thickbox.js'></script>");

$ (function () {
	if ($.browser.safari && (parseInt ($.browser.version) < 525)) {
		$ ("div#content :last-child").addClass ("last-child");
	}
	$ ("img.tab-hover").each (function () {
		$ ("<img>").attr ("src", this.src.replace (/\.([^.]+)$/, "_hover." + "$1")).appendTo ("body").hide ();
	});
});


$ (function () {
	if ($.browser.safari) {
		$ (window).load (function () {
			$ ("div.additional").show ();
		});
	} else {
		$ ("div.additional").show ();
	}
	$ ("div#content div.tab ul li a").click (function () {
		$ ("div#content div.tab ul li a img").each (function () {
			this.src = this.src.replace (/_selected\.([^.]+)$/, "." + "$1");
			$ (this).addClass ("hover");
			$ ("div#content div" + $ (this).parent ().attr ("href")).hide ();
		});
		$ ("img", this).each (function () {
			this.src = this.src.replace (/[_hover]*\.([^.]+)$/, "_selected." + "$1");
			$ (this).removeClass ("hover");
		});
		$ ("div#content div" + $ (this).attr ("href")).show ();
		return false;
	});
	$ (window).load (function () {
		if (/id=([^&]+)/.test (location.search)) {
			var id = RegExp.$1;
			$ ("div#content a[href*=" + id + "]").click ();
			$ ("div#content div.tab ul li a[href*=" + $ ("div#content div.tab-content:has(a[href*=" + id + "])").eq (0).attr ("id") + "]").click ();
		} else {
			$ ("div#content div.tab ul li:first-child a").click ();
		}
	});
	$ ("img.sub-hover").each (function () {
		$ ("<img>").attr ("src", this.src.replace (/\.([^.]+)$/, "_hover." + "$1")).appendTo ("body").hide ();
	});
	$ ("a:has(img.sub-hover)").hover (function () {
		$ ("img.sub-hover", this).each (function () {
			this.src = this.src.replace (/\.([^.]+)$/, "_hover." + "$1");
		});
		$ (this).parent ().children ().children ("img").eq (0).each (function () {
			this.src = this.src.replace (/\.([^.]+)$/, "_hover." + "$1");
		});
	}, function () {
		$ ("img.sub-hover", this).each (function () {
			this.src = this.src.replace (/_hover\.([^.]+)$/, "." + "$1");
		});
		$ (this).parent ().children ().children ("img").eq (0).each (function () {
			this.src = this.src.replace (/_hover\.([^.]+)$/, "." + "$1");
		});
	});
});