/* DISABLED BY GLYN ROBERTS
$(document).ready(function() {
	
	$("#sidebar .box .center ul li ul li").hide();
	$("#sidebar .box .center ul li.current_page_parent ul li").show();
	$("#sidebar .box .center ul li.current_page_item ul li").show();
	
	$("#sidebar .box .center ul li").hover(
			function() {
				$(this).find("ul li").css("display","block");
			},
			function () { 
				$(this).find("ul li").css("display","none");
				$("#sidebar .box .center ul li.current_page_parent ul li").show();
				$("#sidebar .box .center ul li.current_page_item ul li").show();
			}
	);
	*/
	
/* Add closing comments to the cite tag*/
$(document).ready(function() {
	$("cite").append('<div class="closetag"></div>');
	$(".hiddenone").click(function() { 
		$(".hiddenone").fadeOut(175);
		$(".hiddentwo").fadeOut(175);
	});
	$("a.closefade").click(function(e) {
		e.preventDefault;
		$(".hiddenone").fadeOut(175);
		$(".hiddentwo").fadeOut(175);
	});
}
);

$(document).ready(function() {
 
	$('#content a').filter(function() {
	    return this.hostname && this.hostname !== location.hostname;
	})
	.click(function (e) {
		e.preventDefault();
		
		var link = $(this).attr("href");
		$("#extLink").attr("href",link);
		confirm("You are about to visit an external website that is not part of the branded international website for Aclasta&reg; (zoledronic acid 5 mg).<br/> Novartis accepts no responsibility for the content of this site.<br/><br/><strong>Do you wish to proceed?</strong>", function () {
			/*window.location.href = link;*/
		});
	});
});

function confirm(message, callback) {
	$('#confirm').modal({
		position: ["20%",],
		overlayId:'confirm-overlay',
		containerId:'confirm-container', 
		onShow: function (dialog) {
			$('.message', dialog.data[0]).append(message);

			// if the user clicks "yes"
			$('.yes', dialog.data[0]).click(function () {
				// call the callback
				if ($.isFunction(callback)) {
					/*callback.apply();*/
				}
				// close the dialog
				$.modal.close();
			});
		}
	});
}