Simple Present Routines - Cambridge University Press

  • Pdf File 0KByte



window.dataLayer = window.dataLayer || [];

(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':

new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],

j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=

''+i+dl;f.parentNode.insertBefore(j,f);

})(window,document,'script','dataLayer','GTM-MXMG453');

Grammar and Beyond Second Edition | Adult & Young Adult | Cambridge University Press

var CCM_DISPATCHER_FILENAME = ''; var CCM_CID = 163221; var CCM_EDIT_MODE = false; var CCM_ARRANGE_MODE = false;

var CCM_IMAGE_PATH = "/us/concrete/images";

var CCM_TOOLS_PATH = "/us/tools/required";

var CCM_BASE_URL = "";

var CCM_REL = "/us";

var KK_MINI_CART = "//wm-ecommerce-web/ws/getItems";

var VISTA_SERVICE_REGION = "N";

var IS_KK_ASIA = "1";

var IS_KK_AUS = "1";

var CURRENT_SITE = "cambridgeenglish";

var GTM_CURRENT_THEME = "cambridgeenglish";

var VYRE_BASKET = "//wm-ecommerce-web/academic/cart";

var IS_KK_ACS_ENABLED = "0";

if (window.dataLayer !== undefined) {

window.dataLayer.push({"stream": GTM_CURRENT_THEME});

}

var CWS_ECOMMERCE_ENABLED = true;

if (CWS_ECOMMERCE_ENABLED) {

var Locale = {

countryCode: "US",

countryName: "United States",

currencyCode: "USD",

currencySymbol: "$",

region: "N"

};

}

.pink-theme .container-geometric.large:before,

.pink-theme .block-text,

.pink-theme .container-geometric.large .panel-header,

.pink-theme .section-header:after,

.pink-theme .container-geometric.small:before,

.pink-theme .container-geometric.medium:before {

background-color: #5d7fba;

}

.pink-theme i.fa-check-circle {

color: #5d7fba;

}

.pink-theme .section-header .section-header-inner {

border: 1px solid #5d7fba;

color: #5d7fba;

}

.pink-theme .container-geometric {

background-color: #5e3180;

}

.content-panel ul li::after {

background-color: #5d7fba;

}

.wrapperBlog span.block-text {

color: #fff;

background-color: #5e3180;

}

.content-panel ul li span { font-size: inherit !important; }

var CCP_ENABLED = 1;

Skip to content

To register on our site and for the best user experience, please enable Javascript in your browser using these instructions.

Open global navigationCambridge University PressCambridge University PressAcademicCambridge Core (Institutional access)Books Catalogue (Individuals)English Language LearningEducationBiblesDigital ProductsAbout UsGovernanceCareersRights & PermissionsConference VenuesContact UsCareersContact UsUnited States CartLocation selectorLocation selectorSearch toggleMenu

Select your group

Who are you?I'm a TeacherI'm a StudentShow me everything

Cart 

View cart and checkout

Continue shopping

×

Continue shopping

×

Register

Sign in

$(document).ready(function () {

$(".registerButton").click(function () {

$("#registerForm").submit();

return false;

});

});

Search products

$(document).ready(function() {

//precedence is important here, this change must execute BEFORE the autocomplete....

$(".academicSearch input#query").autocomplete({

source: '/us/tools/packages/cambridge_themes/family_autocomplete?currentTheme=',

minLength: 2,

select: function( event, ui ) {

$("#iFeelLucky").val("true");

$("input#query").val(ui.item.value);

$("#search").submit();

},

open: function(event, ui) {

$("ul.ui-autocomplete.ui-menu li").css('cursor', 'hand');

$("ul.ui-autocomplete.ui-menu li").css('cursor', 'pointer');

var url = 'See more results';

$("ul.ui-autocomplete.ui-menu").append(url);

}

});

});

li.ui-menu-item {

list-style: none;

list-style-type: none;

}

li.ui-menu-item a {

padding-left: 10px!important;

}

.ui-autocomplete {

background-color: #ffffff;

max-height: 400px;

overflow-y: auto;

/* prevent horizontal scrollbar */

overflow-x: hidden;

/* add padding to account for vertical scrollbar */

/*padding-right: 20px; */

font-family:Arial,Helvetica,sans-serif;

padding: 0px 0px 0px 5px; /* top, right ,bottom, left */

/*padding-top:0px;*/

/*padding-bottom: 0px;*/

/*background-color: yellow;*/

padding-left: 0;

border-bottom: 1px;

width: 390px!important;/*force width*/

}

/* IE 6 doesn't support max-height

* we use height instead, but this forces the menu to always be this tall

*/

* html .ui-autocomplete {

height: 250px;

}

@media only screen and (max-width: 768px) {

.ui-autocomplete {

background-color: #ffffff;

max-height: 400px;

overflow-y: auto;

/* prevent horizontal scrollbar */

overflow-x: hidden;

/* add padding to account for vertical scrollbar */

/*padding-right: 20px; */

font-family:Arial,Helvetica,sans-serif;

padding: 0px 0px 0px 5px; /* top, right ,bottom, left */

/*padding-top:5px;*/

/*padding-bottom: 5px;*/

/*background-color: yellow;*/

padding-left: 0;

border-bottom: 1px;

width: 310px!important;/*force width*/

}

}

@media only screen and (max-width: 1024px) {

li.ui-menu-item a {

padding-top: 5px!important;

padding-bottom: 5px!important;

}

}

i.fa.fa-angle-down.custom-dropdown {

margin-left: 5px;

font-weight: bold;

font-size: 1.2em;

}

Catalog

Subjects

Academic EnglishAdult & Young AdultBusiness, Professional and VocationalCambridge English Exams & IELTSDictionariesGrammar, Vocabulary and PronunciationReadersSecondarySkillsTeacher Training, Development and ResearchTOEFL & TOEICYoung LearnersSee all subjects

Popular links

Cambridge Assessment English

Visit our sister organisation

Choose In Use

Find the right 'In Use' for you

ResourcesTeacher DevelopmentBetter LearningNews & EventsBlogAbout UsAbout Cambridge EnglishKahootAbout Cambridge EnglishKahootContact & OrderingContact UsSupportContact UsSupportUnited States 

Home /English Language Learning /Catalogue /Adult & Young Adult/Grammar and Beyond 2nd Edition

Share this page

Share this page

StumbleUpon

Facebook

Pinterest

Twitter

Digg

Delicious

Copy link

Home /English Language Learning /Catalogue /Adult & Young Adult/Grammar and Beyond 2nd Edition

Share this page

Share this page

StumbleUpon

Facebook

Pinterest

Twitter

Digg

Delicious

Copy link

 

Samples

Request a sample unit

Please select a type of sample

Request book as an eSample

Download unit (472Kb)

Cancel

Overview

Product Details

Content

Components

Resources

Help & Support

Grammar and Beyond

Second Edition

Connecting grammar and writing for academic success and beyond.

A four-level course to help students learn the most useful grammar and academic writing, perfect for grammar classes with a strong focus on developing academic writing skills or to be used in academic writing courses. Students learn grammar in real-world contexts that apply outside the classroom and become a foundation to acquiring key academic writing skills. Each Student's Book includes an activation code to Online Practice for more activities using mobile devices.

 

Looking for Grammar and Beyond First Edition? Visit here.

Product Details

Authors: Randi Reppen, Laurie Blass, Susan Iannuzzi, John D. Bunting, Luciana Diniz

