jQuery(function ($) {
	if ($.browser.version == "7.0" || $.browser.version == "6.0") {
		$(".side_nav li a").each(function (index) {
			var top_padding = (37 - $(this).height()) / 2;
			$(this).css({
				'display': 'block',
				'padding-top': top_padding,
				'height': 36 - top_padding,
				'width': '131px'
			});
		});
		$(".side_nav li").css("padding", "0");
	}

	$("a").click(function(e) {
		e.preventDefault();

		if ($(this).parent().attr("id") === "pedend") {
			var answer = confirm("This site contains information for licensed healthcare professionals in the United States. By enteringthiswebsite you acknowledge that you are a licensed healthcare professional practicing in the United States");
			if (answer) {
				window.location = $(this).attr('href');
			}
			return false;
		}

		switch ($(this).attr("rel")) {
		case "file":
			ntptEventTag('lc=' + encodeURIComponent(this.href));
			window.open(this.href);
			break;
		case "external1":
			ntptEventTag('lc=' + encodeURIComponent(this.href));
			window.open(this.href);
			break;
		case "external":
		case "corporate":
			ntptEventTag('lc=' + encodeURIComponent(this.href));
				window.open(this.href);
			break;
		case "image":
			ntptEventTag('lc=' + this + '.img');
			window.open($(this).attr("href"));
			break;
		default:
			if ($(this).attr('href').match(/pdf$/)) {
				ntptEventTag('lc=' + encodeURIComponent(this.href));
				window.open(this.href);
			} else if ($(this).attr('href').match(/png$|jpg$|gif$|bmp$/)) {
				ntptEventTag('lc=' + this + '.img');
				window.open($(this).attr("href"));
			} else if ($(this).attr('href').match(/^http/)) {
				if (!$(this).attr('href').match(/supprelin/)) {
					ntptEventTag('lc=' + encodeURIComponent(this.href));
					window.open(this.href);
				} else {
					window.location = $(this).attr("href");
				}
			} else {
				window.location = $(this).attr("href");
			}
		}
		return false;
	});
});
