
<!-- REQUEST ID: TIME=1227288809215:NODE=c2a3404:THREAD=280 -->
<!--!esi:include src="/servlet/ControllerServlet?Action=DisplayESIPage&Currency=GBP&Currency=GBP&ESIHC=4fbf7da0&Env=BASE&Locale=en_GB&SiteID=piestore&SiteID=piestore&ceid=61866500&cename=DRProductInfoJS&content=buyLink+price&id=DRProductInfoJSPage&productID=68148000"-->






<!-- REQUEST ID: TIME=1227288809425:NODE=c2a3404:THREAD=280; ESI Fragment - CREATED: Fri Nov 21 11:33:29 CST 2008 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:68148000,buyLink:{text: "buy now",href: "http://store.digitalriver.com/store/piestore/en_GB/buy/productID.68148000"},price:{taxIncludedInPrice:true,discounted:false,unitPrice:"£69.99",unitPriceWithDiscount:"£69.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 -->
