//! ################################################################ //! This file contains both original and merged/adapted code. //! Except where indicated, all code is //! Copyright (c) 2004-2007 Amazon.com, Inc., and its Affiliates. //! All Rights Reserved. //! Not to be reused without permission //! ################################################################ // ======= JSF SafetyNet ======= var goN2Initializer = { aHandlers: [], runThisWhen: function (sWhen, fFn, sComment) { if ((typeof fFn != 'function') || fFn == null) return false; this.aHandlers[this.aHandlers.length] = { sWhen: sWhen.toLowerCase(), fFn: fFn, sComment: sComment }; return true; }, isReady: function() {return false;} }; function n2RunThisWhen(sWhen, fFn, sComment) { return goN2Initializer.runThisWhen(sWhen, fFn, sComment); } goN2Consts = { chEOL: String.fromCharCode(0x0A), chSQUOTE: String.fromCharCode(0x27), chDQUOTE: String.fromCharCode(0x22), chBACKSLASH: String.fromCharCode(0x5C), chYEN: String.fromCharCode(0xA5) }; var n2sRTW1='onloadsuccess'; var n2sRTWTBS='simplepopoverloaded'; // ======= JSF Bootstrap (1) ======= var goN2LibMon = { aLibs: {}, aSheets: {}, nMONITORLOAD: -1, isJSLoaded: function() { return false; }, documentWriteScriptTags: function (aLibPaths) { var i; var sTags = ""; var bIsSafari = navigator.userAgent.match(/Safari/); for (i in aLibPaths) { var sScript = '' + goN2Consts.chEOL; if (bIsSafari) document.write(sScript); else sTags += sScript; } document.write(sTags); }, documentWriteCSSLinkTags: function (aLibPaths) { var i; var sTags = ""; for (i in aLibPaths) { sTags += '' + goN2Consts.chEOL; } document.write(sTags); }, monitorLoad: function (sLibID, sFeature, sUrl) { this.aLibs[sLibID] = { sID: sLibID, nDuration: this.nMONITORLOAD, sFeature: sFeature, sUrl: sUrl }; } } gsN2ImageHost='http://z-ecx.images-amazon.com/images/G/01/'; // ======= JSF Bootstrap (2) ======= var goJSFStringTableProperties = { less_info_36021: 'Less Info', unable_to_get_info_36020: 'Unable to obtain necessary information. Please try again later', loading_13548: 'Loading...', you_will_stay_here_36023: '(You will stay right here)', alt_text_click_to_collapse_36019: 'click to collapse this section and see less', alt_text_click_to_expand_36018: 'click to expand this section and see more', no_addl_info_36017: 'No additional information is available at this time', you_will_go_to_new_page_36022: '(You will go to a new page)' }; goJSFStringTableProperties['more-info_8559'] = 'More Info'; var goJSFImageURLProperties = {}; goJSFImageURLProperties['JSF-popover-border-br'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-br._V264586601_.gif'; goJSFImageURLProperties['JSF-r-orange-arrow'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/arrow-r-orange-11x10._V46891478_.gif'; goJSFImageURLProperties['JSF-popover-border-t'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-t._V264586600_.gif'; goJSFImageURLProperties['JSF-thumb-no-image'] = 'http://g-ecx.images-amazon.com/images/G/01/x-locale/detail/thumb-no-image._V47060337_.gif'; goJSFImageURLProperties['JSF-next-tan-sm'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/next-tan-sm._V46865265_.gif'; goJSFImageURLProperties['JSF-popover-border-cbr'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-cbr._V264586603_.gif'; goJSFImageURLProperties['JSF-next-tan-sm-dis'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/next-tan-sm-dis._V46840264_.gif'; goJSFImageURLProperties['JSF-popover-border-l'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-l._V264586600_.gif'; goJSFImageURLProperties['JSF-close-tan-sm-dn'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/close-tan-sm-dn._V46881222_.gif'; goJSFImageURLProperties['JSF-popover-trans'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-trans._V264586600_.gif'; goJSFImageURLProperties['JSF-d-orange-arrow'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/arrow-d-orange-11x10._V46921829_.gif'; goJSFImageURLProperties['JSF-next-tan-sm-dn'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/next-tan-sm-dn._V46686641_.gif'; goJSFImageURLProperties['JSF-back-tan-sm'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/back-tan-sm._V46922606_.gif'; goJSFImageURLProperties['JSF-popover-border-r'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-r._V264586600_.gif'; goJSFImageURLProperties['JSF-popover-border-cbl'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-cbl._V264586603_.gif'; goJSFImageURLProperties['JSF-popover-border-tr'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-tr._V264586600_.gif'; goJSFImageURLProperties['JSF-loading-bar'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/loading-bar._V46911781_.gif'; goJSFImageURLProperties['JSF-popover-border-bl'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-bl._V264586601_.gif'; goJSFImageURLProperties['JSF-popover-border-tl'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-tl._V264586600_.gif'; goJSFImageURLProperties['JSF-close-tan-sm'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/close-tan-sm._V46903531_.gif'; goJSFImageURLProperties['JSF-popover-border-ctr'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-ctr._V264586603_.gif'; goJSFImageURLProperties['JSF-back-tan-sm-dis'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/back-tan-sm-dis._V46863825_.gif'; goJSFImageURLProperties['JSF-popover-border-b'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-b._V264586601_.gif'; goJSFImageURLProperties['JSF-popover-border-ctl'] = 'http://g-ecx.images-amazon.com/images/G/01/gno/popover-border-ctl._V264586603_.gif'; goJSFImageURLProperties['JSF-back-tan-sm-dn'] = 'http://g-ecx.images-amazon.com/images/G/01/nav2/images/back-tan-sm-dn._V46913462_.gif'; var goCust = { isLoggedIn: function() { return false; } }; n2RunThisWhen('onload', function() { n2RunThisWhen('explorerloaded', function() { goN2Explorer = new N2ExplorerPopover(); goN2Explorer.enableLAD(true); goN2Explorer.initialize('goN2ExplorerDiv', 'goN2Explorer', 'gaTD', 'div'); goN2Explorer.setUpdateManager(goN2DUManager); goN2Explorer.setDUHandler('explorer/pexj', 'xd'); goN2Explorer.getPane(0).configureLADSupport(true, null, 'pdok', 'ptd', 'pi'); goN2Events.registerFeature('paexp', 'goN2Explorer', 'n2MouseOverHotspotSemiStatic', 'n2MouseOutHotspot'); }, 'explorer Init'); }, "n2CoreLibs productPopovers Init"); goN2LibMon.monitorLoad('utilities'); goN2LibMon.monitorLoad('events'); goN2LibMon.monitorLoad('simplePopover'); goN2LibMon.monitorLoad('staticPopover'); goN2LibMon.monitorLoad('popoverPane'); goN2LibMon.monitorLoad('dynUpdate'); goN2LibMon.monitorLoad('multiPanePopover'); goN2LibMon.monitorLoad('panes'); goN2LibMon.monitorLoad('explorer'); goN2LibMon.documentWriteCSSLinkTags( ['http://z-ecx.images-amazon.com/images/G/01/nav2/gamma/n2CoreLibs/n2CoreLibs-combined-n2v1-32837._V264742113_.css'] ); goN2LibMon.documentWriteScriptTags( [ 'http://z-ecx.images-amazon.com/images/G/01/nav2/gamma/n2CoreLibs/n2CoreLibs-combined-core-32915._V264742115_.js', 'http://z-ecx.images-amazon.com/images/G/01/nav2/gamma/n2CoreLibs/n2CoreLibs-combined-extended-23637._V264742114_.js', 'http://z-ecx.images-amazon.com/images/G/01/nav2/gamma/n2CoreLibs/n2CoreLibs-combined-explorer-14121._V264742141_.js' ] ); // JSF Bootstrap (End) window.sAssocLogoImg = ''; window.sAssocAddCartBtn = ''; window.sAssocAddCartImg = ''; window.sAssocDefault = ''; window.sAssocPreorderBtn = ''; goN2Initializer.runThisWhen("onload", function() { goPop = new N2MultiPanePopover(); if (!window.gaTD) { gaTD = new Array(); } goN2Events.registerFeature('evtst', 'goPop', 'n2MouseOverHotspotSemiStatic', 'n2MouseOutHotspot'); goPop.setButtonImages('close', 15, 15, 'close-box-up', 'close-box-down'); goPop.initialize('goPopElem', 'goPop', 'gaTD' ); goPop.setDUHandler('/gp/associates/jsf/du/pexj', 'xd'); oPane0 = goPop.addPane(new N2PopoverPane(), 0); oPane0.setDefaultWidth('467px'); oPane0.setDefaultHeight('134px'); oPane0.configureLADSupport(true, null, 'pdok', 'ptd', 'pi'); oPane0.nLADTimeoutMs = 5000; oPane0.populate = ASPopoverPopulate; oPane0.startImpressionTimer = ASStartImpressionTimer; var pt = document.getElementById('goPopElem_titleBar'); if (pt) { pt.style.height = '22px'; } var pm = document.getElementById('goPopElem_main'); if (pm) { pm.style.border = '5px solid rgb(239,237,212)'; pm.style.borderTopStyle = 'none'; } var pl = document.getElementById('goPopElem_titleBarTitle'); if (pl) { pl.style.display = 'block'; pl.style.paddingLeft = '0px'; pl.style.paddingTop = '0px'; pl.style.backgroundColor = 'rgb(239,237,212)'; } var pc = document.getElementById('goPopElem_titleBarTd2'); if (pc) { pc.style.backgroundColor = 'rgb(239,237,212)'; } var close = document.getElementById('goPopElem_closeX'); if(close) { pc.style.padding = '2px 3px'; pc.style.margin = '0px'; } goN2DUManager.setBaseURL('http://www.amazon.com/gp/nav2/du'); goN2DUManager.setProxyURL(null); goN2DUManager.setMarketplace('1'); }, "Popover init"); function ASSetImpressionImg (sPopID, sTag, sLinkCode, sASIN) { var oImg = document.getElementById(sPopID + "_assocImpImg"); if (!oImg) return; var sUrl = "http://www.assoc-amazon.com"; sUrl += "/s/pp?o=1"; sUrl += "&t=" + sTag; sUrl += "&l=" + sLinkCode; sUrl += "&asin=" + sASIN oImg.src = sUrl; } function ASStartImpressionTimer() { var sPopObjID = this.oPopover.myID; var oA = this.oPopover.assocData; var sFunc = "ASSetImpressionImg('" + sPopObjID + "','" + oA.sTag + "','" + oA.sLinkCode + "','" + oA.sASIN + "');" this.oAssocTimer = setTimeout(sFunc, 2000); } function ASFixLineHeight(enclosureId, height) { var enclosure = document.getElementById(enclosureId); if (!enclosure) { setTimeout(function(){ASFixLineHeight(enclosureId,height);},500); return; } var oldhtml = enclosure.innerHTML; var newhtml = oldhtml; var ellipsis = '…'; var current_height = parseInt(enclosure.offsetHeight); while ((current_height > height) && (newhtml.length > ellipsis.length)) { newhtml = newhtml.substring(0, newhtml.length - (ellipsis.length + 1)); newhtml += ellipsis; enclosure.innerHTML = newhtml; current_height = parseInt(enclosure.offsetHeight); } if (newhtml == ellipsis) { enclosure.innerHTML = oldhtml; } enclosure.style.visibility = "visible"; } function ASPopoverPopulate (sAction, sID, sType, sParams, sLinkID, sHref, sLinkText, fLADMethod) { if (!sType || !sID ) { return; } if (this.bLADSupported) { if (!this.isDataAvailable(sAction, sID, sType, sParams, sLinkID, sHref, sLinkText, fLADMethod)) { return false; } } var oSourceLink = document.getElementById(sLinkID); var sTag, sTgt, sLinkCode, retailHost; var oAssocData = {}; if (oSourceLink) { oAssocData.sTag = sTag = oSourceLink.href.match(/tag=([^&]+)/)[1]; sTgt = oSourceLink.target; var aLinkCode = oSourceLink.href.match(/link(C|_c)ode=([^&]+)/); sLinkCode = (aLinkCode) ? aLinkCode[2] : ''; } sLinkCode = (sLinkCode) ? sLinkCode : 'as3'; oAssocData.sLinkCode = sLinkCode; oAssocData.sASIN = sID; this.oPopover.assocData = oAssocData; var sKey = sType+sID; this.sLADTimeoutMessage = '

