Xpath 2.0 Programmer's Reference (Programmer to Porgrammer Series)

Overview

What is this book about?

XPath 2.0 Programmer's Reference is the only authoritative reference on XPath, a sub-language within XSLT that determines which part of an XML document the XSLT transforms. Written for professional programmers who use XML every day but find the W3C XPath specifications tough to slog through, this book explains in everyday language what every construct in the language does and how to use it. It also offers background material on the design thinking behind...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (7) from $18.02   
  • New (3) from $83.90   
  • Used (4) from $18.02   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$83.90
Seller since 2008

Feedback rating:

(187)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
0764569104 New. Looks like an interesting title!

Ships from: Naperville, IL

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$137.52
Seller since 2014

Feedback rating:

(227)

Condition: New
Brand New Item.

Ships from: Chatham, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$155.00
Seller since 2014

Feedback rating:

(113)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

What is this book about?

XPath 2.0 Programmer's Reference is the only authoritative reference on XPath, a sub-language within XSLT that determines which part of an XML document the XSLT transforms. Written for professional programmers who use XML every day but find the W3C XPath specifications tough to slog through, this book explains in everyday language what every construct in the language does and how to use it. It also offers background material on the design thinking behind the language, gentle criticism of the language specification when appropriate, and a diverse range of interesting examples in various application areas.

Read More Show Less

Product Details

  • ISBN-13: 9780764569104
  • Publisher: Wiley, John & Sons, Incorporated
  • Publication date: 8/28/2004
  • Series: Programmer to Porgrammer Series
  • Edition number: 1
  • Pages: 552
  • Product dimensions: 7.44 (w) x 9.12 (h) x 1.22 (d)

Meet the Author

Michael Kay has been working in the XML field since 1997; he became a member of the XSLWorking Group soon after the publication of XSLT 1.0, and took over as editor of the XSLT 2.0 specification in early 2001. He is also a member of the XQueryWorking Group, and is a joint editor of the XPath 2.0 specification. He is well known not only through previous editions of this book, but also as the developer of the open-source Saxon product, a pioneering implementation of XSLT 2.0, XPath 2.0, and XQuery 1.0.

The author has recently formed his own company, Saxonica, to provide commercial software and services building on the success of the Saxon technology. Previously, he spent three years with Software AG, working with the developers of the Tamino XML server, a leading XQuery implementation. His background is in database technology: after leaving the University of Cambridge with a Ph.D., he worked for many years with the (then) computer manufacturer ICL, developing network, relational, and object-oriented database software products as well as a text search engine, and held the position of ICL Fellow.

Read More Show Less

Table of Contents

Ch. 1 XPath 2.0 in context 1
Ch. 2 The data model 27
Ch. 3 The type system 61
Ch. 4 The evaluation context 115
Ch. 5 Basic constructs 133
Ch. 6 Operators on items 169
Ch. 7 Path expressions 201
Ch. 8 Sequence expressions 239
Ch. 9 Type expressions 261
Ch. 10 XPath functions 291
Ch. 11 Regular expressions 447
App. A XPath 2.0 syntax summary 459
App. B Operator precedence 467
App. C Compatibility with XPath 1.0 469
App. D Error codes 475
Read More Show Less

First Chapter

XPath 2.0 Programmer's Reference


By Michael Kay

John Wiley & Sons

ISBN: 0-7645-6910-4


Chapter One

Sequence Expressions

One of the most notable innovations in XPath 2.0 is the ability to construct and manipulate sequences. This chapter is devoted to an explanation of the constructs in the language that help achieve this.

Sequences can consist either of nodes, or of atomic values, or of a mixture of the two. Sequences containing nodes only are a generalization of the node-sets offered by XPath 1.0. In the previous chapter we looked at the operators for manipulating node-sets, in particular, path expressions, and the operators «union», «intersect», and «except».

In this chapter we look at constructs that can manipulate any sequence, whether it contains nodes, atomic values, or both. Specifically, the chapter covers the following constructs:

Sequence concatenation operator: «,»

Numeric range operator: «to»

Filter expressions: «a[b]»

Mapping expressions: «for»

Quantified expressions: «some» and «every»

First, some general remarks about sequences.

Sequences (unlike nodes) do not have any concept of identity. Given two values that are both sequences, you can ask (in various ways) whether they have the same contents, but you cannot ask whether they are the same sequence.

Sequences are immutable. This is part of what it means for a language to be free of side effects. You can write expressions that take sequences as input and produce new sequences as output, but you can never modify an existing sequence in place.

Sequences cannot be nested. If you want to construct trees, build them as XML trees using nodes rather than atomic values.

A single item is a sequence of length one, so any operation that applies to sequences also applies to single items.

Sequences do not have any kind of type label that is separate from the type labels attached to the items in the sequence. As we will see in Chapter 9, you can ask whether a sequence is an instance of a particular sequence type, but the question can be answered simply by looking at the number of items in the sequence, and at the type labels attached to each item. It follows that there is no such thing as (for example) an "empty sequence of integers" as distinct from an "empty sequence of strings". If the sequence has no items in it, then it also carries no type label. This has some real practical consequences, for example, the sum() function, when applied to an expression that can only ever return a sequence of xs:duration values, will return the integer 0 (not the zero-length duration) when the sequence is empty, because there is no way at runtime of knowing that if the sequence hadn't been empty, its items would have been durations.

Functions and operators that attach position numbers to the items in a sequence always identify the first item as number 1 (one), not zero. (Although programming with a base of zero tends to be more convenient, Joe Public has not yet been educated into thinking of the first paragraph in a chapter as paragraph zero, and the numbering convention was chosen with this in mind.)

This chapter covers the language constructs that handle general sequences, but there are also a number of useful functions available for manipulating sequences, and these are described in Chapter 10. Relevant functions include: count(), deep-equal(), distinct-values(), empty(), exists(), index-of(), insert-before(), remove(), subsequence(), and unordered().

The Comma Operator

The comma operator can be used to construct a sequence by concatenating items or sequences. We already saw the syntax in Chapter 5, because it appears right at the top level of the XPath grammar:

Expression Syntax

Expr ExprSingle («,» ExprSingle) *

ExprSingle ForExpr | QuantifiedExpr | IfExpr | OrExpr

Although the production rule ExprSingle lists four specific kinds of expression that can appear as an operand of the «,» operator, these actually cover any XPath expression whatsoever, provided it does not contain a top-level «,».

Because the «,» symbol also has other uses in XPath (for example, it is used to separate the arguments in a function call, and also to separate clauses in «for», «some», and «every» expressions, which we will meet later in this chapter), there are many places in the grammar where use of a general Expr is restricted, and only an ExprSingle is allowed. In fact, the only places where a general Expr (one that contains a top-level comma) is allowed are:

As the top-level XPath expression Within a parenthesized expression

Within the parentheses of an «if» expression

Within square brackets as a predicate

Neither of the last two is particularly useful, so in practice the rule is: if you want to use the comma operator to construct a list, then it must either be at the outermost level of the XPath expression, or it must be written in parentheses.

For example, the max() function expects a single argument, which is a sequence. If you want to find the maximum of three values $a, $b, and $c, you can write:

max(($a, $b, $c))

The outer parentheses are part of the function call syntax; the inner parentheses are needed because the expression «max($a, $b, $c)» would be a function call with three parameters rather than one, which would be an error.

XPath does not use the JavaScript convention whereby a function call with three separate parameters is the same as a function call whose single parameter is a sequence containing three items.

The operands of the «,» operator can be any two sequences. Of course, a single item is itself a sequence, so the operands can also be single items. Either of the sequences can be empty, in which case the result of the expression is the value of the other operand.

The comma operator is often used to construct a list, as in:

if ($status = ('current', 'pending', 'deleted', 'closed')) then ...

which tests whether the variable $status has one of the given four values (recall from Chapter 6 that the «=» operator compares each item in the sequence on the left with each item in the sequence on the right, and returns true if any of these pairs match). In this construct, you probably aren't thinking of «,» as being a binary operator that combines two operands to produce a result, but that's technically what it is. The expression «A,B,C,D» technically means «(((A,B),C),D)», but since list concatenation is associative, you don't need to think of it this way.

The order of the items in the two sequences is retained in the result. This is true even if the operands are nodes: there is no sorting into document order. This means that in XSLT, for example, you can use a construct such as:

