
<!-- REQUEST ID: TIME=1231386129693:NODE=c2a3003:THREAD=40 -->
<!--!esi:include src="/servlet/ControllerServlet?Action=DisplayESIPage&Currency=GBP&Currency=GBP&ESIHC=2c3cfd4&Env=BASE&Locale=en_GB&SiteID=piestore&SiteID=piestore&ceid=63163900&cename=DRProductInfoJS&content=buyLink+price&id=DRProductInfoJSPage&productID=102971500"-->






<!-- REQUEST ID: TIME=1231386129903:NODE=c2a3003:THREAD=40; ESI Fragment - CREATED: Wed Jan 07 21:42:09 CST 2009 MAX-AGE: 50400+180 -->

 (function(){ function tagWrap(className, innerContent, tagName) { tagName = tagName || 'div'; return '<'+tagName+' class="'+className+'">'+innerContent+'</'+tagName+'>'; } function getSwitchOutput(jsonData) { var output = ''; for (var contentName in jsonData) { if (contentName != 'productID') { var data = jsonData[contentName], piece = ''; switch (contentName) { case 'buyLink' : piece = tagWrap('dr_siteButton', '<a href="'+data.href+'">'+data.text+'</a>'); break; case 'price' : productPrice = ''; if (data.discounted) { productPrice += tagWrap('dr_regularPriceLabel', "Regular Price:", 'span'); productPrice += tagWrap('dr_strikePrice', '<span style="text-decoration:line-through">' + data.unitPrice + '</span>', 'span'); if (data.taxIncludedInPrice) { productPrice += ' ' + tagWrap('lightgray', "incl. VAT", 'span'); } productPrice += '<br/>' + tagWrap('dr_promoPriceLabel', "Promo Price:", 'span'); } productPrice += tagWrap('dr_actualPrice', data.unitPriceWithDiscount, 'span'); if (data.taxIncludedInPrice) { productPrice += ' ' + tagWrap('lightgray', "incl. VAT", 'span'); } piece = tagWrap('dr_productPrice', productPrice); break; default : piece = '<!--'+data+'-->'; } output += piece; } } return output; } var jsonContent = [{productID:102971500,buyLink:{text: "buy now",href: "http://store.digitalriver.com/store/piestore/en_GB/buy/productID.102971500"},price:{taxIncludedInPrice:true,discounted:false,unitPrice:"£59.99",unitPriceWithDiscount:"£59.99"}}]; for (var i=0;i<jsonContent.length;i++) { if (jsonContent[i].error) { document.write(tagWrap('dr_error', jsonContent[i].error, 'span')); } else { document.write(tagWrap('dr_productInfoProduct', getSwitchOutput(jsonContent[i]))); } } })(); 


<!--!/esi:include -->