CEFR Levels: A1 - C1

Find a rep

Add to wishlist

Buy

  Key Features  

Academic writing skills and strategies prepare students to think critically and write successfully in the college classroom.

Avoid Common Mistakes helps students identify and correct their most commonly made errors to develop self-editing skills and improve their speaking and writing.

Rigorous vocabulary development using thematically linked words are recycled throughout the unit allowing students to acquire the meaning naturally.

QR codes throughout the book give point-of-use access to audio in class or for review.

Online Practice is included in every Student’s Book.

- The Digital Workbook provides additional activities and an opportunity for students to assess their mastery of the grammar points.

- Writing Skills Interactive develops a wide range of skills for students to become successful writers.

See how Grammar and Beyond enables Better Learning experiences

Better Learning is our simple approach where deeper insights help shape richer content that drives stronger results.

Experience Better Learning

  Insights  

Informed by years of research 

The grammar presented is based on the grammar of written and spoken English as it is used in college lectures, textbooks, academic essays, high school classrooms, and coversations between instructors and students.

Research-based

Authors were able to write the course based on research and analysis of over one billion words of authentic written and spoken language.

Present grammar rules that accurately represent how English is actually spoken and written

Identify and teach differences between the grammar of written and spoken English

Focus more attention on the structures that are commonly used, and less on those that are rarely used, in writing and speaking

Help students avoid the most common mistakes that English language learners make

Choose reading topics that will naturally elicit examples of the target grammar structure

Introduce important vocabulary from the Academic Word List

Take a tour of the unit

Avoid Common Mistakes

The mistakes highlighted in this section are drawn from an authentic database of over 35 million words from student essays written by non-native speakers of English and information from experienced classroom teachers.

Check out the unit tour

Data from the Real World

Concrete and useful points discovered through analysis of corpus data takes students beyond traditional information and teaches them how grammar is used in authentic situations.

See sample units

  Content  

Real-world Contexts 

 Students engage with contexts they experience in the real-world such as culture, technology, and lifestyles while learning key grammar points to make them more fluent speakers and writers.

Academic Writing

Every unit ends with an Academic Writing section. In Levels 1 through 3, this edition of Grammar and Beyond teaches students to write academically using writing cycles that span several units. In Level 4, the entire scope and sequence is organized around the types of essays students write in college, and focuses on the grammar rules, conventions, and structures needed to master them.

Find out more

 

Grammar in the Real World

Each unit presents the grammar in a realistic context using contemporary text.

Take a tour of the unit

Realistic Grammar Presentation

Grammar is presented in clear and simple charts. The grammar points presented in these charts have been tested against real-world data to ensure that they are authentic representations of actual use of English.

Click to enlarge

  Results  

Achieving grammar learning outcomes 

Check student progress throughout to make sure they are track to achieving learning outcomes.

Online Practice

Students can access both the Digital Workbook and Writing Skills Interactive using their smartphones, tablets, or computers with single log-in.

Find out more

Tracking student progress

Unit, Midterm, and Final Tests help you assess how the students are doing. You can also keep track and check each student's activities and time on task in the Cambridge One Gradebook.

Find out more

Kahoot! quizzes

Ready-made Kahoot quizzes allow students to practice grammar and recognize common mistakes, and can be used for diagnostic assessment, practice, formative assessment and review. Host a live game by sharing your screen or create a challenge for your students to play on their own.

Find out more

 

  What teachers and learners say  

  What teachers  

  and learners say  

Support

Add to wishlist

Buy

Join the online conversation

From theWorld of Better Learning

Taking stock: what have we learned from 15 months of teaching live online?

Posted by Ceri Jones

In March 2020, more than 160 countries were forced to switch to remote teaching as schools closed and com…

20 questions with… Angela from Learn English with Cambridge

Posted by Lauren Pitts

We recently recruited five new presenters for the Learn English with Cambridge YouTube channel! Here…

Visit our blog

Twitter

div#twitter-iframe{

display: none;

}

$(document).ready(function() {

// Load Twitter widget

!function (d, s, id) {

var js, fjs = d.getElementsByTagName(s)[0];

if (!d.getElementById(id)) {

js = d.createElement(s);

js.id = id;

js.src = "";

fjs.parentNode.insertBefore(js, fjs);

}

}(document, "script", "twitter-wjs");

/**

* Once iframe is loaded, only read its contents and paste the twitter feeds and user's image so it can

* be applied in our html with proper styling

*/

$("iframe#twitter-widget-0").waitUntilExists(function () {

var $tweetsDiv = $('div#tweets');

var $twitterWidget = $("iframe#twitter-widget-0");

var $tweets = $twitterWidget.contents().find('ol.timeline-TweetList li.timeline-TweetList-tweet.customisable-border');

$.each($tweets, function(key, val) {

var $anchoredTweet = $('');

var $tweet = $('');

var twitterPage = '';

var tweetID = $(val).find('.timeline-Tweet.js-tweetIdInfo').attr('data-tweet-id');

var individualTweetURL = twitterPage + '/status/' + tweetID;

var tweeterImage = $(val).find('img.Avatar').attr('src').replace('_normal.', '_bigger.');

$anchoredTweet.attr('href', individualTweetURL);

$anchoredTweet.append('');

$tweet.append($anchoredTweet);

$tweet.append('' + $(val).find('p.timeline-Tweet-text').html() + '');

$tweetsDiv.append($tweet);

if ((key + 1) >= $tweets.length) {

var $visitTwitterBtn = $('');

$visitTwitterBtn.attr('href', '');

$visitTwitterBtn.html('Visit our Twitter');

$tweet.append($visitTwitterBtn);

}

});

// This fixes the issue in Galaxy Tab 4 not displaying twitter feeds

if ($('.icon-para.small.twitter').length === 0) {

$tweet.html();

}

});

});

Product Details

Content

Components

Resources

Help & Support

Drag the USP sections below to sort them according to your preference

Insights

Content

Results

Save Order

// Update the edit link to go to the family page at /families/

var isSubject = '1';

var isPublished = '1';

var isDisabled = '';

var family = 'Grammar and Beyond 2nd Edition';

var betterLearningPath = '/us/families/grammar-and-beyond-2nd-edition';

var familycID = '163221';

var contextPath = '';

var managePagesLink = '';

var isEditMode = '';

var wishListTool = '/us/tools/packages/cambridge_core/add_remove_wishlist';

var isLoggedIn = '';

var isPublicUrl = '1';

var canPublishBetterLearning = '';

Sign In

Please sign in to access your account

Email Address

Password

Forgotten your password?

 Remain logged in to website.

Cancel

Not already registered? Create an account now.

×

$(document).ready(function() {

$("#loginPopup").validationEngine(

'attach',

{

promptPosition : "inline",

prettySelect: true,

maxErrorsPerField: 1,

usePrefix: 'dk_container_',

onValidationComplete: function(form, status) {

if (status === true) {

return true;

}

return false;

}

}

);

$("#sign_in_button").click(function() {

$("#signIn").reveal();

return false;

});

$("#sign_in_button_mobile").click(function() {

$("#signIn").reveal();

return false;

});

$('#registerFormLightbox').click(function() {

document.registerForm.submit();

});

});

var isTablet = '';

var isMobile = '';

Browse the catalogue

Academic EnglishAdult & Young AdultBusiness, Professional and VocationalCambridge English Exams & IELTSDictionariesGrammar, Vocabulary and PronunciationReadersSecondarySkillsTeacher Training, Development and ResearchTOEFL & TOEICYoung Learners

