
<!-- REQUEST ID: TIME=1269135733939:NODE=c2a2004:THREAD=53 -->
  <!--!esi:include src="/servlet/ControllerServlet?Action=DisplayESIPage&Currency=GBP&Currency=EUR&ESIHC=cf998f7f&Env=BASE&Locale=en_GB&SiteID=piestore&ceid=128825300&cename=DRProductInfo&content=name&id=DRProductInfoJSPage&productID=105149800"-->







<!-- REQUEST ID: TIME=1269135734070:NODE=c2a2004:THREAD=53; ESI Fragment - CREATED: Sat Mar 20 20:42:14 CDT 2010 MAX-AGE: 50400+180 -->









  
  
    /* Digital River ProductInfo Widget */
    /* HTML Output */
    
    
    
    
    
      
      
        
        (function(){
          
          var jsonData = {productInfo:{product:{productID:105149800,name:"Studio Plus v.12 Upgrade Download"}}};
          // 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 'name' :
                                piece = tagWrap('dr_productName', data);
                                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 -->
