
<!-- REQUEST ID: TIME=1269253663408:NODE=c2a4104:THREAD=51 -->
  <!--!esi:include src="/servlet/ControllerServlet?Action=DisplayESIPage&Currency=EUR&ESIHC=cf998f7f&Env=BASE&Locale=it_IT&SiteID=piestore&ceid=128825300&cename=DRProductInfo&content=image&id=DRProductInfoJSPage&productID=156596400"-->







<!-- REQUEST ID: TIME=1269253663478:NODE=c2a4104:THREAD=51; ESI Fragment - CREATED: Mon Mar 22 05:27:43 CDT 2010 MAX-AGE: 50400+180 -->









  
  
    /* Digital River ProductInfo Widget */
    /* HTML Output */
    
    
    
    
    
      
      
        
        (function(){
          
          var jsonData = {productInfo:{product:{productID:156596400,image:{alt:"Pinnacle Studio 14 Ultimate",src:"//drh1.img.digitalriver.com/DRHM/Storefront/Company/piestore/images/product/detail/studio14_ultimate_box.jpg"}}}};
          // 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 'image' :
                            case 'thumbnail' :
                              // Only create the <img> tag when the src exists
                              if (data.src) {
                                piece = '<img src="'+data.src+'" alt="'+data.alt.replace(/\"/g,'&quot;')+'"/>';
                              }
                              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 -->