About Us

A unique approach to teaching, learning and assessing English, driven by world-class research

Cambridge Assessment English

Provides the world's leading range of qualifications in language assessment

Find a rep or bookseller

Search

$('#find-a-rep a').on('click', function() {

$('#find-a-rep').submit();

return false;

});

Searching in United States

CAMBRIDGE DICTIONARY

Search

dictionary.

Join us online

Twitter

Facebook

YouTube

Instagram

This site uses cookies to improve your experience.

Read more

Close

$('.close').click(function() {

$('.disclosure-container').slideUp();

$('#content').css("padding-top","0");

});

$('#cookieNotice').remove();

$('#content').css("padding-top","0");

Accessibility

Privacy & Legal

Our Ethics

Modern Slavery Statement

Rights & Permissions

Feedback

Media

Sitemap

© Cambridge University Press 2021

back to top

// To load Youtube API.

var tag = document.createElement('script');

var players = players || [];

var gtm = new GoogleTagManager();

var currencyCode = "USD";

var subjectName = "Adult & Young Adult";

var areaOfInterest, jobTitle, userType, clientId, userID;

tag.src = "";

var firstScriptTag = document.getElementsByTagName('script')[0];

firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

/**

* GTM Product Impressions

*/

function doListingImpression() {

var ecomm = {

"event": "impressionsLoaded",

"ecommerce": {

"currencyCode": currencyCode,

"impressions": []

}

};

window.dataLayer = window.dataLayer || [];

$('.components-listing-page > div.elt-listingPage li.productsItem').each(function (index) {

ecomm.ecommerce.impressions.push({

"name": $(this).find("a.title").text(),

"id": $(this).find("div.ean").text().replace("ISBN:", ""),

"category": subjectName,

"variant": $(this).find("div.isbn:nth-child(3):not(.publicationDate)").text().replace("CEF Level:", ""),

"position": index + 1,

"list": subjectName,

"price": parseFloat(/\d+\.\d+/g.exec($(this).find("h4.listingPricestring").text())),

"cambridgeID": userID,

"areaOfInterest": areaOfInterest,

"jobTitle": jobTitle,

"userType": userType

});

});

window.dataLayer.push(ecomm);

}

(function ($) {

"use strict";

// Tracker for global navbar clicks

$(document).on('click', '#global-nav li a:not(".location")', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'sectionClick',

'sectionName': $(this).text()

});

});

// Listener for teacher triage click from triage homepage

$(document).on('click', '#choice-teacher', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'userType',

'userType': 'Teacher'

});

});

// Listener for student triage click from triage homepage

$(document).on('click', '#choice-student', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'userType',

'userType': 'Student'

});

});

// Listener for everything triage click from triage homepage

$(document).on('click', '#choice-everything', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'userType',

'userType': 'Everything'

});

});

// Listener for social media interaction in footer

$(document).on('click', 'ul.joinUsOnline li a', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'socialInteraction',

'socialNetwork': $(this).text()

});

});

/* --------------------- Subject Page Section ------------------------*/

/**

* Listener for product title in subject page

* @url

*/

$(document).on('click', 'div.subject-listing-page div.bookDetailsWrap h2 a.title', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': $(this).text()

});

});

/**

* Listener for view product in subject page

* @url

*/

$(document).on('click', 'div.subject-listing-page div.bookCover a', function () {

var productName = $(this).find('img').attr('alt');

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': productName

});

});

/**

* Listener for book cover in subject page

* @url

*/

$(document).on('click', 'div.subject-listing-page div.callToActions span.addCartButton a', function () {

var button = $(this).text();

var productName = $(this).closest('li.productsItem').find('div.bookDetailsWrap h2 a').text();

if ('View product' === button) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': productName

});

}

});

/* --------------------- Subject Page Section End ------------------------*/

/* Product title listener under components. Families, Better Learning, and Branded Hub pages

* @url /cambridgeenglish/catalog/adult-courses/cambridge-discovery-education-interactive-readers/components/

*/

$(document).on('click', 'ponents-listing-page div.elt-listingPage div.bookDetailsWrap h2 a.title',

function () {

// e.g face2face Starter Student's Book with CD-ROM/Audio CD

var productName = $(this).text();

// e.g Adult Courses

var subject = "Adult & Young Adult";

// e.g string is ISBN: 9781139858243 get only the numeric isbn which is 9781139858243

var isbn = $.trim(

$(this).closest('div.bookDetailsWrap').find('-section div.ean').text().replace('ISBN:', '')

);

// A1 Beginner/Basic - C1 Advanced

var variant = $.trim(

$(this).closest('div.bookDetailsWrap').find('-section div.cf-level').text()

.replace('CEF Level:', '')

);

// getting all isbns from the components list

var isbns = $(this).closest('div.elt-listingPage')

.find('ul.productsList li.productsItem div.bookDetailsWrap -section div.ean').text()

.split('ISBN');

// removing all extra character in every isbn in the array

isbns = isbns.map(function (value) {

return $.trim(value.replace(':', ''));

});

// position in the components listing e.g 1

var position = isbns.indexOf(isbn);

var $price = $(this).closest('div.bookDetailsWrap').next();

var price = $price.find('div.addCartButton:visible h4.listingPricestring').text();

if (!price) {

// we have a single format

price = $price.find('h4.listingPricestring').text();

}

/* getting the price only excluding the symbol or any text

e.g ?1.14 will become 1.14 */

price = parseFloat(/\d+\.\d+/g.exec(price));

price = price > 0 ? price : '';

var enhancedEcom = new EnhancedEcom(

currencyCode,

subject,

productName,

isbn,

position,

price,

subjectName,

variant,

userID,

areaOfInterest,

jobTitle,

userType,

clientId

);

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(enhancedEcom.productClick());

}

);

/* Book cover listener for Products under components. Families, Better Learning, and Branded Hub pages

* @url /cambridgeenglish/catalog/adult-courses/cambridge-discovery-education-interactive-readers/components/

*/

$(document).on('click', 'ponents-listing-page div.elt-listingPage div.bookCover a', function () {

// e.g face2face Starter Student's Book with CD-ROM/Audio CD

var productName = $(this).parent().next().find('a').text();

// e.g Adult Courses

var subject = "Adult & Young Adult";

// e.g string is ISBN: 9781139858243 get only the numeric isbn which is 9781139858243

var isbn = $.trim(

$(this).closest('div.bookCover').next().find('-section div.ean').text().replace('ISBN:', '')

);

// A1 Beginner/Basic - C1 Advanced

var variant = $.trim(

$(this).closest('div.bookCover').next().find('-section div.cf-level').text()

.replace('CEF Level:', '')

);

// getting all isbns from the components list

var isbns = $(this).closest('div.elt-listingPage')

.find('ul.productsList li.productsItem div.bookDetailsWrap -section div.ean').text()

.split('ISBN');

// removing all extra character in every isbn in the array

isbns = isbns.map(function (value) {

return $.trim(value.replace(':', ''));

});

// position in the components listing e.g 1

var position = isbns.indexOf(isbn);

var $price = $(this).closest('div.bookCover').next().next();

var price = $price.find('div.addCartButton:visible h4.listingPricestring').text();

if (!price) {

// we have a single format

price = $price.find('h4.listingPricestring').text();

}

/* getting the price only excluding the symbol or any text

e.g ?1.14 will become 1.14 */

price = parseFloat(/\d+\.\d+/g.exec(price));

price = price > 0 ? price : '';

var enhancedEcom = new EnhancedEcom(

currencyCode,

subject,

productName,

isbn,

position,

price,

subjectName,

variant,

userID,

areaOfInterest,

jobTitle,

userType,

clientId

);

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(enhancedEcom.productClick());

});