' + new ASExternalLink( '/?tag=' + sTag + '&creativeASIN=' + sID + + '&camp=15041' + '&creative=373517' + '&link_code=' + sLinkCode, window.sAssocDefault, "", sTgt).genHTML() + '
'; this.setTimeoutMessage(this.sLADTimeoutMessage); var nPrivLoc = (document.all) ? 128 : 138; var sPrivacyLink = '
' + '' + 'Privacy Information
'; var aData = this.oPopover.getDataArray(); if (aData[sKey]) { var ss=""; for (var i in aData[sKey]) { ss += i + " : " + aData[sKey][i] + "\n"; } if (sType == 'a' || sType == 'as' || sType == 'am') { var sh; if (!aData[sKey].nm) { sh = this.sLADTimeoutMessage; sh += sPrivacyLink; } else { var ras = aData[sKey].ras; var rc = aData[sKey].rc; var ra = aData[sKey].ra; var img_org = '1'; if(img_org.length < 2) { img_org = '0' + img_org; } if (ras) { ras = ''; } else if (ra >=0 && ra <=5) { var raMaj=0; var raMin=0; var raMaj = Math.floor(ra); var rem = ra-raMaj; rem = rem.toFixed(2); if ( (rem >= 0.25) && (rem < 0.75) ){ raMin=5; } else if (rem >= 0.75) { raMaj++; } ras = ''; } else { ras =""; } var av = (aData[sKey].av) ? aData[sKey].av : (aData[sKey].oc > 0 ) ? 'See site for availibility' : 'Currently unavailable'; var th = aData[sKey].th; if ((th == '') || (th == null) || goN2U.isUndefined(th) ) { th = ''; } th = th.replace('/>', ' align="center" vspace="5" hspace="5" border="0"/>'); // number of offers var oc = aData[sKey].oc || null; var oPop = this.oPopover; sh = ""; sh += ' 0) ? '/gp/offer-listing/' : '/dp/'; } if(nonBuyButtonTarget) { oLink = new ASExternalLink ( nonBuyButtonTarget + sID + '?tag=' + sTag + '&camp=15041' + '&creative=373501' + '&link_code=' + sLinkCode, window.sAssocAddCartImg, '', sTgt, 'buyNowButton'); sh += oLink.genHTML(); } else { //use a different button if we need to preorder var addButton; if ((aData[sKey].preorder) && (aData[sKey].preorder == 1)) { addButton = window.sAssocPreorderBtn; } else { addButton = window.sAssocAddCartBtn; } sh += ''; sh += ''; sh += ''; sh += ''; sh += ''; sh += ''; sh += ''; sh += ''; sh += addButton; sh += '' } sh +=''; var sName = aData[sKey].nm ? aData[sKey].nm : sLinkText; oLink = new ASExternalLink ( '/dp/' + sID + '?tag=' + sTag + '&camp=15041' + '&creative=373501' + '&link_code=' + sLinkCode, sName, '', sTgt, 'productTitleLink'); sh += ''; if (aData[sKey].au && aData[sKey].cat != "dvd") { sh += ''; } else if (aData[sKey].mf) { sh += '' } var lp = aData[sKey].lp; var op = aData[sKey].op; var bmap = aData[sKey].bmap; var bp = aData[sKey].bp; var rgxNonZero = new RegExp("[1-9]"); if (lp && !lp.match(rgxNonZero)) lp = null; if (op && !op.match(rgxNonZero)) op = null; if (bp && !bp.match(rgxNonZero)) bp = null; if (bmap || op || bp || lp) { sh += ''; } if (bmap) { oLink = new ASExternalLink ( '/dp/' + sID + '?tag=' + sTag + '&camp=15041' + '&creative=373501' + '&link_code=' + sLinkCode, 'Click for price', '', sTgt); sh += 'New: ' + oLink.genHTML() + ' '; } else if (op) { sh += 'New: ' + '' + op + ' '; if (oc && oc > 0) { oLink = new ASExternalLink ( '/gp/offer-listing/'+ sID + '?tag=' + sTag + '&camp=15041' + '&creative=373505' + '&link_code=' + sLinkCode, oc + ' new & used', '', sTgt); sh += oLink.genHTML(); if (bp) { sh += ' from ' + '' + bp + ''; } } } else if (bp) { if (oc && oc > 0) { oLink = new ASExternalLink ( '/gp/offer-listing/' + sID + '?tag=' + sTag + '&camp=15041' + '&creative=373505' + '&link_code=' + sLinkCode, oc + ' new & used', '', sTgt); sh += oLink.genHTML(); sh += ' from ' + bp + ''; } else { sh += 'Best Price: ' + '' + bp + ''; } } else if (lp) { sh += 'List Price: ' + '' + lp + ''; } if (bmap || op || bp || lp) { sh += ''; } sh += (av) ? '
' + av : ''; sh += ras ? '
Average Customer Review: ' + ras : ''; sh +=''; sh += '
'; sh += sPrivacyLink; } sh += '
'; sh += ''; var sTitleImg = (window.sAssocLogoImg) ? window.sAssocLogoImg : ""; var oTitleLink = new ASExternalLink( '/?link_code=' + sLinkCode + '&tag=' + sTag + '&creativeASIN=' + sID + '&camp=15041' + '&creative=373513', sTitleImg, "", sTgt); this.oPopover.setTitle(oTitleLink.genHTML()); this.setContent(sh); if (aData[sKey].nm) { window.setTimeout( function(){ASFixLineHeight('productTitleLink',42);}, 50); } if (aData[sKey].mf || aData[sKey].au) { window.setTimeout( function(){ASFixLineHeight('assocPopOver-outer-author-span',14);}, 50); } this.startImpressionTimer(); } else { } } else { this.setContent(''); } } function ASExternalLink(sURL, sText, sTitle, sTarget, sID) { this.sURL = sURL; this.sText = sText; this.sTitle = sTitle; this.sTarget = sTarget; this.sID = sID || ''; return this; } ASExternalLink.prototype.genHTML = function(){ var sURL = "http://" + 'www.amazon.com' + this.sURL; return '' + this.sText + ''; }