var subscriptionPage = "/subscribe"; var homepageVersion = 10144; var isFeedbackOn = false; function showFeedback(variation) { if(!isFeedbackOn) { isFeedbackOn = true; var marginLeft = (document.body.clientWidth - 404)/2; document.getElementById("fbbox").style.left = marginLeft + 'px'; document.getElementById("fbbox").style.display = ''; document.getElementById("fbbox").src = '/feedback/' + variation; new PopupCover(); } } function inArray(needle, haystack) { var length = haystack.length; for(straw in haystack) { if(haystack[straw] == needle) return true; } return false; } function closeFeedback() { isFeedbackOn = false; document.getElementById("fbbox").style.display = 'none'; document.getElementById("fbbox").src = ''; PopupCover.close(); } function showLoginBox() { document.getElementById('loginBox').src = '/loginbox'; document.getElementById('loginBox').style.display = ""; if("innerHeight" in window) { marginLeft = 4*(window.innerWidth-492)/5; marginTop = (window.innerHeight-268)/10; } else { marginLeft = 4*(document.documentElement.clientWidth-492)/5; marginTop = (document.documentElement.clientHeight-268)/10; } if(marginTop < 5) { marginTop = 5; } document.getElementById("loginBox").style.position = "fixed"; document.getElementById("loginBox").style.left = marginLeft+"px"; document.getElementById("loginBox").style.top = marginTop+"px"; } function closeLoginBox() { document.getElementById('loginBox').style.display = 'none'; document.getElementById('loginBox').src = ''; PopupCover.close(); } function showAffiliatesPopup(linkTag) { if(!linkTag) { linkTag = "CommissionJnction"; affiliateLinkTag = "affiliateLinkTag=Default"; } else { affiliateLinkTag = "affiliateLinkTag=" + linkTag; } track("affiliateskClick", affiliateLinkTag); var marginLeft = (document.body.clientWidth - 531)/2; document.getElementById("affiliatesPopup").style.left = marginLeft + "px"; document.getElementById("affiliatesPopup").style.display = "block"; document.getElementById("affiliateTextLink").innerHTML = "http://www.abcmouse.com/" + linkTag; new PopupCover(); } function closeAffiliatesPopup() { document.getElementById("affiliatesPopup").style.display = "none"; PopupCover.close(); } function onVideoLinkClick(getPos, file, hideSignup, videoPlayerId, tracking) { if(/\.swf$/.test(file)) { var pos = {x: 0, y: 0};//videoPos(file); if(!getPos) { var wWidth, wHeight; if("innerHeight" in window) { wWidth = window.innerWidth; wHeight = window.innerHeight; } else { wWidth = document.documentElement.clientWidth; wHeight = document.documentElement.clientHeight; } var x = VideoPlayer.META_DATA.width; var y = VideoPlayer.META_DATA.height; if(videoPlayerId == 1) { x = 1005; y = 610; } pos.x = wWidth / 2 - x / 2; pos.y = wHeight / 2 - y / 2; //document.getElementById('seeallvideos').style.display = "none"; } new VideoPlayer(pos.x, pos.y, videoPlayerId).start(file, !getPos, (hideSignup == null) ? 0 : hideSignup, 0); new PopupCover(); } else { var config = {}; if(file == 'phonics_webinar_12fps.f4v' || hideSignup == true) { config.showSignUpBtn = false; } videoPlayer = new FlowVideoPlayer(); videoPlayer.page = tracking; videoPlayer.play(file, config); new PopupCover(); } } function PopupCover() { //PopupCover.coverCount++; if(PopupCover.activeCover != null) return; PopupCover.activeCover = this; //if(PopupCover.activeCover != null) return; var cover = document.createElement("div"); cover.className = "popupcover"; this.close = function() { cover.parentNode.removeChild(cover); PopupCover.activeCover = null; }; document.body.appendChild(cover); //cover.setAttribute('onclick', closePopup()); } PopupCover.activeCover = null; PopupCover.close = function() { if(PopupCover.activeCover != null) { PopupCover.activeCover.close(); } }; function gotoRegistration(type) { if(type == "videoPlayerSignUpButton") { track("regclick", "src=" + type, subscriptionPage + "/video_sign_up_button"); } else if(type == "mouseAndPointerTutorial") { track("regclick", "src=" + type, subscriptionPage + "/mouse_and_pointer_sign_up"); } else { var extraTracking = ""; if(/video:/.test(type)) extraTracking = "/" + type.slice("video:".length); track("regclick", "src=" + type, subscriptionPage + extraTracking); } } function track(tag, kvp, redirectUrl) { var vars = {tag: tag, kvp: kvp}; if(redirectUrl != null) { ajax('/xml/track.php', vars, function(){ if(typeof(redirectUrl) == 'function') { redirectUrl.call(); } else { location.href = redirectUrl; } }); } else { ajax('/xml/track.php', vars, function(){}); } } function showPopup(url, width, height, stylePosition, parent_div, position) { var position = position || getCenteredPosition(width, height, (stylePosition) ? stylePosition : ""); var popupIframe = createElement("div", {id: "abcmouse-popup-iframe"}); //var popupIframe = document.getElementById("popup"); //popupIframe.src = url; popupIframe.innerHTML = ''; // //popupIframe.contentWindow.location.replace(url); popupIframe.style.zIndex = "100"; popupIframe.width = width + "px"; popupIframe.height = height + "px"; popupIframe.style.position = (stylePosition) ? stylePosition : "fixed"; popupIframe.style.top = position.y + "px"; popupIframe.style.left = position.x + "px"; popupIframe.style.display = "block"; if(parent_div) { if(typeof parent_div == "string") parent_div = document.getElementById(parent_div); if(parent_div) parent_div.appendChild(popupIframe); } else { document.body.appendChild(popupIframe); } new PopupCover(); //trace('parent_div: '); } function closePopup() { var popupIframe = document.getElementById("abcmouse-popup-iframe"); if(popupIframe == null) return; //popupIframe.src = ""; popupIframe.style.display = "none"; //popupIframe.contentWindow.innerHTML = ""; popupIframe.parentNode.removeChild(popupIframe); PopupCover.close(); } function closeTestimonialBox() { closePopup(); } function getCenteredPosition(width, height, stylePosition) { var wWidth, wHeight; if("innerHeight" in window) { wWidth = window.innerWidth; wHeight = window.innerHeight; } else { wWidth = document.documentElement.clientWidth; wHeight = document.documentElement.clientHeight; } var position = {x: 0, y: 0}; position.x = (wWidth - width) / 2; position.y = (wHeight - height) / 2; position.x = (position.x < 0) ? 0 : position.x; position.y = (position.y < 0) ? 0 : position.y; if(stylePosition == "absolute") { var scrollingPosition = getScrollXY(); position.x += scrollingPosition.x; position.y += scrollingPosition.y; } return position; } function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return {x: scrOfX, y: scrOfY}; } function showSurveyPopup(videoPlayerId) { return; var source = "unknown"; if((getCookie("survey-completed") == "" && homepageVersion != 88 && homepageVersion != 89 && homepageVersion != 134 && homepageVersion != 151) || videoPlayerId == -10) { if((getCookie("survey-popup") != "02.01.25") || videoPlayerId == -10 || videoPlayerId == -20) { if(videoPlayerId >= 0) { source = "videoClose-Other"; } else if(videoPlayerId == -1) { source = "autopop"; } else if(videoPlayerId == -10) { source = "faqs"; } else if(videoPlayerId == -20) { source = "offerviewer"; } else { source = "videoClose"; } showPopup('/survey-popup/' + source,591,1300, "absolute"); setCookie("survey-popup","02.01.25",365); new PopupCover(); return true; } } else if((homepageVersion == 175 || homepageVersion >= 186) && getCookie("firstMonthFree") != "" && videoPlayerId == -20) { showFirstMonthFreePopup(); } return false; } function closeSurveyPopup() { closePopup(); PopupCover.close(); if(document.getElementById("surveyPopup")) { document.getElementById("surveyPopup").style.display = "none"; document.getElementById("holidayOfferPopupCover").style.display = "none"; } } function closeInfoPopup() { if(typeof closePopup == "function") { closePopup(); } } function showSurveyErrorMessage() { if(document.getElementById("errorsPopup") != null) return; var errorMessage = '