// This code uses JQuery library and it has to be included before this code
// Mapping format: 'body#[pageID] .[linkClass]' : '[Atlas http or https URL]'
var atlasTags = {
	'body#understanding_cancer .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoUnderstandingCancerPRINT_6', 
	'body#staging_grading .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoCancerStagingandGradingPRINT_6',
	'body#treating_with_chemo .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoTreatingWithChemoPRINT_6',
	'body#how .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoHowPeopleReceiveChemoPRINT_6',
	'body#chemo .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoChemoCyclesandSchedulesPRINT_6',
	'body#remission .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoGoalofCancerTherapyPRINT_1',
	'body#side_effects .linkPrintVersion': 'http://switch.atdmt.com/action/deineu_ChemotherapySideEffectsPRINT_6',
	'body#white_blood_cell .linkPrintVersion': 'http://switch.atdmt.com/action/deineu_ManagingaLowWhiteBloodCellCountNPRINT_6',
	'body#infection .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoDiagnosisandPreventionPRINT_6',
	'body#red_blood_cell .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoMLRBCCAnemiaPRINT_6',
	'body#platelet .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoMLPCThrombocytopeniaPRINT_6',
	'body#other_side_effects .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoOtherChemoSideEffectsPrint_6',
	'body#call_doctor .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoWhentoCallDoctorPRINT_6',
	'body#other_ways .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoTreatinginOtherWaysPrint_6',
	'body#surgery .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoSurgeryPrint_6',
	'body#radiation .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoRadiationTherapyPrint_6',
	'body#bio .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoBiologicalTherapyPrint_6',
	'body#hormonal .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoHormonalTherapyPrint_6',
	'body#tracking_results .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoTrackingTestResultsPrint_6',
	'body#blood_count .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoYourCompleteBloodCountPrint_6',
	'body#sample_cbc .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoViewSampleCBCPRINT_6',
	'body#glossary .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoGlossaryofCommonDiagnosticLabTests_6',
	'body#monitoring .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoMonitoringTumorMarkersPRINT_6',
	'body#returns .linkPrintVersion': 'http://view.atdmt.com/action/deineu_ChemoMedicalCostsonTaxReturnPrint_6',
	'body#tools .linkPrintVersion': 'http://switch.atdmt.com/action/deineu_ToolsForOrganizingCancerInfoPRINT_6'
};
// ------------------- DO NOT MODIFY BELOW THIS LINE -------------------------------------------------------------------------------------
var atlasDivId = "atlasTags";
function trackInAtlas(url) {
	var timestamp = Number(new Date());
	var img = new Image();
	$(img).attr("src",url+"?time="+timestamp);
	$('#'+atlasDivId).css("display", "block");
	$('#'+atlasDivId).html($(img));
	$('#'+atlasDivId).css("display", "none");
}

$(document).ready(function(){
	// Add placeholder for images
	if(!($('#'+atlasDivId).length)) {
		div = $("<div>");
		div.attr("id",atlasDivId);
		$("body").append(div);
	}
	if (atlasTags != null) {
		$.each(atlasTags, function(key, value) {
			$(key).click(function () { trackInAtlas(value); }); 
		});
	}
});
