
<!-- REQUEST ID: TIME=1231387247819:NODE=c2a4203:THREAD=42 -->
<!--!esi:include src="/servlet/ControllerServlet?Action=DisplayESIPage&Currency=EUR&Currency=EUR&ESIHC=f00c3c94&Env=BASE&Locale=es_ES&SiteID=piestore&SiteID=piestore&ceid=63163900&cename=DRProductInfoJS&content=buyLink+price&id=DRProductInfoJSPage&productID=102973500"-->






<!-- REQUEST ID: TIME=1231387248029:NODE=c2a4203:THREAD=42; ESI Fragment - CREATED: Wed Jan 07 22:00:48 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', "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:102973500,buyLink:{text: "comprar ahora",href: "http://store.digitalriver.com/store/piestore/es_ES/buy/productID.102973500"},price:{taxIncludedInPrice:true,discounted:false,unitPrice:"69,99€",unitPriceWithDiscount:"49,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 -->
