$(document).ready(function(){
	$('.popupBG').each(function(){
		$('body').append(this);
		$(this).css('z-index', 9999);
	});
	$('.healingChart>a.showLarge, .healingEEChart>a.showLarge').bind('click', 'a', function(evt){
		trackingUnbind($(this));

		$('#popupBG').attr('sTop', $(document).scrollTop());
		$(document).scrollTop(0);
		var cont = $(this).parent().find('.cont');
		var img = cont.find('>img').attr('rel');
		if(img == 'pic3') {
			//$('.info > p:nth-child(3)').attr("style","font-size: 14px");
			//$('.info > p:nth-child(3)').addClass('first');
		}
		var data = '<div class="info">' + cont.find('.info').html() + '</div>';
		$('.popupBG').width($(document).width()).show();
		if($.browser.msie && $.browser.version =='6.0'){
			$('.popupBG').width($('.popupBG').width()-21);
		}
		if(img == 'pic3'){
			$('#healingPopTitle').removeClass();
			$('#healingPopTitle').addClass("top newBg");
			$('#healingChartPopup a.close').attr("id", "omeprazoleClose");
			
		}else if(img == 'pic4'){
			$('#healingPopTitle').removeClass();
			$('#healingPopTitle').addClass("top");
			$('#healingChartPopup a.close').attr("id", "lansoprazoleClose");
		}
		$('#healingChartPopup .cont>img').hide();
		$('#healingChartPopup .cont>img[rel="' + img + '"]').show();
		$('#healingChartPopup .cont').append(data);
		setTimeout(function(){
			$('.popupBG').height($(document).height());
			$('#popupBG').css({opacity:0.5, backgroundColor:'#000'}).bgiframe();
		}, 0);
		// re-init tracking framework after DOM changes
		trackingInit();
	});
	$('#healingChartPopup a.close').click(function(){
		$('.healingChart .cont p.first').attr("style","font-size: 13px");
		$('.healingChart .cont p.first').removeClass();
		
		$('#healingChartPopup .info').remove();
		$('.popupBG').hide();
	});
});
