
<!-- REQUEST ID: TIME=1246707285261:NODE=c2a4103:THREAD=79384 -->
  <!--!esi:include src="/servlet/ControllerServlet?Action=DisplayESIPage&Currency=EUR&ESIHC=72ccee19&Env=BASE&Locale=nl_NL&SiteID=piestore&ceid=82143700&cename=DRProductInfo&content=buyLink+price&id=DRProductInfoJSPage&productID=106861800"-->







<!-- REQUEST ID: TIME=1246707285381:NODE=c2a4103:THREAD=79384; ESI Fragment - CREATED: Sat Jul 04 06:34:45 CDT 2009 MAX-AGE: 50400+180 -->









  
  
    /* Digital River ProductInfo Widget */
    /* HTML Output */
    
    
    
    
    
      
      
        
        (function(){
          
          var jsonData = {productInfo:{product:{productID:106861800,buyLink:{text:"nu kopen",href:"http://store.digitalriver.com/store/piestore/nl_NL/buy/productID.106861800"},price:{taxIncludedInPrice:true,discounted:false,unitPrice:"199,00€",unitPriceWithDiscount:"199,00€"}}}};
          // Continue if at least 1 product exists
          if (jsonData.productInfo.product) {
            // Wrap the content in a certain HTML tag
            function tagWrap(className, innerContent, tagName) {
              tagName = tagName || 'div';
              return '<'+tagName+' class="'+className+'">'+innerContent+'</'+tagName+'>';
            }
            // Determine how to build the HTML for each piece of content
            function getSwitchOutput(productJson) {
              var output = '';
              for (var propertyName in productJson) {
                if (propertyName != 'productID') {
                  var data = productJson[propertyName];
                  if (data) { 
                    var piece = '';
                    switch (propertyName) {
                      
                      
                        
                          
                            
                          
                          
                          
                            
                              
                            
                            
                          
                          
                            
                            
                            
                              
                            
                            
                              
                                case 'buyLink' :
                                  piece = tagWrap('dr_siteButton', '<a href="'+data.href+'">' + data.text + '</a>');
                                  break;
                              
                              
                              
                              
                              
                            
                          
                        
                      
                        
                          
                            
                          
                          
                          
                            
                              
                            
                            
                          
                          
                            
                            
                            
                              
                            
                            
                              
                              
                              
                              
                              
                                case 'price' :
                                  var productPrice = '';
                                  // Strike-through price
                                  if (data.discounted) {
                                    productPrice += tagWrap('dr_regularPriceLabel', "Normale prijs:", 'span');
                                    productPrice += tagWrap('dr_strikePrice', '<span style="text-decoration:line-through">' + data.unitPrice + '</span>', 'span');
                                    if (data.taxIncludedInPrice) {
                                      productPrice += ' ' + tagWrap('lightgray', "incl. btw", 'span');
                                    }
                                    productPrice += '<br/>' + tagWrap('dr_promoPriceLabel', "Actieprijs:", 'span');
                                  }
                                  // Actual (discounted) price
                                  productPrice += tagWrap('dr_actualPrice', data.unitPriceWithDiscount, 'span');
                                  if (data.taxIncludedInPrice) {
                                    productPrice += ' ' + tagWrap('lightgray', "incl. btw", 'span');
                                  }
                                  // Final product price
                                  piece = tagWrap('dr_productPrice', productPrice);
                                  break;
                              
                            
                          
                        
                      
                      default :
                        piece = tagWrap('dr_'+propertyName, data);
                    } 
                    output += piece;
                  } 
                } 
              } 
              return output;
            }
            // Shortcut variable to the product array
            var product = jsonData.productInfo.product;
            // If only 1 product was requested, turn it into an array
            if (product.constructor != Array) {
              product = [product];
            }
            // Write out the content for each product
            for (var i=0;i<product.length;i++) {
              if (product[i].error) {
                document.write(tagWrap('dr_error', product[i].error['#text'], 'span'));
              }
              else {
                document.write(tagWrap('dr_productInfoProduct', getSwitchOutput(product[i])));
              }
            }
          }
        })();
      
    
  


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