/*
This is the standard template you should add to your book JS file before
customizing.
Uncomment any of the configuration options to change the default behavior (see
https://macmillanhighered.atlassian.net/wiki/display/MP/Player+Configuration+Options
for descriptions of the options).
*/
/* section link map */
/* maps id reference to URL */
var section_link_map = {};
section_link_map['krugmanwellsessentials4e-ch01-sec1-001'] = 'krugmanwellsessentials4e_ch1_2.html';
section_link_map['krugmanwellsessentials4e-ch01-sec1-002'] = 'krugmanwellsessentials4e_ch1_3.html';
section_link_map['krugmanwellsessentials4e-ch01-sec1-003'] = 'krugmanwellsessentials4e_ch1_4.html';
section_link_map['krugmanwellsessentials4e-ch01-sec1-004'] = 'krugmanwellsessentials4e_ch1_5.html';
section_link_map['krugmanwellsessentials4e-ch01-sec1-005'] = 'krugmanwellsessentials4e_ch1_6.html';
section_link_map['krugmanwellsessentials4e-ch02-sec1-001'] = 'krugmanwellsessentials4e_ch2_2.html';
section_link_map['krugmanwellsessentials4e-ch02-sec1-002'] = 'krugmanwellsessentials4e_ch2_3.html';
section_link_map['krugmanwellsessentials4e-ch02-sec1-003'] = 'krugmanwellsessentials4e_ch2_4.html';
section_link_map['krugmanwellsessentials4e-ch02-sec1-004'] = 'krugmanwellsessentials4e_ch2_5.html';
section_link_map['krugmanwellsessentials4e-ch02-sec1-005'] = 'krugmanwellsessentials4e_ch2_6.html';
section_link_map['krugmanwellsessentials4e-ch03-sec3-001'] = 'krugmanwellsessentials4e_ch3_2.html';
section_link_map['krugmanwellsessentials4e-ch03-sec3-002'] = 'krugmanwellsessentials4e_ch3_3.html';
section_link_map['krugmanwellsessentials4e-ch03-sec3-003'] = 'krugmanwellsessentials4e_ch3_4.html';
section_link_map['krugmanwellsessentials4e-ch03-sec3-004'] = 'krugmanwellsessentials4e_ch3_5.html';
section_link_map['krugmanwellsessentials4e-ch03-sec3-005'] = 'krugmanwellsessentials4e_ch3_6.html';
section_link_map['krugmanwellsessentials4e-ch04-sec1-001'] = 'krugmanwellsessentials4e_ch4_2.html';
section_link_map['krugmanwellsessentials4e-ch04-sec1-002'] = 'krugmanwellsessentials4e_ch4_3.html';
section_link_map['krugmanwellsessentials4e-ch04-sec1-003'] = 'krugmanwellsessentials4e_ch4_4.html';
section_link_map['krugmanwellsessentials4e-ch04-sec1-004'] = 'krugmanwellsessentials4e_ch4_5.html';
section_link_map['krugmanwellsessentials4e-ch04-sec1-005'] = 'krugmanwellsessentials4e_ch4_6.html';
section_link_map['krugmanwellsessentials4e-ch05-sec1-001'] = 'krugmanwellsessentials4e_ch5_2.html';
section_link_map['krugmanwellsessentials4e-ch05-sec1-002'] = 'krugmanwellsessentials4e_ch5_3.html';
section_link_map['krugmanwellsessentials4e-ch05-sec1-003'] = 'krugmanwellsessentials4e_ch5_4.html';
section_link_map['krugmanwellsessentials4e-ch05-sec1-004'] = 'krugmanwellsessentials4e_ch5_5.html';
section_link_map['krugmanwellsessentials4e-ch05-sec1-005'] = 'krugmanwellsessentials4e_ch5_6.html';
section_link_map['krugmanwellsessentials4e-ch05-sec1-006'] = 'krugmanwellsessentials4e_ch5_7.html';
section_link_map['krugmanwellsessentials4e-ch06-sec1-001'] = 'krugmanwellsessentials4e_ch6_2.html';
section_link_map['krugmanwellsessentials4e-ch06-sec1-002'] = 'krugmanwellsessentials4e_ch6_3.html';
section_link_map['krugmanwellsessentials4e-ch06-sec1-003'] = 'krugmanwellsessentials4e_ch6_4.html';
section_link_map['krugmanwellsessentials4e-ch06-sec1-004'] = 'krugmanwellsessentials4e_ch6_5.html';
section_link_map['krugmanwellsessentials4e-ch06-sec1-005'] = 'krugmanwellsessentials4e_ch6_6.html';
section_link_map['krugmanwellsessentials4e-ch06-sec1-006'] = 'krugmanwellsessentials4e_ch6_7.html';
section_link_map['krugmanwellsessentials4e-ch06-sec1-007'] = 'krugmanwellsessentials4e_ch6_8.html';
section_link_map['krugmanwellsessentials4e-ch07-sec1-001'] = 'krugmanwellsessentials4e_ch7_2.html';
section_link_map['krugmanwellsessentials4e-ch07-sec1-002'] = 'krugmanwellsessentials4e_ch7_3.html';
section_link_map['krugmanwellsessentials4e-ch07-sec1-003'] = 'krugmanwellsessentials4e_ch7_4.html';
section_link_map['krugmanwellsessentials4e-ch07-sec1-004'] = 'krugmanwellsessentials4e_ch7_5.html';
section_link_map['krugmanwellsessentials4e-ch07-sec1-005'] = 'krugmanwellsessentials4e_ch7_6.html';
section_link_map['krugmanwellsessentials4e-ch08-sec1-001'] = 'krugmanwellsessentials4e_ch8_2.html';
section_link_map['krugmanwellsessentials4e-ch08-sec1-002'] = 'krugmanwellsessentials4e_ch8_3.html';
section_link_map['krugmanwellsessentials4e-ch08-sec1-003'] = 'krugmanwellsessentials4e_ch8_4.html';
section_link_map['krugmanwellsessentials4e-ch08-sec1-004'] = 'krugmanwellsessentials4e_ch8_5.html';
section_link_map['krugmanwellsessentials4e-ch08-sec1-005'] = 'krugmanwellsessentials4e_ch8_6.html';
section_link_map['krugmanwellsessentials4e-ch08-sec1-006'] = 'krugmanwellsessentials4e_ch8_7.html';
section_link_map['krugmanwellsessentials4e-ch09-sec1-001'] = 'krugmanwellsessentials4e_ch9_2.html';
section_link_map['krugmanwellsessentials4e-ch09-sec1-002'] = 'krugmanwellsessentials4e_ch9_3.html';
section_link_map['krugmanwellsessentials4e-ch09-sec1-003'] = 'krugmanwellsessentials4e_ch9_4.html';
section_link_map['krugmanwellsessentials4e-ch09-sec1-004'] = 'krugmanwellsessentials4e_ch9_5.html';
section_link_map['krugmanwellsessentials4e-ch09-sec1-005'] = 'krugmanwellsessentials4e_ch9_6.html';
section_link_map['krugmanwellsessentials4e-ch09-sec1-006'] = 'krugmanwellsessentials4e_ch9_7.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-001'] = 'krugmanwellsessentials4e_ch10_2.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-002'] = 'krugmanwellsessentials4e_ch10_3.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-003'] = 'krugmanwellsessentials4e_ch10_4.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-004'] = 'krugmanwellsessentials4e_ch10_5.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-005'] = 'krugmanwellsessentials4e_ch10_6.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-006'] = 'krugmanwellsessentials4e_ch10_7.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-007'] = 'krugmanwellsessentials4e_ch10_8.html';
section_link_map['krugmanwellsessentials4e-ch10-sec1-008'] = 'krugmanwellsessentials4e_ch10_9.html';
section_link_map['krugmanwellsessentials4e-ch11-sec1-001'] = 'krugmanwellsessentials4e_ch11_2.html';
section_link_map['krugmanwellsessentials4e-ch11-sec1-002'] = 'krugmanwellsessentials4e_ch11_3.html';
section_link_map['krugmanwellsessentials4e-ch11-sec1-003'] = 'krugmanwellsessentials4e_ch11_4.html';
section_link_map['krugmanwellsessentials4e-ch11-sec1-004'] = 'krugmanwellsessentials4e_ch11_5.html';
section_link_map['krugmanwellsessentials4e-ch11-sec1-005'] = 'krugmanwellsessentials4e_ch11_6.html';
section_link_map['krugmanwellsessentials4e-ch11-sec1-006'] = 'krugmanwellsessentials4e_ch11_7.html';
section_link_map['krugmanwellsessentials4e-ch11-sec1-007'] = 'krugmanwellsessentials4e_ch11_8.html';
section_link_map['krugmanwellsessentials4e-ch12-sec1-001'] = 'krugmanwellsessentials4e_ch12_2.html';
section_link_map['krugmanwellsessentials4e-ch12-sec1-002'] = 'krugmanwellsessentials4e_ch12_3.html';
section_link_map['krugmanwellsessentials4e-ch12-sec1-003'] = 'krugmanwellsessentials4e_ch12_4.html';
section_link_map['krugmanwellsessentials4e-ch12-sec1-004'] = 'krugmanwellsessentials4e_ch12_5.html';
section_link_map['krugmanwellsessentials4e-ch12-sec1-005'] = 'krugmanwellsessentials4e_ch12_6.html';
section_link_map['krugmanwellsessentials4e-ch12-sec1-006'] = 'krugmanwellsessentials4e_ch12_7.html';
section_link_map['krugmanwellsessentials4e-ch13-sec1-001'] = 'krugmanwellsessentials4e_ch13_2.html';
section_link_map['krugmanwellsessentials4e-ch13-sec1-002'] = 'krugmanwellsessentials4e_ch13_3.html';
section_link_map['krugmanwellsessentials4e-ch13-sec1-003'] = 'krugmanwellsessentials4e_ch13_4.html';
section_link_map['krugmanwellsessentials4e-ch13-sec1-004'] = 'krugmanwellsessentials4e_ch13_5.html';
section_link_map['krugmanwellsessentials4e-ch13-sec1-005'] = 'krugmanwellsessentials4e_ch13_6.html';
section_link_map['krugmanwellsessentials4e-ch13-sec1-006'] = 'krugmanwellsessentials4e_ch13_7.html';
section_link_map['krugmanwellsessentials4e-ch14-sec1-001'] = 'krugmanwellsessentials4e_ch14_2.html';
section_link_map['krugmanwellsessentials4e-ch14-sec1-002'] = 'krugmanwellsessentials4e_ch14_3.html';
section_link_map['krugmanwellsessentials4e-ch14-sec1-003'] = 'krugmanwellsessentials4e_ch14_4.html';
section_link_map['krugmanwellsessentials4e-ch14-sec1-004'] = 'krugmanwellsessentials4e_ch14_5.html';
section_link_map['krugmanwellsessentials4e-ch14-sec1-005'] = 'krugmanwellsessentials4e_ch14_6.html';
section_link_map['krugmanwellsessentials4e-app01-sec1-001'] = 'krugmanwellsessentials4e_app1_2.html';
section_link_map['krugmanwellsessentials4e-app01-sec1-002'] = 'krugmanwellsessentials4e_app1_3.html';
section_link_map['krugmanwellsessentials4e-app01-sec1-003'] = 'krugmanwellsessentials4e_app1_4.html';
section_link_map['krugmanwellsessentials4e-app01-sec1-004'] = 'krugmanwellsessentials4e_app1_5.html';
/**************************************
Set this to the DF book ID (Subtype)
**************************************/
xBookUtils.bookID = "krugmanwellsessentials4e";
/*
You only need to set the disciplines if you are using the HTML Quiz
question delivery method, which only BSM ebooks and HTML Quizzes are at this
time (in other words, if this is a FW ebook then you don't need to do a thing).
Change the zeros to the discipline number for each tier on PX.
Discipline numbers:
History: 6696 (all tiers)
Composition: 6698 (all tiers)
Communication: 6700 (all tiers)
College Success: 6704 (all tiers)
If you do not know the discipline number for your book then ask your MP.
*/
xBookUtils.discipline = {
dev: 0,
qa: 0,
pr: 0,
www: 0
}
var Player_subtype = Player_manuscript_type.extend({
//cfg_removeRawHtmlDivs: "on",
cfg_showAnswer: "on",
//cfg_showAnswerAutoWrapThis: "off",
// to move h3 out of b0x_inner
//cfg_Box_moveTitle: "all",
//cfg_Box_moveTitleExclude: "",
cfg_Figures_targetDefault: "_pop",
cfg_Figures_resizeDivWidth: "on",
cfg_Figures_autoHtml: "on",
cfg_LH_autoHtml: "on",
cfg_LH_externalTargetDefault: "_pop",
cfg_LH_internalTargetDefault: "_pop",
cfg_LH_ebookTargetDefault: "_pop",
cfg_LH_imageTargetDefault: "_pop",
cfg_LH_useOpenContent: "on",
cfg_LH_useLinksFile: "on",
cfg_Glossary_hoverTerms: "off",
cfg_Glossary_useStickyDiv: "off",
//cfg_Glossary_hoverTermsNoClick: "",
cfg_pageNumbers: "on",
cfg_PPM_pageJump: "on",
initialize_sections: function() {
// Do not delete this
this._super();
// Anything that needs to be done before the page displays
// should be done here.
var bookid = "krugmanwellsessentials4e";
var matches;
//Global Comparison
$("div[data-block_type='bx4-h'] > div[data-type='box_inner'] > h3").html(function () {
//alert($(this).html());
return $(this).html().replace(/(GLOBAL\s?COMPARISON)/, "GLOBAL
COMPARISON");
});
// Run section-link_map above, providing section links
//Section references linked to sections
$('a[href]').each(function(){
var old_href = $(this).attr('href');
if(section_link_map.hasOwnProperty(old_href)){
$(this).attr('href', section_link_map[old_href]);
}
});
}, // end initialize_sections
/*
You will most likely not make any changes to the initialize
method unless you know exactly what you are doing :-)
*/
initialize: function(id) {
// Do not delete this
this._super(id);
this.xrefs = new XRefs_manuscript_subtype();
// note that terms.js is turned off for this book in the following arguments
this.glossary = new Glossary_manuscript_subtype({terms: false});
this.figures = new Figures_manuscript_subtype();
}, // end initialize
initialize2: function() {
// Do not delete this
this._super();
var link_handler = new LinkHandler();
// Anything that can be done after the page displays
// should be done here.
// in-text links (spans)
// fix figure links, which will not pop into supplemental window without these changes
$('a[data-type="lh-link"]').attr('target', '_pop').removeAttr('data-xrefs-target');
/////////////
// Questions
/////////////
// Problems section questions
$('[data-block_type="q_prob"]').each(function() {
// get question number
var qnum = $(this).attr("data-question_index");
// extract chapter number from within ID
var cnum = $(this).attr("id");
cnum = cnum.replace(/krugmanwellsessentials4e-ch(\d+)-question-\d+/, "$1");
// construct the supp win URL
var winpath = "asset/ch" + cnum + "/questions/question_" + qnum + ".html";
// make the question marker clickable using pseudo-links
var qmarker = $(this).find('[data-block_type="qnum"]');
qmarker.attr('data-href', winpath);
qmarker.attr('data-target', "_pop");
});
// Check Your Understanding feature questions
$('[data-block_type="q_cyu"]').each(function() {
var qid = $(this).attr("id");
// extract chapter and question number from within ID
var qnum = qid.replace(/krugmanwellsessentials4e-ch\d+-cyuquestion-(\d+)/, "$1");
var cnum = qid.replace(/krugmanwellsessentials4e-ch(\d+)-cyuquestion-\d+/, "$1");
// construct the supp win URL
var winpath = "asset/ch" + cnum + "/questions/cyu_question_" + qnum + ".html";
// make the question marker clickable using pseudo-links
var qmarker = $(this).find('[data-block_type="qnum"]');
qmarker.attr('data-href', winpath);
qmarker.attr('data-target', "_pop");
});
/////////////
// Tables
/////////////
// Unnumbered tables -- add pseudo-links to pop up supplemental windows
$('[data-block_type="un_table"]').each(function() {
// get table number - note that the supplemental windows are built in Perl scripts,
// using the unnumbered table ID for chapter and table numbers. The same ID is
// used here to derive the supplemental window file URL.
var tid = $(this).attr("id");
// extract chapter number from within ID
var cnum = tid.replace(/krugmanwellsessentials4e-ch(\d+)-untab-\d+/, "$1");
// extract table number from end of ID
var tnum = tid.replace(/krugmanwellsessentials4e-ch\d+-untab-(\d+)/, "$1");
// construct the supp win URL
var winpath = "asset/ch" + cnum + "/tables/untable_" + cnum + "_" + tnum + ".html";
if ($(this).parents("[show_answer_container]")) {
$(this).removeAttr('data-href');
$(this).removeAttr('data-target');
}
else {
// make the whole table clickable using pseudo-links
$(this).attr('data-href', winpath);
$(this).attr('data-target', "_pop");
}
});
/////////////////////////////////////////////////////////////
// SUPPLEMENTAL WINDOWS
// remove link elements to deactivate further pop events
/////////////////////////////////////////////////////////////
$('#supp_win #manuscript.figure [data-type="figure"]').each(function () {
$(this).find('img').unbind();
});
$('#supp_win #manuscript.figure [data-block_type="figure"]').each(function () {
$(this).find('[data-block_type="fig-label"]').unwrap();
});
$('#supp_win #manuscript.figure [data-block_type="figure2"]').each(function () {
$(this).find('[data-block_type="fig-label"]').unwrap();
});
$('#supp_win #manuscript.exercise [data-block_type="qnum"]').each(function () {
$(this).removeAttr('data-href').removeAttr('data-target');
});
$('#supp_win #manuscript.table [data-type="table"]').each(function () {
$(this).removeAttr('data-href').removeAttr('data-target');
});
} // end initialize2
}); // end Player_subtype
// Do not delete this
player = new Player_subtype();