/* View Product listener for Products under components. Families, Better Learning, and Branded Hub pages

* @url /cambridgeenglish/catalog/adult-courses/cambridge-discovery-education-interactive-readers/components/

*/

$(document).on('click', 'ponents-listing-page div.elt-listingPage div.callToActions a.button.blue.buyProduct',

function () {

if ($(this).text() == 'View product') {

// e.g face2face Starter Student's Book with CD-ROM/Audio CD

var productName = $(this).closest('.callToActions').prev().find('a').text();

// e.g Adult Courses

var subject = "Adult & Young Adult";

// e.g string is ISBN: 9781139858243 get only the numeric isbn which is 9781139858243

var isbn = $.trim(

$(this).closest('li.productsItem').find('div.bookDetailsWrap -section div.ean')

.text().replace('ISBN:', '')

);

// A1 Beginner/Basic - C1 Advanced

var variant = $.trim(

$(this).closest('li.productsItem').find('div.bookDetailsWra -section div.cf-level')

.text().replace('CEF Level:', '')

);

// getting all isbns from the components list

var isbns = $(this).closest('div.elt-listingPage')

.find('ul.productsList li.productsItem div.bookDetailsWrap -section div.ean').text()

.split('ISBN');

// removing all extra character in every isbn in the array

isbns = isbns.map(function (value) {

return $.trim(value.replace(':', ''));

});

// position in the components listing e.g 1

var position = isbns.indexOf(isbn);

// not available

var price;

var enhancedEcom = new EnhancedEcom(

currencyCode,

subject,

productName,

isbn,

position,

price,

subjectName,

variant,

userID,

areaOfInterest,

jobTitle,

userType,

clientId

);

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(enhancedEcom.productClick());

}

}

);

/* --------------------- Search result Page Section ------------------------*/

/**

* Listener for product title in search result page

* @url

*/

$(document).on('click', 'div.elt-search-result-listing div.bookDetailsWrap h2 a.title', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': $(this).text()

});

});

/**

* Listener for view product in search result page

* @url

*/

$(document).on('click', 'div.elt-search-result-listing div.bookCover a', function () {

var productName = $(this).find('img').attr('alt');

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': productName

});

});

/**

* Listener for book cover in search result page

* @url

*/

$(document).on('click', 'div.elt-search-result-listing div.callToActions span.addCartButton a', function () {

var button = $(this).text();

var productName = $(this).closest('li.productsItem').find('div.bookDetailsWrap h2 a').text();

if ('View product' === button) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': productName

});

}

});

/* --------------------- Search result Page Section End ------------------------*/

// Tag if user has just logged in

// Tag if user attempted to login with incorrect credentials (invalid email and/or password)

// Tag if user has newly registered

// Tag if user attempted to register, but failed on server side

if (window.location.pathname === '/register/do_register' && $('.alert-box.alert').length > 0) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'accountRegistration',

'accountStatus': 'Unsuccessful Registration',

'registrationErrorCode': 'Incomplete fields submitted',

'areaOfInterest': $('#dk_container_select-Primary-area-of-interest .dk_label').text(),

'jobTitle': $('#dk_container_select-Job-title .dk_label').text()

});

}

// Tag on submitting register form with errors. Timeout needed to give time for validation to fire

$('form#register').submit(function () {

setTimeout(

function () {

if ($('.formErrorContent').length > 0) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'accountRegistration',

'accountStatus': 'Unsuccessful Registration',

'registrationErrorCode': 'Incomplete fields submitted',

'areaOfInterest': $('#dk_container_select-Primary-area-of-interest .dk_label').text(),

'jobTitle': $('#dk_container_select-Job-title .dk_label').text()

});

}

}, 600);

});

// Tag when searching for a rep or bookseller in ELT footer

$('form#find-a-rep').submit(function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'storeLocator'

});

});

// Tag for "Share this page"

$(document).on('click', '.shareInner li a', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'productSocialShares',

'socialNetwork': $(this).text(),

'product': document.title

});

});

// GTM tag for contact us via email

$(document).on('click', 'table.contact-info a.online', function () {

if ($(this).attr('href').indexOf('mailto:') !== -1) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'contactUs',

'contactType': 'Mail To'

});

}

});

// GTM tag for contact us form being submitted

$('form#contact-form').submit(function () {

setTimeout(function () {

if ($('.formErrorContent').length === 0) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'contactUs',

'contactType': 'Message'

});

}

}, 600);

});

// Track resource downloads

$(document).on('click', '#familyResourcesTable a', function () {

var resourceName = $(this).closest('.resourceHolder').find('.resourceName').text();

window.dataLayer = window.dataLayer || [];

switch ($(this).attr('data-reveal-id')) {

case undefined:

window.dataLayer.push({

'cambridgeID': userID,

'event': 'resourceAccess',

'resourceAccessType': 'Download',

'resourceName': resourceName

});

break;

case 'requestTeacherAccess':

window.dataLayer.push({

'cambridgeID': userID,

'event': 'resourceAccess',

'resourceAccessType': 'Request access',

'resourceName': resourceName

});

break;

case 'signIn':

window.dataLayer.push({

'cambridgeID': userID,

'event': 'resourceAccess',

'resourceAccessType': 'Sign in',

'resourceName': resourceName

});

break;

}

});

// Track left and right arrow for carousel

$(document).on('click', '.product-area .slider-nav > span', function () {

var carouselData = {

'cambridgeID': userID,

'event': 'carouselInteraction'

};

if ($(this).closest('div.orbit-wrapper').find('div.products-slider').hasClass('eltProductHighlights')) {

carouselData['carouselName'] = 'Product Highlights';

}

if ($(this).closest('div.orbit-wrapper').find('div.products-slider').hasClass('eventsHighlight')) {

carouselData['carouselName'] = 'Events Highlight';

}

if ($(this).closest('div.orbit-wrapper').find('div.products-slider').hasClass('direct-links-slider')) {

carouselData['carouselName'] = 'Links Highlights';

}

switch ($(this).attr('class')) {

case 'right':

carouselData['carousel'] = 'Right Button';

break;

case 'left':

carouselData['carousel'] = 'Left Button';

break;

}

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(carouselData);

});

// e.g /br/search will be /search

var pathName = document.location.pathname.replace(/^\/[a-z]{2}\//, '');

// Listener for search results refinement only

if (pathName === 'search' || pathName === 'search/' || pathName === '/search' || pathName === '/search/') {

$(document).on('click', 'div.refinePanel div.refineChunk div.optionsHidden ul li input[type=checkbox]',

function () {

// getting the label. e.g The string is "American English (136)", return "American English"

var facet = $.trim($(this).next('label').text().split('(', 1));

var tickBoxInteraction = $(this).prop('checked') ? 'ticked' : 'unticked';

var facetType = $.trim($(this).closest('div.optionsHidden').prev().text());

// e.g ENGLISH TYPE | FORMAT | LANGUAGE LEVEL

var refinedBy = facetType;

var englishType = (facetType === 'ENGLISH TYPE') ? facet : '';

var format = (facetType === 'FORMAT') ? facet : '';

var exam = (facetType === 'EXAM') ? facet : '';

var languageLevel = (facetType === 'LANGUAGE LEVEL') ? facet : '';

if (facet === 'Show all') {

// e.g Show all Adult courses

refinedBy = facet + ' ' + facetType;

} else if (englishType == '' && format == '' && exam == '' && languageLevel == '') {

// e.g Adult Education

refinedBy = facet;

}

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'searchResultsRefinement',

'refineBy': refinedBy,

'englishType': englishType,

'format': format,

'exam': exam,

'languageLevel': languageLevel,

'tickBoxInteraction': tickBoxInteraction

});

}

);

}

