var snooth_wineRequest;
var snooth_wineURL = "http://syndication.snooth.com/";

function snooth_defaultBlogWines(snooth_wines) {
    "http://www.snooth.com/template/images/snooth_widget_bg.gif";
    var snooth_wineBlock = '<div id="snooth_widget"><div>\
  <style>\
      #snooth_widget { width: 160px; padding: 3px; border: 1px solid #ddd; background: #fff; font: normal 10px "Lucida Grande", Arial, sans-serif; color: #666; line-height: 13px; }\
      #snooth_widget > div { padding: 7px 7px 2px 7px; border: 1px solid #ddd; background: #eee }\
      #snooth_widget a { font: bold 11px "Lucida Grande", Arial, sans-serif; text-decoration: none; color: #aa385d; line-height: 13px; border-bottom: 1px solid #bfd69b; }\
      #snooth_widget a:hover { text-decoration: none; border-bottom: 1px solid #aa385d; }\
              \
      #snooth_widget dl { margin: 6px 0 8px 0; padding: 0 0 9px 0; font: normal 11px "Lucida Grande", Arial, sans-serif; border-bottom: 1px solid #ddd; }\
      #snooth_widget dl dt { float: left; width: 85px; margin: 0; padding: 0; color: #777; }\
      #snooth_widget dl dt.snooth_rank { font-weight: bold; color: #476d29; }\
      #snooth_widget dl dd { float: left; width: 59px; margin: 0; padding: 0; color: #333; }\
      #snooth_widget dl dd.snooth_rank { font-weight: bold; }\
      #snooth_widget div.clear { height: 0; margin: 0; line-height: 0; clear: both; }\
      #snooth_widget img { display: block; padding-left: 52px; }\
      #snooth_widget a.image_link { border: 0px solid #eee; color: #eee; padding: 0px; margin: 0px; }\
  </style>';
    
    var snooth_wine;
    var snooth_count = 0;
    for(var snooth_wineIdx in snooth_wines) {
        if(snooth_count >= snooth_wineCount) {
            break;
        }
        snooth_count++;
        snooth_wine = snooth_wines[snooth_wineIdx];
        snooth_wineBlock += "<a href='" + snooth_wine['link'] + "'>" + snooth_wine['name'] + "</a>  (" + snooth_wine['vintage'] + ")";
        snooth_wineBlock += "<dl>";
        snooth_wineBlock += "<dt class=\"snooth_rank\">SnoothRank:</dt><dd class=\"snooth_rank\">" + snooth_wine['snoothrank'] + "</dd>";
        snooth_wineBlock += "<dt>My Rating:</dt><dd>" + snooth_wine['myRating'] + "</dd>";
        if(snooth_wine['price']) {
        snooth_wineBlock += "<dt>Price:</dt><dd>$" + snooth_wine['price'] + "</dd>";
        }
        snooth_wineBlock += "<div class=\"clear\"></div></dl>";
    }     
    

    snooth_wineBlock += "<a class=\"image_link\" href=\"http://www.snooth.com/\"><img border=\"0\" alt=\"Snooth | Find better wines\" src=\"http://www.snooth.com/template/images/snooth_widget_bg.gif\" /></a></div></div>";
    
    document.getElementById('snooth_winePlaceholder').innerHTML = snooth_wineBlock;
}


function snooth_procWineData() {
    if(typeof snooth_blogWines == "function") {
        snooth_blogWines(snooth_wineData);
    }
    else {
        snooth_defaultBlogWines(snooth_wineData);
    }

}


document.write('<script type="text/javascript" src="' + snooth_wineURL + snooth_hashPath + 'user_' + snooth_userID + '_' + snooth_syndicationContent + '.js" onload="snooth_procWineData();"></script>');