to process the selected elements in a specified order, regardless of the order in which they appear in the source document. This example is not necessarily processing exactly three elements: there might, for example, be five authors and no abstract. Since the path expression «author» selects the five authors in document order, they will be processed in this order, but they will be processed after the element whether they precede or follow the title in the source document. <p> <b>Examples</b> <p> Here are some examples of expressions that make use of the «,» operator to construct sequences. <p> <b>Expression</b> <b>Effect</b> max(($net, $gross)) Selects whichever of $net and $gross is larger, comparing them according to their actual data type (and using the default collation if they are strings) <p> for $i in (1 to 4, 8, 13) 'Selects the items at positions 1, 2, 3, 4, 8, and 13 of the return $seq[$i] sequence $seq. For the meaning of the «to» operator, see the next section <p> string-join((@a, @b, Creates a string containing the values of the attributes @a, @c), "-") @b, and @c of the context node (in that order), separated by hyphens <p> (@code, "N/A")[1] Returns the code attribute of the context node if it has such an attribute, or the string "N/A" otherwise. This expression makes use of the fact that when the code attribute is absent, the value of @code is an empty sequence, and concatenating an empty sequence with another sequence returns the other sequence (in this case the singleton string "N/A") unchanged. The predicate in square brackets makes this a filter expression: filter expressions are described later in this chapter, on page 244 <p> book/(author, title, Returns a sequence containing the <author>, <title>, isbn) and <isbn> children of a <book> element, <b><i>in document order</i></b>. Although the «,» operator retains the order as specified, the «/» operator causes the nodes to be sorted into document order. So in this case the «,» operator is exactly equivalent to the union operator «|» <p> <b>Numeric Ranges: The «to» Operator</b> <p> A range expression has the syntax: <p> <b>Expression</b> <b>Syntax</b> <p> RangeExpr AdditiveExpr ( «to» AdditiveExpr )? <p> The effect is to return a sequence of consecutive integers in ascending order. For example, the expression «1 to 5» returns the sequence «1,2,3,4,5». <p> The operands do not have to be constants, of course. A common idiom is to use an expression such as «1 to count($seq)» to return the position number of each item in the sequence $seq. If the second operand is less than the first (which it will be in this example if $seq is an empty sequence), then the range expression returns an empty sequence. If the second operand is equal to the first, the expression returns a single integer, equal to the value of the first operand. <p> The two operands must both evaluate to single integers. You can use an untyped value provided it is capable of being converted to an integer: for example you can write «1 to @width» if width is an attribute in a schema-less document containing the value «34». However, you can't use a decimal or a double value without converting it explicitly to an integer. If you write «1 to @width+1», you will get a type error, because the value of «@width+1» is the double value 35.0e0. Instead, write «1 to xs:integer(@width)+1». or «1 to 1 + @width idiv 1». <p> It's an error if either operand is an empty sequence. For example, this would happen if you ran any of the examples above when the context node did not have a width attribute. Supplying a sequence that contains more than one item is also an error. <p> If you want a sequence of integers in reverse order, you can use the reverse() function described in Chapter 10. For example, «reverse(1 to 5)» gives you the sequence «5,4,3,2,1». In an earlier draft of the specification you could achieve this by writing «5 to 1», but the rules were changed because this caused anomalies for the common usage «1 to count($seq)» in the case where $seq is empty. <p> Although the semantics of this operator are expressed in terms of constructing a sequence, a respectable implementation will evaluate the sequence lazily, which means that when you write «1 to 1000000» it won't actually allocate space in memory to hold a million integers. Depending how you actually use the range expression, in most cases an implementation will be able to iterate over the values one to a million without actually laying them out end-to-end as a list in memory. <p> <b>Examples</b> <p> Here are some examples of expressions that make use of the «to» operator to construct sequences. <p> Expression Effect for $n in 1 to 10 return Returns the first 10 items of the sequence $seq. The «for» $seq[n] expression is described later in this chapter, on page 247 $seq[position() = 1 to 10] Returns the first 10 items of the sequence $seq. This achieves the same effect as the previous example, but this time using a filter expression alone. It works because the «=» operator compares each item in the first operand (there is only one, the value of position()), with each item in the second operand (that is, each of the integers 1 to 10), and returns true if any of them matches. It's reasonable to expect that XPath processors will optimize this construct so that this doesn't actually involve 10 separate comparisons for each item in the sequence. Note that you can't simply write «$seq[1 to 10]». If the predicate isn't a single number, it is evaluated as a boolean, and the effective boolean value of the sequence «1 to 10» is true, so all the items will be selected <p> string-join( Returns a string containing $N space characters for $i in 1 to $N return " ", "") <p> for $i in 1 to Returns a sequence that contains pairs of corresponding values count($S) return from the two input sequences $S and $T. For example, if $S is ($S[$i], $T[$i]) the sequence ("a","b","c") and $T is the sequence ("x","y","z"), the result will be the sequence ("a","x","b","y","c","z") <p> <b>Filter Expressions</b> <p> A filter expression is used to apply one or more Predicates to a sequence, selecting those items in the sequence that satisfy some condition. <p> <b>Expression</b> <b>Syntax</b> FilterExpr PrimaryExpr Predicate* <p> Predicate «[» Expr «]» <p> A FilterExpr consists of a PrimaryExpr whose value is a sequence, followed by zero or more Predicates that select a subset of the items in the sequence. Each predicate consists of an expression enclosed in square brackets, for example «[@name='London']» or «[position()=1]». <p> The way the syntax is defined, every PrimaryExpr is also a trivial FilterExpr, including simple expressions such as «23», «'Washington'», and «true()». <p> Since in XPath 2.0 <br> <br><i>Continues...</i> </i></b></blockquote> <br> <blockquote><hr noshade size='1'><font size='-2'> Excerpted from <b>XPath 2.0 Programmer's Reference</b> by <b>Michael Kay</b> Excerpted by permission. <br> All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher. <br>Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site. </font><hr noshade size='1'></blockquote></body></html> </div> </div> <div class="fade"></div> <a class="trigger" href="#"> <span class="more">Read More<span class="caret-down"></span></span> <span class="less">Show Less<span class="caret-up"></span></span> </a> </div> </section></div></div><div id="nookchannel-carousel-1" data-bn-widget-name="nookchannel-carousel" class="box product-tile-list nookchannel-carousel"></div><div id="product-reviews-1" data-bn-widget-name="product-reviews" class="page-content-wrapper l2r box product-reviews"><div class="shadowed-header" data-bntrack=""> <div class="shadow-bar-header milo"> <h2>Customer Reviews</h2> </div> <div class="shadow-bar"><span class="fade-right"></span></div> </div> <div class="horiz_rule"> <div class="fade-in"></div> <div class="fade-out"></div> </div> <div class="column c17-5col c15-5col left"> <div id="reviews-average-rating-1" data-bn-widget-name="reviews-average-rating" class="reviews-average-rating"><div class="averageRating">Be the first to write a review</div> <div class="starDisplay inactive"> <span class="stars-large r0" title="No rating data available yet"></span> <span class="total">( 0 )</span> </div></div> <!--[if IE]> <style type="text/css"> .rating-distro-meter { border:1px solid #ccc; } </style> <![endif]--> <div id="reviews-rating-distribution-1" data-bn-widget-name="reviews-rating-distribution" class="reviews-rating-distribution"><div class="header">Rating Distribution</div> <div class="rating-distro-row"> <h3>5 Star</h3> <div class="rating-distro-meter"> <div class="rating-distro-shadowoverlay"></div> <div class="rating-distro-meterbar" style="width: 0%"></div> </div> (0) </div> <div class="rating-distro-row"> <h3>4 Star</h3> <div class="rating-distro-meter"> <div class="rating-distro-shadowoverlay"></div> <div class="rating-distro-meterbar" style="width: 0%"></div> </div> (0) </div> <div class="rating-distro-row"> <h3>3 Star</h3> <div class="rating-distro-meter"> <div class="rating-distro-shadowoverlay"></div> <div class="rating-distro-meterbar" style="width: 0%"></div> </div> (0) </div> <div class="rating-distro-row"> <h3>2 Star</h3> <div class="rating-distro-meter"> <div class="rating-distro-shadowoverlay"></div> <div class="rating-distro-meterbar" style="width: 0%"></div> </div> (0) </div> <div class="rating-distro-row"> <h3>1 Star</h3> <div class="rating-distro-meter"> <div class="rating-distro-shadowoverlay"></div> <div class="rating-distro-meterbar" style="width: 0%"></div> </div> (0) </div></div> </div> <div class="column c17-12col c15-10col right"> <div id="in-page-write-a-review-1" data-bn-widget-name="in-page-write-a-review" class="wrapper in-page-write-a-review"><div id="reviews-write-a-review-1" data-bn-widget-name="reviews-write-a-review" data-bntrack="InPageReview" class="writeReview box reviews-write-a-review" data-bntrack-root="true"><div class="error-box hidden " > </div> <form name="PRODUCT.REVIEW.SUBMIT_REVIEW" action="http://www.barnesandnoble.com/reviews/submitreview" id="write_review_form_rnd-1507874821" class="submit-review-form" method="POST"> <input type="hidden" name="csrfToken" value="YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3" /> <div class="review-form" data-bntrack="No Previous Action"> <input type="hidden" name="review.ean" id="review-ean" value="9780764569104" /> <input type="hidden" name="review.productCode" id="review-productCode" value="BK" /> <div class="box rating-wrapper"> <div class="review-form-your-rating"> <h3>Your Rating:</h3> <div class="submit-rating" data-bntrack="submit-rating" data-ean="9780764569104"> <div class="stars-interactive"> <input id="review.rating-1" class="star" name="review.rating" type="radio" value="1" data-bntrack="rating-1"/> <div class="balloon"><label for="review.rating-1" class="text" hidefocus="true">Poor</label><div class="tail"></div></div> <input id="review.rating-2" class="star" name="review.rating" type="radio" value="2" data-bntrack="rating-2"/> <div class="balloon"><label for="review.rating-2" class="text" hidefocus="true">Below Average</label><div class="tail"></div></div> <input id="review.rating-3" class="star" name="review.rating" type="radio" value="3" data-bntrack="rating-3"/> <div class="balloon"><label for="review.rating-3" class="text" hidefocus="true">Good</label><div class="tail"></div></div> <input id="review.rating-4" class="star" name="review.rating" type="radio" value="4" data-bntrack="rating-4"/> <div class="balloon"><label for="review.rating-4" class="text" hidefocus="true">Very Good</label><div class="tail"></div></div> <input id="review.rating-5" class="star" name="review.rating" type="radio" value="5" data-bntrack="rating-5"/> <div class="balloon"><label for="review.rating-5" class="text" hidefocus="true">Exceptional</label><div class="tail"></div></div> <span class="stars-large r0" title="No rating data available yet"></span> </div> </div> </div> <div class="guidelines"><a href="#ReviewGuidelines" class="guidelines-trigger link-rightArrow">Review Guidelines</a></div> </div> <div class="text-field-wrapper"> <label for="review.body">Tell the world what you think of this product.</label> <textarea name="review.body" id="reviews-write-a-review-1-expandme"></textarea> </div> <div id="review-recommendations" class="add-recommendations box"> <h3 class="strong secondary hidden">Your Recommendations:</h3> <div class="initial" data-bn-recommendation="none"> <a href="#ReviewAddRecommendations" class="link-rightArrow recommendations-trigger">Add Recommendations</a> </div> <div class="secondary hidden"> <ul id="review-recommendations-list" class="recommendations-list"> <li> </li> </ul> </div> </div> <div class="pen-name" data-bntrack="Pen Name"> <strong class="strong">Your Name: </strong> <span id="usersPenName"><a href="#CreateAPenName" id="createAPenNameOpen">Create a Pen Name</a></span> <strong class="strong">or</strong> <label><input type="checkbox" name="review.reviewprivacy" id="penNameAnonymousCheck"> Leave Anonymously</label> <input type="hidden" name="review.penName" id="usersPenNameValue" value=""/> <input type="hidden" name="review.reviewstatus" id="usersPrivacy" value="PUBLIC"/> </div> <button type="submit" class="button tertiary small review-link">Submit</button> </div> </form> <div id="bn-overlay-review-guidelines" class="bn-overlay-content"> <div class="yui3-widget-bd box"> <h3>Barnes & Noble.com Review Rules</h3> <p>Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.</p> <h3>Reviews by Our Customers Under the Age of 13</h3> <p>We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our <a href="http://www.barnesandnoble.com/include/terms_of_use.asp" data-bntrack="Terms of Use" target="_blank" class="subtle" rel="nofollow">Terms of Use</a> for more details.</p> <h3>What to exclude from your review:</h3> <p>Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.</p> <h3>Reviews should not contain any of the following:</h3> <ul> <li>- HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone</li> <li>- Time-sensitive information such as tour dates, signings, lectures, etc.</li> <li>- Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.</li> <li>- Comments focusing on the author or that may ruin the ending for others</li> <li>- Phone numbers, addresses, URLs</li> <li>- Pricing and availability information or alternative ordering information</li> <li>- Advertisements or commercial solicitation</li> </ul> <h3>Reminder:</h3> <ul> <li>- By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com <a href="http://www.barnesandnoble.com/include/terms_of_use.asp" data-bntrack="Terms of Use" target="_blank" class="subtle" rel="nofollow">Terms of Use</a>.</li> <li>- Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.</li> <li>- See <a href="http://www.barnesandnoble.com/include/terms_of_use.asp" data-bntrack="Terms of Use" target="_blank" class="subtle" rel="nofollow">Terms of Use</a> for other conditions and disclaimers.</li> </ul> </div> </div> <div id="reviews-add-recommendations-1" data-bn-widget-name="reviews-add-recommendations" class="add-recommendations box reviews-add-recommendations"><div id="bn-overlay-add-recommendations" class="bn-overlay-content search-overlay"> <div class="yui3-widget-hd box"> <div class="shadowed-header" data-bntrack=""> <div class="shadow-bar-header milo"> Search for Products You'd Like to Recommend </div> <div class="shadow-bar"><span class="fade-right"></span></div> </div> </div> <div class="yui3-widget-bd box"> <form name="add-recommendations-form" action="http://www.barnesandnoble.com/ajax/results/suggestions" name="add-recommendations-form" class="box" method="POST"> <input type="hidden" name="csrfToken" value="YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3" /> <div id="" class="search-form-area box"> <h3>Recommend other products that relate to your review. Just search for them below and share!</h3> <div class="inputs"> <div class="outer-container"> <div class="inner-container"> <div class="search-input-wrapper milo"> <div class="text-field-wrapper"> <label class="hidden" for="keyword">Search Over 30 Million Products</label> <input name="keyword" id="keyword" value="" tabindex="2" class="search-input milo" autocomplete="off" type="text" /> </div> </div> </div> </div> <button class="branded">Search</button> </div> </div> <div class="search-results-area box"> <!-- TestMarker_searchResultsView_GRID --> <div id="search-results-1" data-bn-widget-name="search-results" class="grid search-results ajax"></div> </div> </form> </div> </div></div></div><div id="pen-name-overlay-1" data-bn-widget-name="pen-name-overlay" class="pen-name-overlay"><div id="bn-overlay-pen-name-overlay" class="bn-overlay-content pen-name-overlay"> <div class="yui3-widget-hd box"> <div class="shadowed-header" data-bntrack=""> <div class="shadow-bar-header milo"> Create a Pen Name </div> <div class="shadow-bar"><span class="fade-right"></span></div> </div> </div> <div class="yui3-widget-bd box"> <form name="check-availability" action="http://www.barnesandnoble.com/reviews/checkpenname" name="check-availability" class="panel" method="POST"> <input type="hidden" name="csrfToken" value="YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3" /> <div class="error-box hidden " > </div> <p> Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. <strong class="strong">Your Pen Name cannot be edited, changed or deleted once submitted.</strong> </p> <p> <div class="text-field-wrapper"> <label class="hidden" for="penName">Pen Name</label> <input name="penName" id="penName" value="" type="text" /> </div> <span class="tooltip-icon-trigger" id="tooltip-trigger-rnd-55809981"> </span> <div id="tooltip-message-rnd-55809981" class="tooltip-message hide box" tabindex="0"><div class="tail"></div> Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long. </div> </p> <p> <input class="button tertiary small" type="submit" value="Check Availability"/> </p> <a href="#penname-anonymous" class="continue anonymous">Continue Anonymously</a></form> <form name="penname-suggestions" action="http://www.barnesandnoble.com/reviews/checkpenname" style="display: none" name="penname-suggestions" class="panel" method="POST"> <input type="hidden" name="csrfToken" value="YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3" /> <div class="error-box hidden " > </div> <p class="pen-name-status-text"> <strong class="strong">We're sorry, but <em class="penNameAttempted">penname</em> is already taken.</strong> </p> Please select one of the following: <div class="suggestions"></div> <div class="box pen-name-radio pen-name-other"> <div class="yui3-widget styledinput styledradiobutton "> <input type="radio" name="penName" id="penName_" value="" checked class="styledinput-content styledradiobutton-content" /> <div class="styledinput-display styledradiobutton-display "></div> </div> <label for="penName_"></label> <label for="penNameOtherText">Or choose another Pen Name</label> <input autocomplete="off" value="" id="penNameOtherText" placeholder="Pen Name" tabindex="5" type="text"> <span class="tooltip-icon-trigger" id="tooltip-trigger-rnd-55809982"> </span> <div id="tooltip-message-rnd-55809982" class="tooltip-message hide box" tabindex="0"><div class="tail"></div> Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long. </div> </div> <p> <input class="button tertiary small" type="submit" value="Check Availability"/> </p> <a href="#penname-anonymous" class="continue anonymous">Continue Anonymously</a></form> <form name="penname-available" action="http://www.barnesandnoble.com/reviews/setpenname" style="display: none" name="penname-available" class="panel" method="POST"> <input type="hidden" name="csrfToken" value="YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3" /> <div class="error-box hidden " > </div> <input type="hidden" name="penName" value=""/> <p class="pen-name-status-text"> <strong class="strong"><em class="penNameAttempted">penname</em> is available!</strong> </p> <p> By visiting the BN.com website or marking a purchase on BN.com, a User is deemed to have accepted the <a href="#termsofuse" class="createAPenNameTermsOfUse">Terms of Use.</a> </p> <p> <button class="button tertiary small" type="submit">Use Pen Name</button> <button class="button secondary small find-different-name" type="button">Find a Different Pen Name</button> </p> <a href="#penname-anonymous" class="continue anonymous">Continue Anonymously</a></form> <div class="penname-continue panel" style="display: none"> <p class="pen-name-status-text"> <strong class="strong">Welcome, <em class="penNameAttempted">penname</em></strong> </p> <p>You have successfully created your Pen Name. Start enjoying the benefits of the BN.com Community today.</p> <input class="continue button tertiary small" type="button" value="Continue" /> </div> </div> </div></div></div> </div></div><div id="reviews-no-pagination-1" data-bn-widget-name="reviews-no-pagination" class="wrapper reviews-no-pagination"><!-- controls hidden --> <ul id="reviews-listing-1" data-bn-widget-name="reviews-listing" class="reviews-listing"></ul> <!-- controls hidden --></div><div id="report-as-inappropriate-1" data-bn-widget-name="report-as-inappropriate" class="report-as-inappropriate"><hr/> <div class="note"> <span>If you find inappropriate content, please report it to <a href="#">Barnes & Noble</a></span> </div> <div id="bn-overlay-report-as-inappropriate" class="bn-overlay-content report-as-inappropriate-overlay"> <div class="yui3-widget-hd box"> <div class="shadowed-header" data-bntrack=""> <div class="shadow-bar-header milo"> Why is this product inappropriate? </div> <div class="shadow-bar"><span class="fade-right"></span></div> </div> </div> <div class="yui3-widget-bd box"> <form name="report-as-inappropriate" action="http://www.barnesandnoble.com/report/as/inappropriate" name="report-as-inappropriate" method="post"> <input type="hidden" name="csrfToken" value="YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3" /> <input type="hidden" name="ean" value="9780764569104"/> <select name="reason"> <option value="Publisher doesn't hold rights to book" selected>Publisher doesn't hold rights to book</option> <option value="Publisher doesn't hold rights to cover image">Publisher doesn't hold rights to cover image</option> <option value="Inaccurate description">Inaccurate description</option> <option value="Objectionable content">Objectionable content</option> <option value="Other">Other</option> </select> <div class="comments"> Comments (optional) <textarea name="userNote" rows="5" cols="50" maxlength="500"></textarea> </div> <div class="button-box"> <button value="submit" type="submit" id="submit_reporting" class="tertiary small">Submit</button> <button value="cancel" type="button" class="close btn-cancel secondary small">Cancel</button> </div> </form> </div> </div></div><div id="google-content-text-ad-iframe-1" data-bn-widget-name="google-content-text-ad-iframe" class="google-content-text-ad-iframe"></div><div id="auto-overlay-1" data-bn-widget-name="auto-overlay" class="auto-overlay"><!-- auto-overlay --></div> </section> </div> </div> <footer class="box"> <div id="footer-1" data-bn-widget-name="footer" data-bntrack-pageaware="true" data-bntrack="Footer" class="footer"><!-- PID:37877 Start page:1 Date built:4/16/2014 6:39:43 PM --><div id="bnf-footer"> <div id="bnf-pods"> <style type="text/css"> a.bnf-locator { display: block; margin: 20px auto 0 auto; width: 127px; height: 36px; background: transparent url(http://img1.imagesbn.com/pimages/resources/gateway/2011/footer/btn_store-locator.png) no-repeat scroll 0 0; text-indent: -10000px; } a.bnf-locator:hover { background-position: 0 -36px; } #bnf-pods a.bnf-pod-2-learnmore { font-size: 12px; color: #3169a8; } #bnf-pods a.bnf-pod-2-learnmore + img { margin-left: 3px; } #submit.ftr-go-btn { display: inline; height: 32px; width: 52px; } .ftr-text { clear: left; display: inline-block; margin: 0; padding: 15px 0 0; width:230px; } .ftr-button1 { clear: left; display: inline-block; margin: 13px auto 0; padding: 0; } #submit { background: url("http://img1.imagesbn.com/pimages/resources/gateway/2011/footer/btn_go.png") no-repeat scroll 0 0 transparent; display: inline-block; height: 32px; text-indent: -10000px; width: 52px; } #submit:hover { background-position: 0 -36px;} #emailInput { display: inline; top: 20px; width:150px; min-width:150px; left: 70px; height:25px; float:left; } #ftr-email { display: block; height: 35px; position: relative; } .ftr-error, .ftr-error2 { margin:2px auto 0; } .ftr-thanks { font: 18px/18px MiloSerifOffcMedium,Georgia,serif; margin: 16px auto 0; width:230px; text-align:center; } #bnf-pod-2a, #bnf-pod-2b, #bnf-pod-2c { top: 45px; } .bnf-pod-country-selector { position: absolute; top: 72px; width: 100%; } .bnf-hz-divider { margin: 15px auto 11px auto; width: 355px; height: 1px; background-color: #cbcfd1; } .bnf-visit-in { padding-right: 15px; font: normal 15px/15px MiloSerifOffcMedium,Georgia,serif; } .bnf-us-link { padding-right: 15px; } .bnf-us-link a { background: url(http://img1.imagesbn.com/pimages/resources/gateway/2011/footer/US_flag.gif) no-repeat; padding-left: 21px; } .bnf-uk-link a { background: url(http://img1.imagesbn.com/pimages/resources/gateway/2011/footer/UK_flag.gif) no-repeat; padding-left: 21px; } @media only screen and (min-width:1212px) { #bnf-pod-1 { width: 331px; } #bnf-pod-2 { width: 477px; } #bnf-pod-2a { left: 55px; } #bnf-pod-2b { left: 200px; } #bnf-pod-2c { left: 350px; } .bnf-hz-divider { width: 403px; } .bnf-visit-in { padding-right: 26px; } .bnf-us-link { padding-right: 26px; } } </style> <div id="bnf-pod-1"> <p class="bnf-pod-header1">Be in the Know</p> <p class="bnf-pod-header2">Sign up for savings, news, updates.</p> <form id="ftr-email" action="#" method="post"> <div class="ftr-text"><input id="emailInput" name="emailInput" placeholder="Enter Your Email Address"> <input class="ftr-go-btn" id="submit" type="image" alt="" src="http://img1.imagesbn.com/gresources/cleardot.gif" name=""></div> <div class="ftr-error" style="display: none;">Please enter a valid email address.</div> <div class="ftr-thanks" style="display: none;">Thank you. A welcome email has been sent.</div> <div class="ftr-button1"></div> </form> </div><!-- end #bnf-pod-1 --> <div id="bnf-pod-div"></div> <div id="bnf-pod-2"> <p class="bnf-pod-header1">NOOK Everywhere</p> <div id="bnf-pod-2a"><a href="http://www.barnesandnoble.com/u/nook-for-iPad/379002216">NOOK for iPad®</a><br><a href="http://www.barnesandnoble.com/u/nook-for-iphone-ipod-touch/379002320">NOOK for iPhone®</a></div> <div id="bnf-pod-2b"><a href="http://www.barnesandnoble.com/u/nook-for-android/379002287">NOOK for Android™</a><br><a href="http://www.barnesandnoble.com/u/nook-for-web/379003594">NOOK for Web™</a></div> <div id="bnf-pod-2c"><a href="http://www.barnesandnoble.com/u/nook-for-windows-8/379003757">NOOK® for Windows 8</a></div> <div class="bnf-pod-country-selector"> <div class="bnf-hz-divider"></div> <div><span class="bnf-visit-in">Visit NOOK in:</span><span class="bnf-us-link"><a href="http://www.barnesandnoble.com/u/nook/379003208">United States</a></span><span class="bnf-uk-link"><a href="http://www.nook.com/gb">United Kingdom</a></span></div> </div> </div><!-- end #bnf-pod-2 --> <div id="bnf-pod-div"></div> <div id="bnf-pod-3"> <p class="bnf-pod-header1">Keep Up with BN's Buzz</p><a class="pod3-fbbn" title="BN Buzz on Facebook" href="http://www.facebook.com/barnesandnoble" target="_blank"></a><a class="pod3-fbnook" title="NOOK Buzz on Facebook" href="http://www.facebook.com/nook" target="_blank"></a><a class="pod3-twbn" title="BN Buzz on Twitter" href="http://twitter.com/bnbuzz" target="_blank"></a><a class="pod3-twnook" title="NOOK Buzz on Twitter" href="http://twitter.com/nookbn" target="_blank"></a> </div><!-- end #bnf-pod-3 --> </div><!-- end #nbf-pods --> <hr class="bnf-horz" /> <div id="bnf-links"> <div class="col-1"> <div class="innerpadding"> <h5>B&N Services</h5><a href="http://www.barnesandnoble.com/help/cds2.asp?PID=8184">About B&N</a> <a href="http://www.barnesandnobleinc.com/for_investors/for_investors.html" target="_blank">Investor Relations</a> <a href="http://www.barnesandnobleinc.com/">Barnes & Noble, Inc.</a> <a href="http://www.barnesandnoble.com/careers">Careers</a> </div></div> <div class="col-2"> <div class="innerpadding"><a href="http://www.barnesandnoble.com/u/bn-advertising/379004185">Advertise</a> <a href="http://www.barnesandnoble.com/help/cds2.asp?PID=8148">Publisher & Author Guidelines</a> <a href="http://www.barnesandnoble.com/u/Membership-Join/379002828">B&N Membership</a> <a href="http://www.barnesandnoble.com/search.asp">Advanced Search</a></div></div> <div class="col-3"> <div class="innerpadding"><a href="http://www.barnesandnoble.com/membership/mc.asp?jp=90">B&N MasterCard</a> <a href="http://www.barnesandnoble.com/offers/offers_cds2.asp?PID=3315">Bulk Order Discounts</a> <a href="http://www.barnesandnoble.com/bookfairs/index.asp">B&N Bookfairs</a> <a href="http://my.barnesandnoble.com/communityportal/userprofile.aspx">My B&N</a> </div></div> <div class="col-4"> <div class="innerpadding"> <h5>Shipping & Delivery</h5><a href="http://www.barnesandnoble.com/help/bn_shipping_flat.asp?PID=33637">About Free Shipping</a> <a href="http://www.barnesandnoble.com/help/cds2.asp?PID=8112">About Shipping</a> <a href="http://www.barnesandnoble.com/help/po_shipping_options.asp">Shipping Rates</a> <a href="http://www.barnesandnoble.com/returns/index.asp">Store Returns</a> </div></div> <div class="col-5"> <div class="innerpadding"> <h5>Quick Help</h5><a href="http://www.barnesandnoble.com/help/help.asp">Customer Service</a> <a href="http://www.barnesandnoble.com/help/cds2.asp?PID=8139">Order Status</a> <a href="http://www.barnesandnoble.com/returns/index.asp">Easy Returns</a> <a href="http://www.barnesandnoble.com/u/product-recalls/379003558">Product Recalls</a></div></div> <div class="col-6"> <div class="innerpadding"><a href="http://www.barnesandnoble.com/help/help.asp">All Help Topics</a> <a href="http://www.barnesandnoble.com/sitemap/index.asp">Sitemap</a> <a href="http://www.barnesandnoble.com/u/BN-Accessibility-Statement/379003519">Accessibility</a></div></div> </div><!-- end #bnf-links --> <div id="bnf-footlight-cnt1"> <div id="bnf-footlight-cnt2"> <div id="bnf-footlight-lt"><a href="http://www.barnesandnoble.com/include/terms_of_use.asp">Terms of Use</a>, <a href="http://www.barnesandnoble.com/include/nook_store_terms_of_service.asp">NOOK Store Terms</a>, <a href="http://www.barnesandnoble.com/include/copyright.asp">Copyright</a>, and <a href="http://www.barnesandnoble.com/help/cds2.asp?PID=25556">Privacy Policy</a></div> <div id="bnf-footlight-ctr"></div> <div id="bnf-footlight-rt">© 1997-<span id="bnCWYear"></span> Barnesandnoble.com llc</div></div></div> </div><!-- end #bnf-footer --> <!-- Google Code for Remarketing Tag --> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 1026181156; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1026181156/?value=0&guid=ON&script=0"/> </div> </noscript> <!-- Pandora Retargeting Pixel --> <script language="JavaScript" type="text/javascript"> if (typeof ord=='undefined') {ord=Math.random()*10000000000000000;} document.write('<img src="http://ad.doubleclick.net/activity;dc_pixel_url=pand.bfp;dc_seg=143872;ord=' + ord + '?" width="1" height="1" border="0" alt="">'); </script> <noscript> <img src="http://ad.doubleclick.net/activity;dc_pixel_url=pand.bfp;dc_seg=143872;ord=123456789?" width="1" height="1" border="0" alt=""> </noscript></div> </footer> <div> <img src="http://match.xg4ken.com/fbpixel?domain=barnesandnoble.com&cat=books&prod=9780764569104" width="1" height="1" /> <!-- GOOGLE CONVERSION TAG --> <img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/962413977/?label=gMybCKf8jQUQmYv1ygM&guid=ON&script=0&data=ecomm_prodid%3D9780764569104%3Bsite_id%3Dbn%3Becomm_pagetype%3Dproduct"/> <!-- CRITEO Product Tracker --> <img src="http://dis.us.criteo.com/dis/dis.aspx?p1=v%3D2%26wi%3D7712829%26pt1%3D2%26i%3D9780764569104&t1=sendEvent&p=2641&c=2&cb=142500134" width="1" height="1" border="0"/> </div> <div class="page-debug"> </div> <script src="http://img3.imagesbn.com/resources?cb=2.15.5&type=JS&rz=WlYBAOsBaR8mcj0vanMtbWluL2NvcmUvdXRpbGl0eS9kb21yZWFkeQIuanPgAiINd2lkZ2V0cy9zaGFyZWRgLAovaW8tZmFpbHVyZeANKx9jaGVja291dC9lbmhhbmNlZC1wdXJjaGFzZS1vcHRpbwFuc-ANNwZwZW5uYW1lQAcALUAIBi1vdmVybGHgDpEacHJvZHVjdC1wYWdlL3JlcG9ydC1hcy1pbmFwIBoEcHJpYXTgDp-gy4AGBi1mb290ZXKAkQxodHRwOi8vbGlicy5jIRwFbWV0cmljQAsEbS9lbHUhM-AXVEFNBi9ib3QuanM" type="text/javascript"></script> <script type="text/javascript"> window.___gcfg = { parsetags: 'explicit' }; var _gaq = _gaq || []; BN_YUI.use('account-signin-actions', 'event-base-ie', 'scroll-to', 'widget-anim', 'fancy-label', 'account-signin', 'product-marketplace', 'add-to-list', 'event', 'analytics-internaltracking', 'form-toolkit', 'event-hover', 'ajax-updater', 'shared-menu-item', 'bn-overlay', 'bn-event-links', 'node-base', 'review-form', 'overlay', 'performance-metrics', 'form-expando', 'analytics-visualization', 'event-base', 'ajax-form', 'analytics-comscore', 'coremetrics-helper', 'analytics-coremetrics', 'imageloader', 'account-signin-event', 'mixpanel-core', 'analytics', 'gallery-overlay-extras', 'shared-tooltip', 'node', 'yui-throttle', 'scroller-carousel', 'product-image-viewer', 'io-base', 'node-event-delegate', 'get', 'styled-inputs', 'shared-rotator', 'event-custom', function(Y) { (function(Y) { Y.after('domready', function() { var parameters, last, lastPreClickedNode; Y.one('html').removeAttribute('onclick'); if (window.numPreClicks) { lastPreClickedNode = Y.one(window.lastPreClick); if (lastPreClickedNode) { last = lastPreClickedNode.toString(); } parameters = {numPreClicks:window.numPreClicks,lastPreClick:last}; Y.Analytics.Tracker.fire(Y.Analytics.Event.ASYNC, { pageObj:{parameters:parameters} }); } }); })(Y); (function(Y) { var signinActions = new Y.Account.SignInActions(); })(Y); (function(Y) { var n = Y.one('#account-welcome-1'); if (n) { var n_link = n.one('a'); if (n_link) { n_link.on('click', function(e){ Y.Account.signInUser({ popupUrl : "https://www.barnesandnoble.com/signin/popup", triggerStatusChange: true }); e.preventDefault(); }); } if (!n.hasPlugin('ajax')) { Y.on(Y.Account.SIGNIN_STATUS_CHANGE, function(e) { n.plug(Y.Ajax.UpdaterPlugin); n.ajax.update('/navigation/welcome', { justCreatedAccount : ((typeof e !== "undefined") && (e.justCreatedAccount === true)) }); }); } } })(Y); (function(Y) { Y.on('domready', function() { var n = Y.one('#user-links-1 .skip-to-main a'); if (n) { n.on('click', function(e) { var target = Y.one('#mainContent'); if (target) { target.focus(); } }); } else { Y.log('could not find the node for [#user-links-1 .skip-to-main a]'); } }); })(Y); (function(Y) { Y.on('domready', function() { new Y.Shared.Rotator({ boundingBox: '#upsell-promo-1', rotationInterval: 6, rotationTimeout: 1, cssInitClass: 'upsell-promo-init', transitionDuration: 0.25 }); }); })(Y); (function(Y) { Y.Analytics.Tracker.on(Y.Analytics.Event.LOAD, function(obj){ Y.Analytics.Tracker.fire(Y.Analytics.Event.ASYNC, { pageObj : { "parameters" : { "cartMessage" : "spend25getfreeshipping" } } }); }); })(Y); (function(Y) { var n = Y.one('#shopping-cart-content-1'); if (n) { n.plug(Y.Ajax.UpdaterPlugin,{autoUpdateOn:['bag', 'signin', 'coupon']}); } else { Y.log('could not find the node for [#shopping-cart-content-1]'); } })(Y); (function(Y) { var n = Y.one('#shopping-cart-content-1'); if (n) { n.plug(Y.Ajax.UpdaterPluginExtensions.Loader); } else { Y.log('could not find the node for [#shopping-cart-content-1]'); } })(Y); (function(Y) { var navbarNode = Y.one('#horiz-navigation-1'); if (navbarNode) { navbarNode.once('mouseover', function() { navbarNode.plug(Y.Ajax.UpdaterPlugin).ajax.update('/navigation/flyouts'); }); /* Coremetrics Element View Tags */ Y.on('cminit:complete', function(){ var timerID = null; navbarNode.delegate('hover', function(e){ clearTimeout(timerID); timerID = setTimeout(function() { var trackSP = e.currentTarget.getAttribute('data-bntrack'); cmCreateManualImpressionTag('Global_Nav', 'Global_Nav-_-' + trackSP + '-_-HOVER'); }, 750); }, '[data-bntrack-event=view]'); navbarNode.delegate('mouseout', function(e){ clearTimeout(timerID); }, '[data-bntrack-event=view]'); }); } else { Y.log('could not find the navbarNode for [#horiz-navigation-1]'); } })(Y); (function(Y) { var image = Y.one('#rnd-1182221275'), imageParent = image.get('parentNode'), badge = null; imageParent.on('click', function(e) { window.location = "http://www.barnesandnoble.com/sample/read/9780764569104"; }); var button = Y.Node.create('<a class="open-reader hide" id="rnd-1182221275-reader-btn" title="Read Instantly" href="http://www.barnesandnoble.com/sample/read/9780764569104" data-bntrack="OpenReaderButton"><span>OPEN READER</span></a>'); imageParent.appendChild(button); var timer = null; image.on('mouseover', function(e){ clearTimeout(timer); button.removeClass('hide'); }); image.on('mouseout', function(e){ timer = setTimeout(function(){ button.addClass('hide'); }, 50); }); button.on('mouseover', function(e){ clearTimeout(timer); e.preventDefault(); }); })(Y); (function(Y) { BN_YUI.productImageGroup = new Y.ImgLoadGroup({ foldDistance: 100 }); })(Y); (function(Y) { var heroImg, heroImgSrc, heroImgHeight, heroImgWidth, findThumbBlock = function(el) { return el.hasClass('thumb'); }; Y.all('#product-image-smaller-1 .product-thumbs .thumb.image img').each(function(img) { Y.after('domready', function() { var loaderImage = new Image(); loaderImage.src = img.getData('hero-src'); }); img.ancestor(findThumbBlock).on( 'hover', function() { if (!heroImg) { heroImg = Y.one('#rnd-1182221275'), heroImgSrc = heroImg.get('src'); heroImgHeight = heroImg.getComputedStyle('height'); heroImgWidth = heroImg.getComputedStyle('width'); } heroImg.set('src', img.getData('hero-src')); heroImg.setStyle('height', img.getData('hero-height')); heroImg.setStyle('width', img.getData('hero-width')); }, function() { heroImg.set('src', heroImgSrc); heroImg.setStyle('height', heroImgHeight); heroImg.setStyle('width', heroImgWidth); } ); }); })(Y); (function(Y) { var imageBlock = Y.one('#product-image-smaller-1 .image-block'); if (imageBlock) { imageBlock.setStyle('cursor', 'pointer'); } Y.one('#product-image-smaller-1').once('mouseover', function(e) { new Y.Product.ImageViewer({ srcNode: Y.one('#product-image-smaller-1-viewer'), hostNode: Y.one('#product-image-smaller-1') }); }); })(Y); (function(Y) { Y.after('domready',function() { var n = Y.one('#facebook-like-button-rnd-207687426'); if(!n) return; var iframe = Y.Node.create('<iframe />'); iframe.setAttrs({ src: 'http://www.facebook.com/plugins/like.php?href=http://www.barnesandnoble.com/w/xpath-20-programmers-reference-michael-kay/1102333960&send=true&layout=button_count&width=90&show_faces=false&action=like&colorscheme=light&font=arial&height=21', scrolling: 'no', frameBorder: '0', allowTransparency: 'true' }); iframe.setStyles({ border: 'none', overflow: 'hidden', width: '90px', height: '21px' }); iframe.appendTo(n); }); })(Y); (function(Y) { Y.after('domready', function() { Y.Get.script('//apis.google.com/js/plusone.js', function() { if (typeof gapi !== 'undefined' && gapi && gapi.plusone) { gapi.plusone.render('g-plusone-rnd-1778661250', { size: "medium", count: true }); } }); }); })(Y); (function(Y) { var pins = Y.all('a.pin-it-button'); pins.on('click', function(e){ var win, href = e.currentTarget.getAttribute('href'); e.preventDefault(); win = window.open(href, 'Pinterest','location=no,menubar=no,status=no,toolbar=no,width=675,height=400'); if(window.focus){ win.focus(); } }); })(Y); (function(Y) { Y.on('domready',function(){ var addAction = function() { var node = Y.one('#add-to-list-link-rnd-55809971'), eHandle = null, n_widget = Y.one('#add-to-list-1'), newNode, listid; eHandle = node.on('click',function(e){ e.preventDefault(); Y.Account.signInUser().once(Y.Account.SIGNED_IN, function(evt){ eHandle.detach(); oldRefHook = e.target.ancestor('li').getAttribute('data-bn-index') || e.target.getAttribute('class').split(' '); n_widget.ajax.update('http://www.barnesandnoble.com/community/customerlists?ean=9780764569104', { action : 'COMMUNITY.MYLIBRARY.ADDITEM'}).once('ajax:updated', function(){ newNode = n_widget.one('[data-bn-index="'+oldRefHook+'"] > a'); if(!newNode) { newNode = n_widget.one('.'+oldRefHook); } listid = newNode.getAttribute('data-bn-listid'); Y.log('listid' + listid); newNode.plug(Y.Plugin.AddToList,{ url: 'http://www.barnesandnoble.com/community/mylibrary/add', ean: '9780764569104', id: listid, csrfToken: 'YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3', failure: function() { addAction.call(); }, success: function(){ newNode.setHTML('Added to ' + newNode.getHTML()); } }); newNode.addToList.add(); newNode.on('click', function(e) {e.stopImmediatePropagation();}) }); }); }, this); }; addAction.call(); }); })(Y); (function(Y) { Y.on('domready',function(){ var addAction = function() { var node = Y.one('#add-to-list-link-rnd-55809972'), eHandle = null, n_widget = Y.one('#add-to-list-1'), newNode, listid; eHandle = node.on('click',function(e){ e.preventDefault(); Y.Account.signInUser().once(Y.Account.SIGNED_IN, function(evt){ eHandle.detach(); oldRefHook = e.target.ancestor('li').getAttribute('data-bn-index') || e.target.getAttribute('class').split(' '); n_widget.ajax.update('http://www.barnesandnoble.com/community/customerlists?ean=9780764569104', { action : 'COMMUNITY.FAVORITES.ADDITEM'}).once('ajax:updated', function(){ newNode = n_widget.one('[data-bn-index="'+oldRefHook+'"] > a'); if(!newNode) { newNode = n_widget.one('.'+oldRefHook); } listid = newNode.getAttribute('data-bn-listid'); Y.log('listid' + listid); newNode.plug(Y.Plugin.AddToList,{ url: 'http://www.barnesandnoble.com/community/favorites/add', ean: '9780764569104', id: listid, csrfToken: 'YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3', failure: function() { addAction.call(); }, success: function(){ newNode.setHTML('Added to ' + newNode.getHTML()); } }); newNode.addToList.add(); newNode.on('click', function(e) {e.stopImmediatePropagation();}) }); }); }, this); }; addAction.call(); }); })(Y); (function(Y) { Y.on('domready',function(){ var addAction = function() { var node = Y.one('#add-to-list-link-rnd-55809973'), eHandle = null, n_widget = Y.one('#add-to-list-1'), newNode, listid; eHandle = node.on('click',function(e){ e.preventDefault(); Y.Account.signInUser().once(Y.Account.SIGNED_IN, function(evt){ eHandle.detach(); oldRefHook = e.target.ancestor('li').getAttribute('data-bn-index') || e.target.getAttribute('class').split(' '); n_widget.ajax.update('http://www.barnesandnoble.com/community/customerlists?ean=9780764569104', { action : 'COMMUNITY.WISHLIST.ADDITEM'}).once('ajax:updated', function(){ newNode = n_widget.one('[data-bn-index="'+oldRefHook+'"] > a'); if(!newNode) { newNode = n_widget.one('.'+oldRefHook); } listid = newNode.getAttribute('data-bn-listid'); Y.log('listid' + listid); newNode.plug(Y.Plugin.AddToList,{ url: 'http://www.barnesandnoble.com/community/wishlist/add', ean: '9780764569104', id: listid, csrfToken: 'YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3', failure: function() { addAction.call(); }, success: function(){ newNode.setHTML('Added to ' + newNode.getHTML()); } }); newNode.addToList.add(); newNode.on('click', function(e) {e.stopImmediatePropagation();}) }); }); }, this); }; addAction.call(); }); })(Y); (function(Y) { Y.on('domready',function(){ var addAction = function() { var node = Y.one('#add-to-list-link-rnd-55809974'), eHandle = null, n_widget = Y.one('#add-to-list-1'), newNode, listid; eHandle = node.on('click',function(e){ e.preventDefault(); Y.Account.signInUser().once(Y.Account.SIGNED_IN, function(evt){ eHandle.detach(); oldRefHook = e.target.ancestor('li').getAttribute('data-bn-index') || e.target.getAttribute('class').split(' '); n_widget.ajax.update('http://www.barnesandnoble.com/community/customerlists?ean=9780764569104', { action : 'COMMUNITY.READINGNOW.ADDITEM'}).once('ajax:updated', function(){ newNode = n_widget.one('[data-bn-index="'+oldRefHook+'"] > a'); if(!newNode) { newNode = n_widget.one('.'+oldRefHook); } listid = newNode.getAttribute('data-bn-listid'); Y.log('listid' + listid); newNode.plug(Y.Plugin.AddToList,{ url: 'http://www.barnesandnoble.com/community/readingnow/add', ean: '9780764569104', id: listid, csrfToken: 'YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3', failure: function() { addAction.call(); }, success: function(){ newNode.setHTML('Added to ' + newNode.getHTML()); } }); newNode.addToList.add(); newNode.on('click', function(e) {e.stopImmediatePropagation();}) }); }); }, this); }; addAction.call(); }); })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ srcNode: '#bn-overlay-add-to-list-myess' }); })(Y); (function(Y) { Y.on('domready', function() { var overlay = Y.Shared.BNOverlay.getById('add-to-list-myess'), n_form = Y.one('form#add-to-list-myess'), n_submit = n_form.one('button[type="submit"]'), n_overlay, custom_lists_widget; Y.one('#add-to-list-myess-trigger-rnd-55809975').on('click',function(e) { e.preventDefault(); Y.Account.signInUser().once(Y.Account.SIGNED_IN, function(event){ custom_lists_widget = Y.one('#custom-lists-1'); custom_lists_widget.plug(Y.Ajax.UpdaterPlugin); custom_lists_widget.ajax.update().once('ajax:updated', function(){ overlay = Y.Shared.BNOverlay.getById('add-to-list-myess'); n_overlay = Y.one('#add-to-list-myess'); overlay.show(); clearErrors(); }); }); }); function clearErrors() { n_form.all('input').removeClass('error'); n_form.all('.error-box').addClass('hidden'); n_form.all('[data-bn-errorType]').addClass('hide'); overlay.fit(); } overlay.on('widget:hide', function(e) { n_form.reset(); clearErrors(); }); n_submit.on('click', function(e) { e.preventDefault(); clearErrors(); var n_input = n_form.one('input[type="text"]'), n_value = n_input && n_input.get('value') ? Y.Lang.trim(n_input.get('value')) : '', n_error = n_form.one('.error-box'), isEmpty = n_value.length == 0, isUnsupported = n_input.get('value').match(/[^\w\d\s\\?]/g); if (isEmpty || isUnsupported) { if(isUnsupported) { n_form.all("[data-bn-errorType='invalidChars']").removeClass('hide'); } if(isEmpty) { n_form.all("[data-bn-errorType='emptyChars']").removeClass('hide'); } n_input.addClass('error'); n_error.removeClass('hidden'); overlay.fit(); return; } n_form.plug(Y.Plugin.AddToList, { success: function() { var n_widget = Y.one('#add-to-list-1'); overlay.hide().on('widget:hide', function(e) { n_widget.plug(Y.Ajax.UpdaterPlugin); n_widget.ajax.update('http://www.barnesandnoble.com/community/customerlists?ean=9780764569104'); }); }, failure: function() { overlay.hide(); } }); n_form.addToList.newList(); }); }); })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ srcNode: '#bn-overlay-add-to-list-mywish' }); })(Y); (function(Y) { Y.on('domready', function() { var overlay = Y.Shared.BNOverlay.getById('add-to-list-mywish'), n_form = Y.one('form#add-to-list-mywish'), n_submit = n_form.one('button[type="submit"]'), n_overlay, custom_lists_widget; Y.one('#add-to-list-mywish-trigger-rnd-55809977').on('click',function(e) { e.preventDefault(); Y.Account.signInUser().once(Y.Account.SIGNED_IN, function(event){ custom_lists_widget = Y.one('#custom-lists-1'); custom_lists_widget.plug(Y.Ajax.UpdaterPlugin); custom_lists_widget.ajax.update().once('ajax:updated', function(){ overlay = Y.Shared.BNOverlay.getById('add-to-list-mywish'); n_overlay = Y.one('#add-to-list-mywish'); overlay.show(); clearErrors(); }); }); }); function clearErrors() { n_form.all('input').removeClass('error'); n_form.all('.error-box').addClass('hidden'); n_form.all('[data-bn-errorType]').addClass('hide'); overlay.fit(); } overlay.on('widget:hide', function(e) { n_form.reset(); clearErrors(); }); n_submit.on('click', function(e) { e.preventDefault(); clearErrors(); var n_input = n_form.one('input[type="text"]'), n_value = n_input && n_input.get('value') ? Y.Lang.trim(n_input.get('value')) : '', n_error = n_form.one('.error-box'), isEmpty = n_value.length == 0, isUnsupported = n_input.get('value').match(/[^\w\d\s\\?]/g); if (isEmpty || isUnsupported) { if(isUnsupported) { n_form.all("[data-bn-errorType='invalidChars']").removeClass('hide'); } if(isEmpty) { n_form.all("[data-bn-errorType='emptyChars']").removeClass('hide'); } n_input.addClass('error'); n_error.removeClass('hidden'); overlay.fit(); return; } n_form.plug(Y.Plugin.AddToList, { success: function() { var n_widget = Y.one('#add-to-list-1'); overlay.hide().on('widget:hide', function(e) { n_widget.plug(Y.Ajax.UpdaterPlugin); n_widget.ajax.update('http://www.barnesandnoble.com/community/customerlists?ean=9780764569104'); }); }, failure: function() { overlay.hide(); } }); n_form.addToList.newList(); }); }); })(Y); (function(Y) { Y.on('domready',function(){ var n_trigger = Y.one('#menu-item-trigger-rnd-55809979'); if (!n_trigger) { return; } n_trigger.once('opened',function(){ BN_YUI.use('node','ajax-updater',function(Y){ var n_widget = Y.one('#add-to-list-1'); n_widget.plug(Y.Ajax.UpdaterPlugin); n_widget.ajax.update('http://www.barnesandnoble.com/community/customerlists?ean=9780764569104'); }); }); n_trigger.once('mouseover', function(e) { var m = new Y.Shared.MenuItem({ n_content: Y.one('#menu-item-overlay-rnd-55809979'), n_trigger: n_trigger }); m.render(); m.onMouseover(); }); }); })(Y); (function(Y) { Y.after('domready',function(){ setTimeout(function(){ Y.one('#product-share-1').addClass('show'); }, 1000); }); })(Y); (function(Y) { var inlineReviews = Y.one('.product-reviews'); if (inlineReviews) { Y.all('.review-status a').on('click', function(e) { e.preventDefault(); Y.ScrollTo.Node(inlineReviews); }); } })(Y); (function(Y) { Y.all('.fade-to-more').each(function(ftmEl) { if (!ftmEl.processed) { Y.on('domready', function() { var contentEl = ftmEl.one('.content'); if (contentEl.get('scrollHeight') === contentEl.get('offsetHeight')) { ftmEl.all('.fade, .trigger').remove(true); } }); ftmEl.all('.trigger').on('click', function(e) { e.preventDefault(); ftmEl.toggleClass('expanded'); if (ftmEl.getY() < (document.body.scrollTop || window.pageYOffset || document.documentElement.scrollTop)) { Y.ScrollTo.Node(ftmEl, {padding: 50}); } }); ftmEl.processed = true; } }); })(Y); (function(Y) { Y.one('#product-commentary-snippet-1 .read-more').on('click', function(e) { e.preventDefault(); Y.ScrollTo.Node('#product-commentaries-1'); }); })(Y); (function(Y) { Y.on('domready', function(){ var n_overlay = Y.one("#product-purchase-1-pickup-overlay"), n_trigger = Y.one("#product-purchase-1 .overlay-trigger"), n_attributeForm = Y.one('#product-purchase-1-form'), overlay; if (n_attributeForm) { n_attributeForm.plug(Y.StyledInputs.Plugin.Form); n_attributeForm.one('select').on('change', function(e) { window.location.assign(e.target.get('value')); }); }; if(!n_overlay) return; n_overlay.remove(false); overlay = new Y.Overlay({ srcNode : n_overlay, width : '240px', zIndex : 10000, constrain : false, render : false, visible : false, plugins : [ Y.Plugin.WidgetAnim, Y.Plugin.OverlayKeepaligned ] }); n_overlay.removeClass('hide'); n_trigger.on('click', function(e) { e.preventDefault(); if (!overlay.get('rendered')) { overlay.render(Y.one('body')); } Y.Global.fire('overlay:closeall'); overlay.set("align", { node: n_trigger, points: ['tr', 'br'] }); overlay.show(); }); Y.Global.on('overlay:closeall', function(){ overlay.hide();}); n_overlay.all('.close').on('click', function(e) { e.preventDefault(); overlay.hide(); Y.Global.detach('overlay:closeall'); }); }); })(Y); (function(Y) { Y.one('#marketplace-close-1 .close').addClass('clickable').on('click', function() { Y.fire('ajax-close:marketplace-listings'); }); })(Y); (function(Y) { Y.one('#marketplace-sort-by-1 select').plug(Y.StyledInputs.Plugin.Select); })(Y); (function(Y) { Y.on('domready', function() { var disableButton = function(e) { var button = e.target.one('button'); button.setAttribute('disabled', 'true'); setTimeout(function(){ button.removeAttribute('disabled'); }, 5000); }; Y.all('.instant_purchase_form').on('submit', function(e){ disableButton(e); }); if (Y.MixPanel.initialized) { window.mixpanel.register({'test cell': '' }, 'all'); window.mixpanel.track_forms('form#instant_purchase_form_rnd-944904018', Y.MixPanel.EventNames.addToBag, { 'url' : window.location.href, 'page type' : 'product.view.book', 'ean' : '2690841227360', 'work id' : '1102333960', 'product title' : 'Xpath 2.0 Programmer\'s Reference (Programmer to Porgrammer Series)', 'store subject' : 'USED', 'category ids' : '', 'promo ids' : '', 'product code' : 'MP', 'product subtype code' : '', 'format code' : 'TP', 'unit price' : '$34.99' }); } Y.all('.instant_purchase_form input[type="checkbox"]').plug(Y.StyledInputs.Plugin.Checkbox); }); })(Y); (function(Y) { Y.CoremetricsHelper.Productview(Y.one('#instant_purchase_form_rnd-944904018 button')); })(Y); (function(Y) { Y.all('.marketplace-conditions-trigger').on('click', function(e) { e.preventDefault(); Y.Shared.BNOverlay.getById('marketplace-conditions').show(); }); })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ srcNode: '#bn-overlay-marketplace-conditions' }); })(Y); (function(Y) { Y.CoremetricsHelper.Productview(Y.one('#instant_purchase_form_rnd-277581681 button')); })(Y); (function(Y) { Y.CoremetricsHelper.Productview(Y.one('#instant_purchase_form_rnd-2058573211 button')); })(Y); (function(Y) { var node = Y.one('#marketplace-results-1'); node.all('.show-more').on('click', function(e) { e.currentTarget.get('parentNode').addClass('open'); }); node.all('.show-less').on('click', function(e) { e.currentTarget.get('parentNode').removeClass('open'); }); })(Y); (function(Y) { Y.one('#marketplace-close-2 .close').addClass('clickable').on('click', function() { Y.fire('ajax-close:marketplace-listings'); }); })(Y); (function(Y) { Y.one('#marketplace-sort-by-2 select').plug(Y.StyledInputs.Plugin.Select); })(Y); (function(Y) { Y.once('BuyBox:render', function(e) { new Y.Marketplace.Listings({ srcNode: '#marketplace-listings-1', boundingBox: '#marketplace-listings-1', condition: 'new', ean: '9780764569104', sort: 'PA', url: 'http://www.barnesandnoble.com/product/marketplace/listingsearch' }); }); })(Y); (function(Y) { var bb = new Y.Marketplace.BuyBox({ srcNode: '#marketplace-buy-box-slim-1', boundingBox: '#marketplace-buy-box-slim-1', ean: '' }); })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ srcNode: '#bn-overlay-request-as-nook-book' }); })(Y); (function(Y) { var reqOverlay = Y.Shared.BNOverlay.getById('request-as-nook-book'), successMsg = "Thank you. We've notified the publisher that you'd like this book in ebook format.", failureMsg = "We're sorry. We are experiencing technical difficulties at this time. Please try again later."; Y.on('domready', function() { Y.one('#request-as-nook-book-1 .note a').on('click', function(e) { e.preventDefault(); reqOverlay.show(); var url = Y.one('#request-as-nook-book-1 form').getAttribute('action'); var onDone = function(didSucceed) { if (didSucceed) { Y.one('#request-as-nook-book-1 .note').replaceClass('pre', 'post'); reqOverlay.setStdModContent('body', successMsg, 'replace'); } else { reqOverlay.setStdModContent('body', failureMsg, 'replace'); } }; var timeout = 20000; if (!timeout || !Y.Lang.isNumber(timeout)) { timeout = 20000; } var cfg = { method: 'POST', data: { ean: 9780764569104, csrfToken: 'YJCA5tYKHEnKEw1SMFK1paB3FTuBTZE3' }, timeout: timeout, on: { success: function(x, o) { try { var r = Y.JSON.parse(o.responseText); if (r && r.ebookrequest && r.ebookrequest.success === true) { onDone(true); } else { onDone(false); } } catch(e) { onDone(false); } }, failure: function(x, o) { onDone(false); } } }; Y.io(url, cfg); }); }); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-1419982407', srcUrl: 'http://img1.imagesbn.com/p/9780596009748_p0_v1_s114x166.JPG', width: '114', height: '150'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-1342205638', srcUrl: 'http://img1.imagesbn.com/p/9780596002916_p0_v1_s114x166.JPG', width: '114', height: '150'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-1244951187', srcUrl: 'http://img1.imagesbn.com/p/9781590593240_p0_v2_s114x166.JPG', width: '114', height: '151'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-903678592', srcUrl: 'http://img2.imagesbn.com/p/9780321165817_p0_v2_s114x166.JPG', width: '114', height: '151'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-710898017', srcUrl: 'http://img1.imagesbn.com/p/9781558607118_p0_v1_s114x166.JPG', width: '114', height: '141'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-1118150915', srcUrl: 'http://img2.imagesbn.com/p/9780596007645_p0_v1_s114x166.JPG', width: '111', height: '166'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-1683553472', srcUrl: 'http://img1.imagesbn.com/p/9780672323188_p0_v1_s114x166.jpg', width: '114', height: '141'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-799296059', srcUrl: 'http://img2.imagesbn.com/p/9780321180605_p0_v1_s114x166.jpg', width: '114', height: '151'}); })(Y); (function(Y) { BN_YUI.productImageGroup.registerImage({domId: 'rnd-835853543', srcUrl: 'http://img1.imagesbn.com/p/9780596003272_p0_v1_s114x166.JPG', width: '114', height: '150'}); })(Y); (function(Y) { var productTileSrc = Y.one('#cwbtab-carousel-1 .scroller'), productTileCarousel = new Y.Scroller.Carousel({ srcNode: productTileSrc, boundingBox: productTileSrc, contentBox: productTileSrc.one('.content') }); })(Y); (function(Y) { Y.after('domready', function() { var ts = Y.Lang.now(), src = 'http://ad.doubleclick.net\/N9885823\/adi\/lia.barnesandnoble\/prod\/books\/computers;member=F;lo=mid;s=bn;EAN=9780764569104;redflag=0;prod=books;sz=300x250;' + 'ord=' + (ts + Math.floor(Math.random() * ts)) +'?'; Y.Node.create('<iframe />').setAttrs({ src: src, width: '300', height: '250', frameBorder: '0', marginwidth: '0', marginheight: '0', hspace: '0', vspace: '0', scrolling: 'no', bordercolor: '#000000' }).appendTo(Y.one('#adsense-medium-rectangle-1')); }); })(Y); (function(Y) { Y.all('ul.componentHeaders li a').each(function(a) { a.on('click',function(e){ e.preventDefault(); Y.ScrollTo.Node(a.getAttribute('href')); }); }); })(Y); (function(Y) { if (Y.UA.ie && Y.UA.ie < 9) { function checkStar(e) { var i, starsDisplay, star = e.currentTarget; if (star) { starsDisplay = star.get('parentNode').one('.stars-large'); for (i = 0; i <= 5; i++) { starsDisplay.removeClass('r' + i); } starsDisplay.addClass('r' + star.get('value')); } } Y.all('.stars-interactive').each(function(starsInteractive) { starsInteractive.delegate(['click', 'mouseover'], checkStar, '.star'); starsInteractive.delegate('mouseout', function(e) { var starsDisplay = starsInteractive.one('.stars-large'); starsInteractive.all('input[type=radio]').each(function(el) { starsDisplay[(el.get('checked') ? 'add' : 'remove') + 'Class']('r' + el.get('value')); }); }, '.star'); checkStar({currentTarget: starsInteractive.one('.star:checked')}); }); } })(Y); (function(Y) { function rate(e) { var star = e.currentTarget, ean = star.ancestor('[data-ean]').getData('ean'); Y.io('/reviews/submitrating/' + ean + '/' + star.get('value'), { method: 'POST' }); } Y.all(".submit-rating .stars-interactive").each(function(stars) { stars.delegate("click", rate, '.star') }); })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ width: 700, srcNode: '#bn-overlay-review-guidelines' }); })(Y); (function(Y) { Y.on('domready', function() { var tBox, anonymousCheckBox, createLink, createPenNameHandler; tBox = Y.one('#reviews-write-a-review-1-expandme').plug(Y.FormToolkit.CharacterCountdown, { goRed : true, charCount: 3500, showRowCount: false, showRemainder : true, cssClassName : null }).plug(Y.FormToolkit.Expando, { }).previous().plug(Y.Plugin.FancyLabel); createPenNameHandler = function(e){ e.preventDefault(); this.checkSignInStatus(function(){ this.updateState(function(){ if(this.hasPenName()){ this.updatePenName(); } else { Y.Shared.BNOverlay.getById('pen-name-overlay').show(); } }, this); }, this); }; anonymousCheckBox = Y.one('#penNameAnonymousCheck').plug(Y.StyledInputs.Plugin.Checkbox); anonymousCheckBox.on('click', function(e){ var isChecked = e.target.get('checked'); if(createLink){ if(isChecked){ createLink.disable(); } else { createLink.enable(); } } }); createLink = Y.one('#createAPenNameOpen'); var InPageReview = new Y.Community.ReviewForm({ id : 'reviews-write-a-review-1', signedIn : false, anonymousCheckBox : anonymousCheckBox, createPenNameLink : createLink, ean : '9780764569104', Account : Y.Account }); if(createLink){ createLink.disable = function(){ this.addClass('disable'); this.detach(); this.on('click', function(e){ e.preventDefault(); Y.log('Create pen name link disabled when anonymous checkbox is selected', 'info', 'PenNameOverlay'); }); }; createLink.enable = function(){ this.removeClass('disable'); this.on('click', createPenNameHandler, InPageReview); }; createLink.on('click', createPenNameHandler, InPageReview); } Y.one('#reviews-write-a-review-1 .guidelines-trigger').on('click',function(e){ e.preventDefault(); Y.Shared.BNOverlay.getById('review-guidelines').show(); }); }); })(Y); (function(Y) { var n = Y.one('#search-results-1'); if (n) { n.plug(Y.Ajax.UpdaterPluginExtensions.Loader); } else { Y.log('could not find the node for [#search-results-1]'); } })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ width: 900, srcNode: '#bn-overlay-add-recommendations' }); })(Y); (function(Y) { var recData = [], parentLayout = Y.one('#reviews-add-recommendations-1').ancestor('[data-bn-widget-name=reviews-write-a-review]'), populatedTemplate = '<li data-key="{key}">' + '<div class="product"><img src="{imgSrc}" class="recommendation-img"/><span class="remove-recommendation"> </span></div>' + '<input type="hidden" name="review.recommendations[{key}].ean" value="{ean}"/>' + '<input type="hidden" name="review.recommendations[{key}].productCode" value="{productCode}"/>' + '</li>', emptyTemplate = '<li><div class="product empty recommendations-trigger">Add Item</div></li>', overlay = Y.Shared.BNOverlay.getById('add-recommendations'), writeReviewNode = Y.one(".writeReview"), processRecommendations = function() { var i, recommendationsList = Y.one("#review-recommendations-list"); recommendationsList.setContent(""); for (i = 0; i <= 4; i++) { if (!recData[i]) { recommendationsList.append(emptyTemplate); } else { recommendationsList.append(Y.Lang.sub(populatedTemplate, Y.merge(recData[i].product, {key: i}))); } }; }; /* show search overlay */ parentLayout.delegate('click', function(e) { e.preventDefault(); var currentRec = e.currentTarget.get('parentNode').getAttribute('data-bn-recommendation'); if (currentRec == "none") { Y.one('#review-recommendations .initial').hide(); Y.all('#review-recommendations .secondary').removeClass('hidden'); processRecommendations(); } overlay.show(); }, '.recommendations-trigger'); overlay.once('widget:show', function() { var searchResultsArea = overlay.bodyNode.one('.search-results-area'); /* hard to get this via CSS */ overlay.get('boundingBox').setStyle('overflow', 'hidden'); /* search for recs */ overlay.bodyNode.one('form').on('submit', function(e) { e.preventDefault(); Y.Ajax.Form.submit({ node: e.currentTarget, container: searchResultsArea, actionButtons: overlay.bodyNode.all('button, a') }).on('success', function() { searchResultsArea.addClass('search-results-area-expanded'); }); }); /* add recs */ searchResultsArea.delegate('click', Y.throttle(function(e) { e.preventDefault(); var xy = parentLayout.getXY(); var displayTileItem = e.currentTarget.ancestor('.display-tile-item'); var arrayKey = displayTileItem.getAttribute('data-bn-ean'); var prodCode = displayTileItem.getAttribute('data-product-code'); var imgSrcKey = displayTileItem.one('img.product-image').getAttribute('src'); recData.push({ product: { ean : arrayKey, productCode : prodCode, imgSrc : imgSrcKey } }); overlay.hide(); window.scrollTo(xy[0], xy[1]); processRecommendations(); }, 250), 'a'); }); /* remove recs */ if (writeReviewNode) { writeReviewNode.delegate('click', function(e){ var position = Number(e.currentTarget.ancestor('[data-key]').getData('key')), tempRec = recData; e.preventDefault(); recData = tempRec.slice(0,position).concat( tempRec.slice(position+1) ); processRecommendations(); }, '.remove-recommendation'); } })(Y); (function(Y) { Y.on('domready',function() { new Y.Shared.Tooltip.Init({ n_trigger: Y.one('#tooltip-trigger-rnd-55809981'), n_message: Y.one('#tooltip-message-rnd-55809981'), width: '270', align: 'auto', action: 'hover', hideAction: 'blur' }); }); })(Y); (function(Y) { Y.on('domready',function() { new Y.Shared.Tooltip.Init({ n_trigger: Y.one('#tooltip-trigger-rnd-55809982'), n_message: Y.one('#tooltip-message-rnd-55809982'), width: '270', align: 'auto', action: 'hover', hideAction: 'blur' }); }); })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ srcNode: '#bn-overlay-pen-name-overlay' }); Y.fire('overlay-creation:pen-name'); })(Y); (function(Y) { var overlay = new Y.Shared.BNOverlay({ srcNode: '#bn-overlay-report-as-inappropriate' }); Y.all(".report-as-inappropriate .note a").on("click", function(e) { e.preventDefault(); overlay.show(); }); })(Y); (function(Y) { Y.after('domready', function() { var n = Y.one('#google-content-text-ad-iframe-1'); if(!n) return; var iframe = Y.Node.create('<iframe />'); iframe.setAttrs({ src: 'http://www.barnesandnoble.com/google/ad?url=http%3A%2F%2Fwww.barnesandnoble.com%2Fw%2Fxpath-20-programmers-reference-michael-kay%2F1102333960', width: '600', height: '250', frameBorder: '0', marginwidth: '0', marginheight: '0', hspace: '0', vspace: '0', scrolling: 'no', bordercolor: '#000000' }); iframe.appendTo(n); }); })(Y); (function(Y) { Y.on("domready", function(){ _gaq.push(['_setAccount', 'UA-11110821-1']); _gaq.push(['_setDomainName', '.barnesandnoble.com']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_setAllowHash', false]); _gaq.push(['_trackPageview']); _gaq.push(['_trackPageLoadTime']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); }); })(Y); (function(Y) { var inheritedPgModels = [ { "requestId" : "1398066779", "lastRequestId" : "", "userId" : "EQ1V4xXUmy", "ipAddress" : "54.204.217.249", "pageType" : "product.view.book", "url" : "http://www.barnesandnoble.com/w/xpath-20-programmers-reference-michael-kay/1102333960?ean=9780764569104&itm=1&usri=9780764569104", "siteId" : "0001", "appVersion" : "2.15.5", "environment" : "prodnj", "signedIn" : "false", "isRecognized" : "N", "parameters" : {}, "serverTime" : "1398066779", "isMember" : false, "isFromBorders" : null, "referrer" : "", "userAgent" : "CCBot/2.0 (http://commoncrawl.org/faq/)", "testCell" : "", "testName" : "", "fliteTestName" : "" },{ "pageName": "Product", "pageAware" : true, "parameters" : { "customerAvgStarRating" : "null", "customerReviewCount" : 0, "customerRatingCount" : 0, "parentFormat" : "Paperback", "ean" : "9780764569104", "workid" : 1102333960, "title": "Xpath 2.0 Programmer's Reference (Programmer to Porgrammer Series)", "extendedStoreSubject" : "B1-050QP", "salesRank" : "null", "listPrice" : 34.99, "bnPriceOnline" : 34.99, "freeShippingFlag" : true, "marketplaceFlag" : true, "marketplacePrice" : 18.02, "marketplaceUsedCount" : 4, "marketplaceUsedPrice" : 18.02, "marketplaceNewCount" : 3, "marketplaceNewPrice" : 83.9, "marketplaceRefurbCount" : 0, "marketplaceRefurbPrice" : null, "NOOKEAN" : "9780764577567", "NOOKWorkId" : 1102333960, "NOOKSalesRank" : "null", "NOOKListPrice" : 34.99, "NOOKBNListPrice" : 34.99, "NOOKSampleFlag" : null, "availableParentFormatCount" : 1, "availableDVDFormatCount" : null, "availableChildFormatCount" : 1, "cwbtab-carouselRecommendationCount" : 9, "buyAsEgift" : "0" } } ], pageObj = inheritedPgModels[0], i; for (i = 1; i < inheritedPgModels.length; i++) { pageObj = Y.aggregate(pageObj, inheritedPgModels[i]); } Y.Analytics.Tracker.ECommerceBootstrap(pageObj, { baseUrl: 'http://local.analyticsbn.com:8888', dataCollectionDomain : 'data.coremetrics.com', cmClientId : '90231135', csClientId : '6035001', prettyFormat : true }); /* Performance Metrics */ if (window.performance) { new Y.Performance.Metrics({ percentEnabled: 25, render: true, mixinValues : { requestId : '1398066779', lastRequestId : '', pageType : 'product.view.book', ipAddress : '54.204.217.249', environment : 'prodnj', pageName : pageObj.pageName } }); }; })(Y); });</script> </body> </html>