
<!-- REQUEST ID: TIME=1227288955118:NODE=c2a3104:THREAD=277 -->
<!--!esi:include src="/servlet/ControllerServlet?Action=DisplayESIPage&Currency=EUR&Currency=EUR&ESIHC=6e2d9fc1&Env=BASE&Locale=es_ES&SiteID=piestore&SiteID=piestore&ceid=61866500&cename=DRProductInfoJS&content=buyLink+price&id=DRProductInfoJSPage&productID=77320300"-->






<!-- REQUEST ID: TIME=1227288955338:NODE=c2a3104:THREAD=277; ESI Fragment - CREATED: Fri Nov 21 11:35:55 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', "Precio normal:", 'span'); productPrice += tagWrap('dr_strikePrice', '<span style="text-decoration:line-through">' + data.unitPrice + '</span>', 'span'); if (data.taxIncludedInPrice) { productPrice += ' ' + tagWrap('lightgray', "IVA incl.", 'span'); } productPrice += '<br/>' + tagWrap('dr_promoPriceLabel', "Precio promocional:", 'span'); } productPrice += tagWrap('dr_actualPrice', data.unitPriceWithDiscount, 'span'); if (data.taxIncludedInPrice) { productPrice += ' ' + tagWrap('lightgray', "IVA incl.", 'span'); } piece = tagWrap('dr_productPrice', productPrice); break; default : piece = '<!--'+data+'-->'; } output += piece; } } return output; } var jsonContent = [{productID:77320300,buyLink:{text: "comprar ahora",href: "http://store.digitalriver.com/store/piestore/es_ES/buy/productID.77320300"},price:{taxIncludedInPrice:true,discounted:false,unitPrice:"29,99€",unitPriceWithDiscount:"9,00€"}}]; 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 -->