// Track download unit for better learning and branded hub pages

$(document).on('click', '#sample-popup a.needs-login', function () {

if ($.trim($(this).text()) === "Download unit") {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'freeSamplesDownload'

});

}

});

// Track Triage drop-down changes

$(document).on('change', '#teacher-select', function () {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'userType',

'userType': $(this).val()

});

});

// Listener for family resources course component refinement

// e.g Course Level, Course component, unit, and lesson

$(document).on(

'click',

'div#drillDownFacets div.refineChunk div.facetOptionsHolder ul.facetOptions li label.lblFilter',

function () {

// e.g the string is "Level 1 (136)", return "Level 1"

var filterBy = $.trim($(this).text().split('(', 1));

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'componentFilter',

'courseComponent': filterBy

});

}

);

// Listener for refine results in product's resources page

$(document).on('change', '#resourceAttributes input.chkFacet', function () {

if ($(this).is(':checked')) {

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'refineResults',

'facetKey': $(this).closest('.refineChunk').find('h3').text(),

'facetValue': $(this).val()

});

}

});

$(window).load(function () {

// Add ELT videos to current players list

$.each(gtm.getYoutubePlayers(), function (key, video) {

players.push(video);

});

if (typeof players === 'object') {

gtm.addYoutubeTag(players);

}

});

/* --------------------- product highlights block ------------------------*/

/**

* Cover/jacket/asset listener for book of product highlights block.

* @url gb/cambridgeenglish/?remember=yes&content=everything

*/

$(document).on(

'click',

'div.orbit-wrapper div.products-slider div.orbit-slide div.product-item div.product-inner a.book-link',

function () {

var productName = $.trim($(this).find('h5').text());

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': productName

});

}

);

/**

* View product listener for book of product highlights block.

* @url gb/cambridgeenglish/?remember=yes&content=everything

*/

$(document).on(

'click',

'div.orbit-wrapper div.products-slider div.orbit-slide div.product-item div.product-inner div.book-hidden \

a.button',

function () {

var button = $.trim($(this).text());

var productName = '';

// GTM for View product button only

if (button === 'View product') {

productName = $.trim($(this).closest('div.product-inner').find('h5').text());

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeId': userID,

'event': 'productClick',

'product': productName

});

}

}

);

/* -------------------- product highlights block end --------------------*/

/* Listener for better learning social media.

* e.g Visit our blog, Visit our twitter, and Visit our Youtube channel

*/

$(document).on(

'click',

'div.wrapBetterLearning div.wrapperBlog a.button, \

div.wrapBetterLearning div.twitter a.button, \

div.wrapBetterLearning div.video-gallery a.button',

function () {

var socialNetwork = $.trim($(this).text());

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'socialInteraction',

'socialNetwork': socialNetwork

});

}

);

/*

* Listener for homepage social media

* e.g Follow us on Twitter, Visit us on Facebook, Visit us on YouTube

*/

$(document).on(

'click',

'div.circles div.twitter div.circle-content a.arrow, \

div.circles div.facebook div.circle-content a.arrow, \

div.circles div.youtube div.circle-content a.arrow',

function () {

var socialNetwork = $.trim($(this).text());

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'socialInteraction',

'socialNetwork': socialNetwork

});

}

);

/* -----------------------------Also in this subject section ----------------------------------- */

/*

* Listener for book cover/jacket/asset in Also in this subject section.

* @url cambridgeenglish/catalog/secondary/cambridge-english-readers/apollos-gold-level-2

*/

$(document).on('click', 'ul#also-in-this-group li.productsItem div.bookCover a', function () {

// e.g Gone! Starter/Beginner

var productName = $.trim($(this).find('img').attr('alt') || '');

// e.g secondary

var subject = "Related Products";

// Reference to lookup of data in link

var $mainLink = $(this).closest('.bookCover').next().find('h3 a');

// eg: 9781107619418

var isbn = $.trim($mainLink.attr('data-isbn'));

// e.g A1 Beginner/Basic - C1 Advanced

var variant = $.trim($(this).closest('div.bookCover').next().find('div.cf-level').text()

.replace('CEF Level:', ''));

var position = 1;

// eg: 20.00

var price = $.trim($mainLink.attr('data-price'));

var enhancedEcom = new EnhancedEcom(

currencyCode,

subject,

productName,

isbn,

position,

price,

subjectName,

variant,

userID,

areaOfInterest,

jobTitle,

userType,

clientId

);

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(enhancedEcom.productClick());

});

/*

* Listener for product name in Also in this subject section.

* @url cambridgeenglish/catalog/secondary/cambridge-english-readers/apollos-gold-level-2

*/

$(document).on('click', 'ul#also-in-this-group li.productsItem div.bookDetailsWrap h3 span a', function () {

/*

* Title page product

*/

// Apollo's Gold Level 2

var productName = $.trim($(this).text());

// e.g Adult Courses

var subject = "Related Products";

// eg: 9781107619418

var isbn = $.trim($(this).attr('data-isbn'));

// A1 Beginner/Basic - C1 Advanced

var variant = $.trim($(this).closest('div.bookDetailsWrap').find('div.cf-level').text()

.replace('CEF Level:', ''));

var position = 1;

// eg: 20.00

var price = $.trim($(this).attr('data-price'));

var enhancedEcom = new EnhancedEcom(

currencyCode,

subject,

productName,

isbn,

position,

price,

subjectName,

variant,

userID,

areaOfInterest,

jobTitle,

userType,

clientId

);

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(enhancedEcom.productClick());

});

/*

* Listener for view product in Also in this subject section.

* @url cambridgeenglish/catalog/secondary/cambridge-english-readers/apollos-gold-level-2

*/

$(document).on('click', 'ul#also-in-this-group li.productsItem div.bookDetailsWrap a.button', function () {

// e.g London Level 2 Elementary

var productName = $.trim($(this).next('h3').find('span a').text());

// e.g Adult Courses

var subject = "Related Products";

// Reference to lookup of data in link

var $mainLink = $(this).next().find('a');

// eg: 9781107619418

var isbn = $.trim($mainLink.attr('data-isbn'));

// e.g A1 Beginner/Basic - C1 Advanced

var variant = $.trim($(this).closest('div.bookDetailsWrap').find('div.cf-level').text()

.replace('CEF Level:', ''));

var position = 1;

// eg: 20.00

var price = $.trim($mainLink.attr('data-isbn'));

var enhancedEcom = new EnhancedEcom(

currencyCode,

subject,

productName,

isbn,

position,

price,

subjectName,

variant,

userID,

areaOfInterest,

jobTitle,

userType,

clientId

);

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(enhancedEcom.productClick());

});

/* -----------------------------Also in this subject end ---------------------------- */

/**

* Product name listener in Wishlist page

* @url wishlist//cambridgeenglish/

* @url profile/wishlist/

*/

$(document).on('click', 'div.wishlist ul.productsList li.productsItem div.bookDetailsWrap h2 a', function () {

// return product name only. Exclude description

var productName = $.trim($(this).text());

productName = productName.split('\n', 1);

productName = (productName[0]) ? productName[0] : '';

// Unavailable

var subject = $(this).closest('div.bookDetailsWrap').attr('data-subject-name');

// e.g string is asia/c5catalogue/AddToBasket.asp?isbn=9781107465947&orderId=&locale=&discount

// get only the numeric isbn which is 9781107465947

var isbn = $(this).closest('div.bookDetailsWrap').next().find('a.addToCartBtn').attr('data-isbn');

var variant = $(this).closest('div.bookDetailsWrap').attr('data-cef-lvl');

// Unavailable

var position;

var price = $(this).closest('div.bookDetailsWrap').next().find('h2').text();

/* getting the price only excluding the symbol or any text

e.g ?1.14 will become 1.14 */

price = parseFloat(/\d+\.\d+/g.exec(price));

price = price > 0 ? price : '';

var enhancedEcom = new EnhancedEcom(

currencyCode,

subject,

productName,

isbn,

position,

price,

subject,

variant,

userID,

areaOfInterest,

jobTitle,

userType,

clientId

);

window.dataLayer = window.dataLayer || [];

window.dataLayer.push(enhancedEcom.productClick());

});

// Homepage's hero banner carousel

$(document).on('click', '.homepageHero .flex-direction-nav li a', function () {

switch ($(this).attr('class')) {

case 'flex-prev':

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'carouselInteraction',

'carouselName': 'Hero Banner',

'carousel': 'Left Button'

});

break;

case 'flex-next':

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'carouselInteraction',

'carouselName': 'Hero Banner',

'carousel': 'Right Button'

});

break;

}

});

// From the blog carousel

$(document).on(

'click',

'.homepage-sidebar > .blog-slider .flex-direction-nav li a',

function () {

window.dataLayer = window.dataLayer || [];

switch ($(this).attr('class')) {

case 'flex-prev':

window.dataLayer.push({

'cambridgeID': userID,

'event': 'carouselInteraction',

'carouselName': 'Blog',

'carousel': 'Left Button'

});

break;

case 'flex-next':

window.dataLayer.push({

'cambridgeID': userID,

'event': 'carouselInteraction',

'carouselName': 'Blog',

'carousel': 'Right Button'

});

break;

}

});

/**

* Listener for latest news carousel in homepage

* @url cambridgeenglish/?remember=yes&content=everything

*/

$(document).on('click', 'div.homepage-news-section div.news-slider ul.flex-direction-nav li a', function () {

var action = $(this).attr('class');

var carousel = 'Right Button';

if (action === 'flex-prev') {

carousel = 'Left Button';

}

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'carouselInteraction',

'carouselName': 'Latest News',

'carousel': carousel

});

});

/**

* Listener for upcoming events in homepage

* @url cambridgeenglish/?remember=yes&content=everything

*/

$(document).on('click', 'div.homepage-sidebar div.event-slider ul.flex-direction-nav li a', function () {

var action = $(this).attr('class');

var carousel = 'Right Button';

if (action === 'flex-prev') {

carousel = 'Left Button';

}

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

'cambridgeID': userID,

'event': 'carouselInteraction',

'carouselName': 'Upcoming Events',

'carousel': carousel

});

});

// Enhanced Ecommerce: product details when viewing component pages

})(jQuery);

var LOCALE = "en_US";

var CURRENT_THEME = "Learning";

var LEARNING_THEME_HANDLE = "Learning";

var data = {"GET":null,"hHandle":"global_navbar_ccp","pHandle":"cambridge_themes","action":"renderLocaleRevealForm","locale":"en_US","site":"CE"};

(function () {

var euCountryCodes = [

'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR',

'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL',

'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'IS', 'LI', 'NO', 'CH'

];

if (window.CURRENT_SITE === 'corporate') {

return;

}

var msg = '';

var shouldDisplay = false;

var currDate = new Date();

if (window.VISTA_SERVICE_REGION === 'E' && Locale.countryCode !== 'JP') {

msg = 'Online ordering is currently unavailable. For all order enquiries please contact Customer Services at cs_asia@';

shouldDisplay = true;

}

if (shouldDisplay) {

var $html = $('', { id: 'ccm-headerAnnounce' })

.append(

$('', { class: 'disclosure-container' })

.append(

$('', { class: 'disclosure-content row' })

.append($('', { style: 'text-align:center; color:black; font-size:14px;' }).html(msg))

)

);

$('body > div#content').before($html);

}

})();

$(function () {

if (window.location.href.indexOf('/academic/subjects') >= 0) {

$.each($('.relatedItemsWrap .relatedItem a[href^="//journals."]'), function () {

$(this).attr('href', 'http://' + this.href.substring(this.href.indexOf('journals')));

});

}

});

var eduUrlPattern = new RegExp('^\/[a-z]{2}\/education');

if (!CWS_ECOMMERCE_ENABLED

&& !eduUrlPattern.test(window.location.pathname)

&& $('.addToCartBtn').length > 0) {

$(function () {

$('.addToCartBtn').removeClass('addToCartBtn').addClass('addToCartBtnPatch');

if ((VISTA_SERVICE_REGION === 'A' && IS_KK_AUS === '0') || (VISTA_SERVICE_REGION === 'E' && IS_KK_ASIA === '0')) {

if (IS_KK_ACS_ENABLED > 0) {

getVyreServicePatch();

}

} else {

getKonakartServicePatch();

}

function getKonakartServicePatch() {

jQuery('.addToCartBtnPatch').live('click', addToCartEventPatch);

// send request to cart WS

jQuery.ajax({

url: KK_MINI_CART,

dataType: 'xml',

success: mini_cart_successful_patch,

error: function () {

jQuery('#miniCartDetail .qty').show();

jQuery('#cartQty').html('(' + jQuery('#qtyValue').html() + ')');

},

//

cache: false

});

}

function getVyreServicePatch() {

// GAW-2570

if (jQuery('.addToCartBtnPatch.konakartLink').length > 0) {

jQuery('.addToCartBtnPatch.konakartLink').live('click', addToCartEventPatch);

}

$.ajax({

url: "/tools/packages/cambridge_themes/miniCart",

data: {

source: "Academic_v1"

},

success: function (data) {

if ($('#qtyValue').html() == 0) {

jQuery('#cartQty').html('');

var cartOpt = {

url: KK_MINI_CART,

dataType: 'xml',

success: mini_cart_successful_patch,

error: function () {

jQuery('#miniCartDetail .qty').show();

jQuery('#cartQty').html('(' + jQuery('#qtyValue').html() + ')');

},

//

cache: false

};

// send request to cart WS

jQuery.ajax(cartOpt);

jQuery("a.viewCart").attr("href", VYRE_BASKET);

jQuery("a.academicCheckout").attr("href", VYRE_BASKET);

var minicartDetail = 'You have 0 items in your cart.' +

'' +

'' +

'Subtotal: 0.0' +

'' +

'' +

'View cart (0)' +

'Checkout' +

'' +

'';

$("#miniCartDetail").html(minicartDetail);

} else {

hasAsp = true;

}

}

});

}

});

var errorCallBackPatch = function () {

// hide the view cart

if (cartItemCount < 1) {

jQuery('.viewCart').hide();

}

jQuery('#itemAddedMessage').text("There was a problem getting your cart information.");

jQuery('#itemAddedModal').reveal();

};

var completeCallBackPatch = function () {

alreadyClicked = false;

countryChange = true;

jQuery('body').css('cursor', 'auto');

};

var addToCartEventPatch = function (event) {

event.preventDefault();

// check first if the user hasn't clicked on the link to prevent multiple

// AJAX requests

if (alreadyClicked == false) {

alreadyClicked = true;

// make the body to show wait cursor while processing

jQuery('body').css('cursor', 'wait');

addToCartPatch(jQuery(this).data());

}

};

/**

* upon success of calling add to cart WS

* @param data xml returned data from ecom

* @param textStatus test status

* @param isbn string added isbn

*/

var add_to_cart_successful_patch = function (data, textStatus, isbn) {

var $cartData = jQuery(data);

// hack to get HTML content in XML

var cartErrorMessage = $cartData.find('errorMessage').text().trim();

var cartInfoMessage = $cartData.find('infoMessage').text().trim();

// get cart lines in the cart WS

var cartLines = processCartDataPatch(data);

refresh_cart_patch(cartLines);

// check first if we have error message then display it instead of item added message

if (cartErrorMessage !== '') {

jQuery('#addToCartCustom h4').html(cartErrorMessage);

jQuery('#addToCartCustom h4').css('text-transform', 'none');

jQuery('#addToCartCustom').reveal();

} else if (cartInfoMessage !== '') {

jQuery('#addToCartCustom h4').html(cartInfoMessage);

jQuery('#addToCartCustom h4').css('text-transform', 'none');

jQuery('#addToCartCustom').reveal();

} else {

// hide the view cart

if (cartItemCount < 1) {

jQuery('.viewCart').hide();

}

jQuery('#itemAddedMessage').text("Item added to your cart!");

jQuery('#itemAddedModal').reveal();

googleTagManagerPatch(isbn);

}

};

// upon success of calling cart WS

var mini_cart_successful_patch = function (data, textStatus) {

// get cart lines in the cart WS

var cartLines = processCartDataPatch(data);

refresh_cart_patch(cartLines);

};

/**

* Convert data collected from the cart WS and traverse and store it in array

* @param {XML} xml Expected XML cart data

* @return {Array} Array list of lines (products) in the cart

*/

var processCartDataPatch = function (xml) {

// reset

cartItemCount = 0;

currency = '$';

subTotal = 0;

var $cartData = jQuery(xml);

var cartLines = [];

currency = $cartData.find('symbol').text();

subTotal = $cartData.find('totalValueOverride').text();

// traverse the orderline

$cartData.find('orderLines').find('orderLine').each(function () {

var data = [];

data['availabilityLegend'] = getXMLValuePatch("availabilityLegend", this);

cartItemCount += getXMLValuePatch('quantity', this) ? parseInt(getXMLValuePatch('quantity', this)) : 1;

data['title'] = getXMLValuePatch('title', this);

data['author'] = getXMLValuePatch('author', this);

var price = getXMLValuePatch('publishedPriceOverride', this);

data['price'] = price.length > 0 ? price : getXMLValuePatch('originalValue', this);

data['price'] = data['price'].replace(',', '');

data['discountPrice'] = getXMLValuePatch('publishedPriceOverride', this);

data['discountPrice'] = data['discountPrice'].replace(',', '');

data['ean'] = getXMLValuePatch('ean', this);

data['quantity'] = getXMLValuePatch('quantity', this).replace(',', '');

data['format'] = getXMLValuePatch('format', this);

var volumeNumber = getXMLValuePatch('volumeNumber', this);

data['volume'] = volumeNumber.length > 0 && volumeNumber != '0' ? 'Volume ' + volumeNumber : '';

var partNumber = getXMLValuePatch('partNumber', this);

data['part'] = partNumber.length > 0 && partNumber != '0' ? 'Part ' + partNumber : '';

var edition = getXMLValuePatch('edition', this);

data['edition'] = edition.length > 0 ? edition + ' Edition' : '';

var lastModified = new Date(getXMLValuePatch('lastModified', this));

data['lastModified'] = lastModified.getTime();

cartLines.push(data);

});

cartLines.sort(function (a, b) {

return a['lastModified'] - b['lastModified'];

});

return cartLines;

};

var getXMLValuePatch = function (key, container) {

return jQuery(container).find(key).text();

};

var refresh_cart_patch = function (cartLines) {

if (cartLines.length > 0) {

var $miniCartDetail = jQuery('#miniCartDetail');

var $learningQty = jQuery('p.qty #qtyString', $miniCartDetail);

var $miniCartItems = jQuery('#miniCartItems');

var $subTotal = jQuery('#subtotalValue');

var cartItemString = '' + cartItemCount + '' +

(cartItemCount == 0 || cartItemCount > 1 ? ' items' : ' item');

$learningQty.html(cartItemString);

var cartItems = '';

var itemDisplayCount = 1;

for (var i = 0; i < cartLines.length; i++) {

cartItems += '' + cartLines[i]['title'] + '';

cartItems += '' + cartLines[i]['volume'] + ' ' + cartLines[i]['part'] + ' ' + cartLines[i]['edition'] + '' + ' ' + cartLines[i]['author'] + '';

cartItems += '' + cartLines[i]['format'] + '';

cartItems += '' + cartLines[i]['availabilityLegend'] + ' | Qty: ' + cartLines[i]['quantity'] + ' | Price: ' + currency + (parseFloat(cartLines[i]['quantity']) * parseFloat(cartLines[i]['price'])).toFixed(2) + '';

itemDisplayCount++;

if (itemDisplayCount > 3 && CURRENT_SITE === 'cambridgeenglish') {

break;

}

}

$miniCartItems.html(cartItems);

$subTotal.html(currency + subTotal);

jQuery('#mobileCartQty').html('(' + jQuery('#qtyValue').html() + ')');

jQuery('.withItems').show();

}

else {

if (jQuery('#miniCartItems > h4').length == 0) {

jQuery('.withItems').hide();

}

jQuery('#miniCartDetail .qty').show();

}

jQuery('#cartQty').html('(' + jQuery('#qtyValue').html() + ')');

};

var addToCartPatch = function (data) {

var params = {

isbn: isbn = typeof data.isbn !== 'undefined' ? data.isbn : '',

locale: typeof data.country !== 'undefined' ? data.country : '',

page: typeof data.page !== 'undefined' ? data.page : '',

discountCode: typeof data.discountcode !== 'undefined' ? data.discountcode : ''

};

if (params.page === "schools") {

params['institutiononly'] = typeof data.institutiononly !== 'undefined' ? data.institutiononly : 0;

params['qty'] = typeof data.qty !== 'undefined' ? data.qty : '';

}

var urlTarget = location.protocol + "//" + location.host

+ "/wm-ecommerce-web/" + params.page + "/addtocart?" + $.param(params);

jQuery.ajax({

url: urlTarget,

dataType: 'xml',

success: function (data, textStatus) {

add_to_cart_successful_patch(data, textStatus, isbn)

},

error: errorCallBackPatch,

complete: completeCallBackPatch,

cache: false

});

};

/**

* firing google tag manager after adding to cart

* the try catch block will take care of the logic for firing GTM if applicable, which is for ELT ATM.

* @param isbn string

*/

function googleTagManagerPatch(isbn) {

try {

var gtm = new GoogleTagManager();

if ($.isFunction(gtm.addToCart)) {

$.post(

'/tools/packages/cambridge_core/titleService',

{"isbn": isbn, "data": "gtm_data"},

function (data, status) {

gtm.addToCart(data);

}

);

}

} catch (err) {

// Google Tag Manager is not loaded.

return;

}

}

}

$(window).on("load", function () {

$("a[href*='/elt/blog'], a[href*='/core']").each(function () {

var href = $(this).attr("href");

var urlSlug = href.split('/');

if (urlSlug[3] && urlSlug[3].length === 2) {

urlSlug.splice(0, 4);

href = '/' + urlSlug.join('/');

}

var startsWithEltBlog = new RegExp("^\/elt\/blog");

if (startsWithEltBlog.test(href)) {

href = CCM_BASE_URL + href;

href = href.replace('https://', 'http://');

}

$(this).attr("href", href);

});

if (CCM_BASE_URL.includes('//admin')) {

$("#global-nav a[href*='']").each(function () {

var href = $(this).attr("href");

href = href.replace('https://', 'http://');

href = href.replace('//', '//admin.');

$(this).attr("href", href);

});

}

});

if (window.location.href.indexOf('/academic/conferences') >= 0) {

$('.conferenceWrap').find('.seven.columns').first().addClass('twelve').removeClass('seven');

$('.conferenceWrap m-image-block').css('margin', 'auto');

$(".conferenceWrap .conferenceDetails").insertAfter('.row.conferenceWrap .columns.twelve h1');

$('.conferenceWrap .conferenceDetails').css('float', 'left');

$('.conferenceWrap .conferenceDetails').css('border', '0');

$('.conferenceWrap .conferenceDetails').css('padding', '10px 0 10px 0');

}

if (window.location.pathname === '/cart' ||

window.location.pathname === '/checkout/confirm' ||

window.location.pathname === '/checkout/vista_confirm') {

$(".item-quantity input.qty").on('keypress', function (e) {

if (!$.isNumeric(e.key) && e.key !== 'Enter') {

return false;

}

});

}

if (window.location.href.indexOf('/cambridgeenglish/better-learning-insights') >= 0 ||

window.location.href.indexOf('/cambridgeenglish/better-learning-insights/pedagogy') >= 0 ||

window.location.href.indexOf('/cambridgeenglish/better-learning-insights/corpus') >= 0 ||

window.location.href.indexOf('/cambridgeenglish/better-learning-insights/cambridge-english-curriculum') >= 0 ||

window.location.href.indexOf('/cambridgeenglish/better-learning-insights/cambridgelifecompetenciesframework') >= 0 ||

window.location.href.indexOf('/cambridgeenglish/better-learning-content') >= 0 ||

window.location.href.indexOf('/cambridgeenglish/better-learning-results') >= 0) {

$(document).ready(function() {

$('.fancybox-media').removeAttr('data-lity');

});

}

$('#ccm-headerAnnounce .disclosure-content').css('width', '100%');

$(document).ready(function() {

$('.request-esample').on('click',function(){

var esampleLink = $('#esample-link').val();

$('#dynamicPageUrl').attr('value',esampleLink);

});

$('.sign-in-to-review').click(function(){

dynamicPageUrl = $('#dynamicPageUrl').val();

if(dynamicPageUrl)

{

$('#dynamicPageUrl').attr('value',dynamicPageUrl + '#user_reviews');

}

});

});

$("#teacher-select").dropkick({

change: function(value, label) {

window.location ='?content=' + value;

}

});

$(document).ready(function() {

$('#sign_in_button').click(function() {

// WMPCEUSUK-1951. Fix redirection when signing in from pages with ajax pagination

$('#dynamicPageUrl').val(window.location.pathname + window.location.search);

$('#redirectUrl').val(window.location.pathname + window.location.search);

});

$('#homepageSlider').flexslider();

$('.flexslider').flexslider();

$('.post-triage').flexslider({

slideshow: true, //Boolean: Animate slider automatically

slideshowSpeed: 6000, //Integer: Set the speed of the slideshow cycling, in milliseconds

animationSpeed: 600,

animation: 'slide',

});

$('.news-slider').flexslider();

$('.event-slider').flexslider();

$('.blog-slider').flexslider();

});

.gray-bg {

-webkit-border-radius: 3px;

-moz-border-radius: 3px;

border-radius: 3px;

width: inherit;

height: inherit;

float: left;

z-index: 2;

opacity: 0.5;

background-color: #aaa;

}

// hero slider

$('.hubslide').flexslider({

slideshow: true, //Boolean: Animate slider automatically

slideshowSpeed: 6000, //Integer: Set the speed of the slideshow cycling, in milliseconds

animationSpeed: 600,

animation: 'slide',

before: function() { // pause youtube on slide change

if(typeof players !== 'undefined') {

for (var i = 0; i < players.length; i++) {

if(typeof players[i].pauseVideo === 'function' && players[i].getPlayerState() === YT.PlayerState.PLAYING) {

players[i].pauseVideo();

}

}

}

}

});

$(document).on('touchstart', '.flex-next', function(e) {

$(this).before("");

});

$(document).on('touchend', '.flex-next', function(e) {

$(this).prev().remove();

});

$(document).on('touchstart', '.flex-prev', function(e) {

$(this).before("");

});

$(document).on('touchend', '.flex-prev', function(e) {

$(this).prev().remove();

});

//video play button

$('.large-play-button').on('click',function(){

var $this = $(this);

var video = $(this).data('video');

$this.siblings('iframe').attr('src',video +'?autoplay=1').show();

$this.hide().siblings('img').hide().siblings('.caption').hide();

return false;

});

$('.sample-link').on('click',function(){

$('#sample-popup').fadeToggle();

return false;

});

$(document).on('mouseup', function(e) {

if ($('#sample-popup').is(':visible')) {

var container = $('#sample-popup');

if (!container.is(e.target) // if the target of the click isn't the container...

&& container.has(e.target).length === 0) // ... nor a descendant of the container

{

container.fadeToggle();

}

}

return false;

});

$('#dictionaries-search').click(function(){CDOSearch();});

$('#dictionaries').keydown(function (e){

if(e.keyCode == 13){

CDOSearch();

}

});

function CDOSearch() {

var searchTerm = $('input#dictionaries').val();

if(searchTerm) {

var searchURL = ''+searchTerm;

window.open(searchURL);

}

}

var footerLink = false;

$('.countryChooser').on('click', function() {

var id = $(this).attr('id');

if (id === 'footerCountryChooser') {

footerLink = true;

} else {

footerLink = false;

}

});

Thank you for your feedback which will help us improve our service.

If you requested a response, we will make sure to get back to you shortly.

×

Please fill in the required fields in your feedback submission.

×

$(document).ready(function() {

$('a[href*="youtu.be"]').nivoLightbox({

afterShowLightbox: function () {

var iFrame = $('.nivo-lightbox-content > iframe');

var iFrameSrc = iFrame.attr('src');

var iFrameId = 'yt-gtm-player-' + iFrameSrc.substring(iFrameSrc.lastIndexOf('/') + 1);

var gtm = new GoogleTagManager();

iFrame.attr('src', iFrameSrc + '?enablejsapi=1');

iFrame.attr('id', iFrameId);

gtm.addYoutubeTag({0: new YT.Player(iFrameId)});

}

});

if (false) {

$('a#autoPlayVideo').click();

}

});

$(document).ready(function () {

// hide show all branded hub

$('#branded-hubs-page').remove();

});

2 ................
................