var MA_PD_1065292079_widgetRoot = 'http://mawidget.marketamerica.com';
function MA_PD_1065292079_includeCss(path)
{
    var linkElement  = document.createElement('link');
    linkElement.rel = 'stylesheet'
    linkElement.type = 'text/css';
    linkElement.href = path;
    document.getElementsByTagName('head')[0].appendChild(linkElement);
}
if(typeof(window.maJQueryCSSLoaded)=='undefined'){
  MA_PD_1065292079_includeCss(MA_PD_1065292079_widgetRoot + '/ext/jquery/css/ui-lightness/jquery-ui-1.8rc3.custom.css');
  window.maJQueryCSSLoaded=true;
}
if (typeof(window.jQuery) == 'undefined') {
    if(typeof(window.majQueryScriptOutputted)=='undefined'){
        //only output the script once..
        window.majQueryScriptOutputted = true;
        document.write("<scr" + "ipt type=\"text/javascript\" src=\"" + MA_PD_1065292079_widgetRoot + "/ext/jquery/js/jquery-1.4.2.js" + "\"></scr" + "ipt>");
    }
}
if(typeof(window.majQueryUIScriptOutputted)=='undefined'){
    //only output the script once..
    window.majQueryUIScriptOutputted = true;
    document.write("<scr" + "ipt type=\"text/javascript\" src=\"" + MA_PD_1065292079_widgetRoot + "/ext/jquery/js/jquery-ui-1.8rc3.custom.min.js" + "\"></scr" + "ipt>");
}
function MA_PD_1065292079_OpenUrl()
{
    window.open (MA_PD_1065292079_maProductUrl,"mywindow","status=1,toolbar=1, location=1, menubar=1, resizable=1, scrollbars=1, titlebar=1"); 
}
function MA_PD_1065292079_includeJS(path)
{
    var fileref=document.createElement("script");
    fileref.setAttribute("type","text/javascript");
    fileref.setAttribute("src", path);
    if (typeof fileref!="undefined")
        document.getElementsByTagName("head")[0].appendChild(fileref);
}
var MA_PD_1065292079_maRecProductsLoaded = false;
var MA_PD_1065292079_maProdReviewLoaded = false;
var MA_PD_1065292079_maProductUrl = '';
var MA_PD_1065292079_maProductName = '';
var MA_PD_1065292079_SkuBenefits = '';
var MA_PD_1065292079_SkuIngredients = '';
var MA_PD_1065292079_SkuScientificStudies = '';
var MA_PD_1065292079_SkuUnique = '';
var MA_PD_1065292079_SkuFAQ = '';
var MA_PD_1065292079_prefix = 'MA_PD_1065292079_';
function MA_PD_1065292079_LoadRecProducts(product)
{
    if(MA_PD_1065292079_maRecProductsLoaded == true) return;
    var url = 'http://mawidget.marketamerica.com/RP.aspx?prodID=' + product.ProdId + '&portalID=awetech&PCID=58465A73504C54&pType=' + product.PType +'&catIDs=' + product.CategoryIds + '&refEmail=05010A27091A020E232A121C1E190E2E111C0E1E0B24081C43150C26&prdCountry=USA&merchCountry=USA&callback=MA_PD_1065292079_ShowRecProducts';
    MA_PD_1065292079_includeJS(url);
}
function MA_PD_1065292079_ShowRecProducts(jsonData)
{
    if(MA_PD_1065292079_maRecProductsLoaded==true) return;
    var data = eval(jsonData);
    if(data==null|| data.length ==0) return;
    
    var rowData = '';
        rowData += '        <table cellspacing="0" cellpaddin="0" width="100%" height="100%">\n';
    for (var i = 0; i < data.length; i += 3)
    {
        if (i >= 9) break;
        var bProduct = data[i];
        rowData += '        <tr>\n';
        rowData += '            <td width="30%">\n';
        rowData += '               <a href="'+ bProduct.Url + '" target="_blank" title="' + bProduct.Name + '">\n';
        rowData += '                <img src="' + bProduct.Image + '" alt="' + bProduct.Name + '" style="height:75px;width:65px;" title="' + bProduct.Name + '" />\n';
        rowData += '                            </a>\n';
        rowData += '                            <h2><a href="'+ bProduct.Url + '" target="_blank" title="' + bProduct.Name + '">' + bProduct.ShortName + '</a></h2>\n';
        rowData += '            </td>\n';
        rowData += '            <td width="30%">\n';
        if (i + 1 < data.length)
        {
            bProduct = data[i + 1];
            rowData += '               <a href="'+ bProduct.Url + '" target="_blank" title="' + bProduct.Name + '">\n';
            rowData += '                <img src="' + bProduct.Image + '" alt="' + bProduct.Name + '" style="height:75px;width:65px;" title="' + bProduct.Name + '" />\n';
            rowData += '                            </a>\n';
            rowData += '                            <h2><a href="'+ bProduct.Url + '" target="_blank" title="' + bProduct.Name + '">' + bProduct.ShortName + '</a></h2>\n';
        }
        else
        {
            rowData += '                    &nbsp;\n';
        }
        rowData += '            </td>\n';
        rowData += '            <td width="30%">\n';
        if (i + 2 < data.length)
        {
            bProduct = data[i + 2];
            rowData += '               <a href="'+ bProduct.Url + '" target="_blank" title="' + bProduct.Name + '">\n';
            rowData += '                <img src="' + bProduct.Image + '" alt="' + bProduct.Name + '" style="height:75px;width:65px;" title="' + bProduct.Name + '" />\n';
            rowData += '                            </a>\n';
            rowData += '                            <h2><a href="'+ bProduct.Url + '" target="_blank" title="' + bProduct.Name + '">' + bProduct.ShortName + '</a></h2>\n';
        }
        else
        {
            rowData += '                    &nbsp;\n';
        }
        rowData += '            </td>\n';            
        rowData += '        </tr>\n';
    }
        rowData += '        </table>\n';
    jQuery("#MA_PD_1065292079_divMarketAmericaRecProductDetailsWidgetProductList").html(rowData);
    MA_PD_1065292079_maRecProductsLoaded = true;
}
function MA_PD_1065292079_LoadProductReview(product)
{
    if(MA_PD_1065292079_maProdReviewLoaded == true) return;
    var url = 'http://mawidget.marketamerica.com/PR.aspx?prodID=' + product.ProdId + '&pType=' + product.PType + '&callback=MA_PD_1065292079_ShowProductReviews';
    MA_PD_1065292079_includeJS(url);
}
function MA_PD_1065292079_ShowProductReviews(jsonData)
{
    var data = eval(jsonData);
    if(data==null|| data.length ==0) return;
    var displayMsg = 'Displaying ' + data.length + ' Review';
    if(data.length>1) displayMsg = displayMsg + 's';
    jQuery("#MA_PD_1065292079_spanProdReviewCount").html(displayMsg);
    var rowData = '';
        rowData += '        <table id="MA_PD_1065292079_tableMarketAmericaProductDetailsWidgetReviews" class="tableMarketAmericaProductDetailsWidgetReviews" width="100%" height="100%">\n'
    for (var i = 0; i < data.length; i++)
    {
        var reviewItem = data[i];
        rowData += '            <tr>\n';
        rowData += '                <td width="40">\n';
        rowData += '                    <a href="' + MA_PD_1065292079_maProductUrl + '" title="' + MA_PD_1065292079_maProductName + '" target="_blank">\n';
        rowData += '                    <img src="' + reviewItem.RImage + '" alt="' + MA_PD_1065292079_maProductName + '" title="' + MA_PD_1065292079_maProductName + '" class="productLargeImage" />\n';
        rowData += '                    </a>\n';
        rowData += '                </td>\n';
        rowData += '                <td>\n';
        rowData += '                    <hr />\n';
        rowData += '                    <table class="tableReviewItem">\n';
        rowData += '                        <tr>\n';
        rowData += '                            <td>By <b><a href="' + reviewItem.RProfileUrl + '" title="' + reviewItem.RName + '" target="_blank">' + reviewItem.RName + '</a></b> on ' + reviewItem.PostDate + '</td>\n';
        rowData += '                        </tr>\n';
        rowData += '                        <tr>\n';
        rowData += '                            <td>' + reviewItem.Comment + '</td>\n';
        rowData += '                        </tr>\n';
        rowData += '                    </table>\n';
        rowData += '                </td>\n';
        rowData += '            </tr>\n';
    }
        rowData += '        </table>\n';
    jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetReviewList").html(rowData);
    MA_PD_1065292079_maProdReviewLoaded = true;
}
function MA_PD_1065292079_LoadProductDetails()
{
    var url = 'http://mawidget.marketamerica.com/PDetails.aspx?skuID=13009&pcID=58465A73504C54&portalID=awetech&refEmail=05010A27091A020E232A121C1E190E2E111C0E1E0B24081C43150C26&prdCountry=USA&merchCountry=USA&format=json&callback=MA_PD_1065292079_ShowProductDetails';
    MA_PD_1065292079_includeJS(url);
}
function MA_PD_1065292079_ShowProductDetails(jsonData)
{
    var product = eval(jsonData);
    if(product==null|| product.ProdId ==null) return;
    MA_PD_1065292079_maProductName = product.Name;
    MA_PD_1065292079_maProductUrl = product.ProductUrl;
    MA_PD_1065292079_SkuBenefits = product.SkuBenefits;
    MA_PD_1065292079_SkuIngredients = product.SkuIngredients;
    MA_PD_1065292079_SkuScientificStudies = product.SkuScientificStudies;
    MA_PD_1065292079_SkuUnique = product.SkuUnique;
    MA_PD_1065292079_SkuFAQ = product.SkuFAQ;
    
    jQuery("#MA_PD_1065292079_anchBenefits").click();
    
    var htmlData ='' +
        '                            <td width="124px" rowspan="3" style="padding: 3px; vertical-align: top;">' +
        '                                <a href="' + product.ProductUrl + '" title="' + product.Name + '" target="_blank">' +
        '                                <img src="' + product.PictureUrl + '" alt="' + product.Name + '" title="' + product.Name + '" class="productLargeImage" />' +
        '                                </a>' +
        '                            </td>' +
        '                            <td style="vertical-align: top; padding: 3px;">' +
        '                                <h1><a href="' + product.ProductUrl + '" title="' + product.Name + '" target="_blank">' + product.ShortName + '</a></h1>' +
        '                                <span class="productSku">' + product.Description + '</span>' +
        '                            </td>'
    jQuery("#MA_PD_1065292079_trMarketAmericaProductDetailsWidgetBuy").html(htmlData);
    
    htmlData ='' +
        '                                <a href="' + product.ProductUrl + '" title="' + product.Name + '" target="_blank">' +
        '                                <img src="' + product.PictureUrl + '" alt="' + product.Name + '" title="' + product.Name + '" class="productLargeImage" />' +
        '                                </a>';
    jQuery("#MA_PD_1065292079_tdMarketAmericaProductDetailsWidgetDescription").html(htmlData);
    
    htmlData = '                                <a href="' + product.ProductUrl + '" title="' + product.Name + '" target="_blank">' + product.ShortName + '</a>';
    jQuery("#MA_PD_1065292079_h1MarketAmericaProductDetailsWidgetDescription").html(htmlData);
    
    htmlData ='' +
        '                            <td style="padding: 3px;">' +
        '                                <a href="' + product.ProductUrl + '" title="' + product.Name + '" target="_blank">' +
        '                                <img src="' + product.PictureUrl + '" alt="' + product.Name + '" title="' + product.Name + '" class="productLargeImage" />' +
        '                                </a>' +
        '                            </td>' +
        '                            <td width="100%" style="padding: 3px;">' +
        '                                <h1><a href="' + product.ProductUrl + '" title="' + product.Name + '" target="_blank">' + product.ShortName + '</a></h1>' +
        '                                <span class="productSku spanProdReviewCount" id="' + MA_PD_1065292079_prefix + 'spanProdReviewCount"></span>' +
        '                            </td>'
    jQuery("#MA_PD_1065292079_trMarketAmericaProductDetailsWidgetReviews").html(htmlData);
    if(product.Category != null)
    {
         htmlData ='                           <td style="padding: 3px; vertical-align: top;"><h1><a href="' + product.Category.CategoryMAUrl + '" target="_blank" title="' + product.Category.CategoryName + '">' + product.Category.CategoryName + '</a></h1></td>' ;
    }
    else
    {
        htmlData ='                           <td style="padding: 3px; vertical-align: top;"><h1><a href="http://www.marketamerica.com/corporate/" target="_blank" title="Recommended Product">Recommended Product</a></h1></td>' ;
    }
    jQuery("#MA_PD_1065292079_trMarketAmericaProductDetailsWidgetProductList").html(htmlData);

    htmlData ='                                <span class="productPrice">' + product.Price + '</span><br />';
    if(product.HasCB)
    htmlData += product.CashBackStr;        
    jQuery("#MA_PD_1065292079_productPrice").html(htmlData);

    htmlData = '';
    var category = product.Category;
    if(category!=null)
    {
        htmlData = '                    <table cellpadding="0" cellspacing="0" width="100%" height="100%">' +
            '                        <tr>' +
            '                            <td style="padding: 3px; vertical-align: top;">' +
            '                                <h1><a href="' + category.CategoryMAUrl + '" title="' + category.CategoryName + '" target=\"_blank\">' + category.CategoryName + '</a></h1>' +
            '                            </td>' +
            '                        </tr>';
        if (category.SubCategories != null && category.SubCategories.length > 0)
        {
            htmlData += '                        <tr>';
            htmlData += '                            <td style="vertical-align: bottom;">';
            htmlData += '                                <div class="divMarketAmericaProductDetailsWidgetScrollableContent">';
            htmlData += '                                  <ul>';
            for (var i = 0; i < category.SubCategories.length; i++)
            {
                htmlData += '                                  <li><a href="' + category.SubCategories[i].CategoryMAUrl + '" target=\"_blank\">"' + category.SubCategories[i].CategoryName + ' <b>(' + category.SubCategories[i].ProductCount + ')</b></a></li>';
            }
            htmlData += '                                  </ul>';
            htmlData += '                                </div>';
            htmlData += '                            </td>';
            htmlData += '                        </tr>';
        }
        htmlData += '                    </table>';
        jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetCategoryList").html(htmlData);
    }
    
    MA_PD_1065292079_LoadRecProducts(product);
    MA_PD_1065292079_LoadProductReview(product);
}
/**
 * Lays-out the widget
 **/
function MA_PD_1065292079_marketAmericaProductDetailsWidgetLayout()
{
    jQuery('.divMarketAmericaProductDetailsWidgetContent').each(function (index, item) {
        jQuery(item).height(jQuery('#MA_PD_1065292079_divMarketAmericaProductDetailsWidget').height() - 20);
    });
    jQuery('.divMarketAmericaProductDetailsWidgetScrollableContent').each(function(index, item) {
        jQuery(item).parents('td:first').each(function(indexTr, itemTr) {
            if (itemTr.clientHeight) {
                jQuery(item).height(100);
                jQuery(item).height(itemTr.clientHeight);
                jQuery(item).height(itemTr.clientHeight);
                jQuery(item).height(itemTr.clientHeight);
                jQuery(item).height(itemTr.clientHeight);
            }
        })
    });
}
/**
 * TODO: Handle button IDs properly
 **/
function MA_PD_1065292079_marketAmericaProductDetailsWidgetButtonClick (sender)
{
    jQuery('.tabButtonSelected').each(function (index, item){
        jQuery(item).removeClass('tabButtonSelected');
        jQuery(item).addClass('tabButtonDefault');
    });
    jQuery(sender).addClass('tabButtonSelected'); 
    jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetBuy").hide();
    jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetCategoryList").hide();
    jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetInformation").hide();
    jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetPictures").hide();
    jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetRecommendations").hide();
    jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetReviews").hide();
    switch (sender.id) {
        case "MA_PD_1065292079_tabBuyNow":
        {
            jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetBuy").show();
            break;
        }
        case "MA_PD_1065292079_tabBrowseMore":
        {
            jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetCategoryList").show();
            break;
        }
        case "MA_PD_1065292079_tabInfo":
        {
            jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetInformation").show();
            break;
        }
        case "MA_PD_1065292079_tabRecommendations":
        {
            jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetRecommendations").show();
            break;
        }
        case "MA_PD_1065292079_tabReviews":
        {
            jQuery("#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetReviews").show();
            break;
        }
    }
    MA_PD_1065292079_marketAmericaProductDetailsWidgetLayout();
}
function MA_PD_1065292079_marketAmericaProductDetailsWidgetDetailsLinkClick (sender)
    {
    jQuery('.bulletBlack').each(function (index, item){
        item.className = "bulletBlue anchorBlue";
    });
    sender.className = "bulletBlack";
    var divData = jQuery('#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetProductDescription');
    var strData = '';
    divData.empty();
    switch (sender.id) {
        case "MA_PD_1065292079_anchBenefits":
        {
            strData = MA_PD_1065292079_SkuBenefits;
            break;
        }
        case "MA_PD_1065292079_anchIngredients":
        {
            strData = MA_PD_1065292079_SkuIngredients;
            break;
        }
        case "MA_PD_1065292079_anchScience":
        {
            strData = MA_PD_1065292079_SkuScientificStudies;
            break;
        }
        case "MA_PD_1065292079_anchUniqueness":
        {
            strData = MA_PD_1065292079_SkuUnique;
            break;
        }
        case "MA_PD_1065292079_anchFaq":
        {
            strData = MA_PD_1065292079_SkuFAQ;
            break;
        }
    }
    divData.append(strData);
}
var MA_PD_1065292079_productDetailsWidgetParentId = 'MA_PD_1065292079_idMarketAmericaProductDetailsWidgetPlaceholder';
var MA_PD_1065292079_strMarketAmericaProductDetailsWidgetContent = '' +
'<div id="MA_PD_1065292079_divMarketAmericaProductDetailsWidget" class="divMarketAmericaProductDetailsWidget" style="display: none;">' +
'    <table width="100%" height="100%" cellpadding="0" cellspacing="0">' +
'        <tr style="vertical-align: top;">' +
'            <td>' +
'                <div id="MA_PD_1065292079_divMarketAmericaProductDetailsWidgetCategoryList" class="divMarketAmericaProductDetailsWidgetContent divMarketAmericaProductDetailsWidgetCategoryList" style="display: none;">' +
'                    <table cellpadding="0" cellspacing="0" width="100%" height="100%">' +
'                        <tr>' +
'                            <td style="padding: 3px; vertical-align: top;">' +
'                                <h1><a href="http://www.marketamerica.com/corporate/" title="Product Category" target="_blank">Product Category</a></h1>' +
'                            </td>' +
'                        </tr>' +
'                    </table>' +
'                </div>' +
'                <div id="MA_PD_1065292079_divMarketAmericaProductDetailsWidgetBuy" class="divMarketAmericaProductDetailsWidgetBuy divMarketAmericaProductDetailsWidgetContent" style="display: none;">' +
'                    <table id="MA_PD_1065292079_tableMarketAmericaProductDetailsWidgetBuy" class="tableMarketAmericaProductDetailsWidgetBuy" cellpadding="0" cellspacing="0">' +
'                        <tr id="MA_PD_1065292079_trMarketAmericaProductDetailsWidgetBuy">' +
'                            <td width="124px" rowspan="3" style="padding: 3px; vertical-align: top;">' +
'                                <a href="http://www.marketamerica.com/corporate/index.cfm?action=shopping.wpGoShopProducts&amp;prodID=10104" title="Isotonix&#174; L-Tryptophan" target="_blank">' +
'                                <img src="http://images.marketamerica.com/images/USA/shopping/products/zoom/13062.jpg" alt="Isotonix&#174; L-Tryptophan" title="Isotonix&#174; L-Tryptophan" class="productLargeImage" />' +
'                                </a>' +
'                            </td>' +
'                            <td style="vertical-align: top; padding: 3px;">' +
'                                <h1><a href="http://www.marketamerica.com/corporate/index.cfm?action=shopping.wpGoShopProducts&amp;prodID=10104" title="Isotonix&#174; L-Tryptophan" target="_blank">Isotonix&#174; L-Tryptophan</a></h1>' +
'                                <span class="productSku">Single Bottle (30 Servings)</span>' +
'                            </td>' +
'                        </tr>' +
'                        <tr>' +
'                            <td id="MA_PD_1065292079_productPrice" style="padding: 3px; vertical-align: top;">' +
'                            </td>' +
'                        </tr>' +
'                        <tr>' +
'                            <td style="padding: 3px; text-align: left;">' +
'                                <div class="cartForm">' +
'                                    <input type="button" value="Buy Now" class="cartSubmit" onclick="MA_PD_1065292079_OpenUrl();" />' +
'                                </div>' +
'                            </td>' +
'                        </tr>' +
'                    </table>' +
'                </div>' +
'                <div id="MA_PD_1065292079_divMarketAmericaProductDetailsWidgetInformation" class="divMarketAmericaProductDetailsWidgetContent divMarketAmericaProductDetailsWidgetInformation" style="display: none;">' +
'                    <table id="MA_PD_1065292079_tableMarketAmericaProductDetailsWidgetDescription" class="tableMarketAmericaProductDetailsWidgetDescription" cellpadding="0" cellspacing="0" height="100%" width="100%">' +
'                        <tr>' +
'                            <td id="MA_PD_1065292079_tdMarketAmericaProductDetailsWidgetDescription" width="40" style="padding: 3px;">' +
'                                <a href="http://www.marketamerica.com/corporate/index.cfm?action=shopping.wpGoShopProducts&amp;prodID=10104" title="Isotonix&#174; L-Tryptophan" target="_blank">' +
'                                <img src="http://images.marketamerica.com/images/USA/shopping/products/zoom/13062.jpg" alt="Isotonix&#174; L-Tryptophan" title="Isotonix&#174; L-Tryptophan" class="productLargeImage" />' +
'                                </a>' +
'                            </td>' +
'                            <td width="100%" style="padding: 3px;">' +
'                                <h1 id="MA_PD_1065292079_h1MarketAmericaProductDetailsWidgetDescription"><a href="http://www.marketamerica.com/corporate/index.cfm?action=shopping.wpGoShopProducts&amp;prodID=10104" title="Isotonix&#174; L-Tryptophan" target="_blank">Isotonix&#174; L-Tryptophan</a></h1>' +
'                                <div class="productDescriptionAnchors">' +
'                                    <a href="#" id="MA_PD_1065292079_anchBenefits" class="bulletBlack anchBenefits" onclick="return MA_PD_1065292079_marketAmericaProductDetailsWidgetDetailsLinkClick(this);">Benefits</a>' +
'                                    <a href="#" id="MA_PD_1065292079_anchIngredients" class="anchorBlue bulletBlue anchIngredients" onclick="return MA_PD_1065292079_marketAmericaProductDetailsWidgetDetailsLinkClick(this);">Ingredients</a>' +
'                                    <a href="#" id="MA_PD_1065292079_anchScience" class="anchorBlue bulletBlue anchScience" onclick="return MA_PD_1065292079_marketAmericaProductDetailsWidgetDetailsLinkClick(this);">Science</a>' +
'                                    <a href="#" id="MA_PD_1065292079_anchUniqueness" class="anchorBlue bulletBlue anchUniqueness" onclick="return MA_PD_1065292079_marketAmericaProductDetailsWidgetDetailsLinkClick(this);">Uniqueness</a>' +
'                                    <a href="#" id="MA_PD_1065292079_anchFaq" class="anchorBlue bulletBlue anchFaq" onclick="return MA_PD_1065292079_marketAmericaProductDetailsWidgetDetailsLinkClick(this);">FAQ</a>' +
'                                </div>' +
'                            </td>' +
'                        </tr>' +
'                        <tr>' +
'                            <td colspan="2" style="vertical-align: bottom;">' +
'                                <div class="divMarketAmericaProductDetailsWidgetScrollableContent">' +
'                                    <div id="MA_PD_1065292079_divMarketAmericaProductDetailsWidgetProductDescription" class="productDescription divMarketAmericaProductDetailsWidgetProductDescription">' +
'                                    </div>' +
'                                </div>' +
'                            </td>' +
'                        </tr>' +
'                    </table>' +
'                </div>' +
'                <div id="MA_PD_1065292079_divMarketAmericaProductDetailsWidgetRecommendations" class="divMarketAmericaProductDetailsWidgetContent divMarketAmericaProductDetailsWidgetRecommendations" style="display: none;">' +
'                    <table id="MA_PD_1065292079_tableMarketAmericaProductDetailsWidgetProductList" class="tableMarketAmericaProductDetailsWidgetProductList" cellpadding="0" cellspacing="0" width="100%" height="100%">' +
'                        <tr id="MA_PD_1065292079_trMarketAmericaProductDetailsWidgetProductList">' +
'                            <td style="padding: 3px; vertical-align: top;"><h1><a href="http://www.marketamerica.com/corporate/" target="_blank" title="Recommended Product">Recommended Product</a></h1></td>' +
'                        </tr>' +
'                        <tr>' +
'                            <td style="vertical-align: bottom;">' +
'                                <div class="divMarketAmericaProductDetailsWidgetScrollableContent divMarketAmericaRecProductDetailsWidgetProductList" id="MA_PD_1065292079_divMarketAmericaRecProductDetailsWidgetProductList">' +
'                                </div>' +
'                            </td>' +
'                        </tr>' +
'                    </table>' +
'                </div>' +
'                <div id="MA_PD_1065292079_divMarketAmericaProductDetailsWidgetReviews" class="divMarketAmericaProductDetailsWidgetContent divMarketAmericaProductDetailsWidgetReviews" style="display: none;">' +
'                    <table id="MA_PD_1065292079_tableMarketAmericaProductDetailsWidgetReviews" class="tableMarketAmericaProductDetailsWidgetReviews" cellspacing="0" cellpadding="0" width="100%" height="100%">' +
'                        <tr id="MA_PD_1065292079_trMarketAmericaProductDetailsWidgetReviews">' +
'                            <td style="padding: 3px;">' +
'                                <a href="http://www.marketamerica.com/corporate/index.cfm?action=shopping.wpGoShopProducts&amp;prodID=10104" title="Isotonix&#174; L-Tryptophan" target="_blank">' +
'                                <img src="http://images.marketamerica.com/images/USA/shopping/products/zoom/13062.jpg" alt="Isotonix&#174; L-Tryptophan" title="Isotonix&#174; L-Tryptophan" class="productLargeImage" />' +
'                                </a>' +
'                            </td>' +
'                            <td width="100%" style="padding: 3px;">' +
'                                <h1><a href="http://www.marketamerica.com/corporate/index.cfm?action=shopping.wpGoShopProducts&amp;prodID=10104" title="Isotonix&#174; L-Tryptophan" target="_blank">Isotonix&#174; L-Tryptophan</a></h1>' +
'                                <span class="productSku spanProdReviewCount" id="MA_PD_1065292079_spanProdReviewCount"></span>' +
'                            </td>' +
'                        </tr>' +
'                        <tr>' +
'                            <td colspan="2" style="vertical-align: bottom;">' +
'                                <div class="divMarketAmericaProductDetailsWidgetScrollableContent divMarketAmericaProductDetailsWidgetReviewList" id="MA_PD_1065292079_divMarketAmericaProductDetailsWidgetReviewList">' +
'                                </div>' +
'                            </td>' +
'                        </tr>' +
'                    </table>' +
'                </div>' +
'            </td>' +
'        </tr>' +
'        <tr style="vertical-align: bottom;">' +
'            <td>' +
'                <table width="100%" cellspacing="0" cellpadding="0" style="text-align: center;" class="tabButtonDefault">' +
'                    <tr>' +
'                        <td width="25%" style="border-top: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC;">' +
'                            <div id="MA_PD_1065292079_tabInfo" type="button" class="tabButtonDefault tabInfo" value="Info" onclick="MA_PD_1065292079_marketAmericaProductDetailsWidgetButtonClick(this);" style="width: 100%; font-size: 15px; height: 21px;">Info</div>' +
'                        </td>' +
'                        <td width="25%" style="border-top: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC;">' +
'                            <div id="MA_PD_1065292079_tabRecommendations" type="button" class="tabButtonDefault tabRecommendations" value="Recommendations" onclick="MA_PD_1065292079_marketAmericaProductDetailsWidgetButtonClick(this);" style="width: 100%; font-size: 15px; height: 21px;">&nbsp;Recommendations&nbsp;</div>' +
'                        </td>' +
'                        <td width="25%" style="border-top: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC;">' +
'                            <div id="MA_PD_1065292079_tabReviews" type="button" class="tabButtonDefault tabReviews" value="Reviews" onclick="MA_PD_1065292079_marketAmericaProductDetailsWidgetButtonClick(this);" style="width: 100%; font-size: 15px; height: 21px;">&nbsp;Reviews&nbsp;</div>' +
'                        </td>' +
'                        <td width="20px" style="border-top: 1px solid #CCCCCC;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>' +
'                    </tr>' +
'                </table>' +
'            </td>' +
'        </tr>' +
'    </table></div>';

document.write('<div id="MA_PD_1065292079_idMarketAmericaProductDetailsWidgetPlaceholder"></div>');
document.write(MA_PD_1065292079_strMarketAmericaProductDetailsWidgetContent);
function MA_PD_1065292079_initJQuery()
    {
    //if the jQuery object isn't available
    if ((typeof(jQuery) == 'undefined')) {
        setTimeout("MA_PD_1065292079_initJQuery()", 50);
    } else {
        jQuery(function() {
			jQuery(document).ready(function() {
				if (jQuery.browser.msie) {
					MA_PD_1065292079_includeCss(MA_PD_1065292079_widgetRoot + '/themes/gray/ie.css');
				}
				if (jQuery.browser.safari) {
				    MA_PD_1065292079_includeCss(MA_PD_1065292079_widgetRoot + '/themes/gray/safari.css');
				}
				if (jQuery.browser.mozilla) {
				    MA_PD_1065292079_includeCss(MA_PD_1065292079_widgetRoot + '/themes/gray/mozilla.css');
				}
			    // Show the widget div
			    jQuery('#MA_PD_1065292079_divMarketAmericaProductDetailsWidget').style = '';
			    // Initialize the floating window
			    jQuery('#MA_PD_1065292079_divMarketAmericaProductDetailsWidget').dialog(
				{
			        position : [0,0],
			        height: 228,
			        width: 313,
			        minHeight: 206,
			        minWidth: 313,
			        maxHeight: 295,
			        maxWidth: 407,
			        draggable: false,
			        resizable: false,
			        resize: function(event, ui) {
			            MA_PD_1065292079_marketAmericaProductDetailsWidgetLayout();
			        }
			    });
			    // Initialize the floating window header
			    // and mark the header using the CSS class
			    var divMarketAmericaProductDetailsWidgetContainer = jQuery('#MA_PD_1065292079_divMarketAmericaProductDetailsWidget').parent();
			    divMarketAmericaProductDetailsWidgetContainer.attr('id', 'MA_PD_1065292079_divMarketAmericaProductDetailsWidgetContainer');
			    divMarketAmericaProductDetailsWidgetContainer.addClass('divMarketAmericaProductDetailsWidgetContainer');
			    // Floating window header content
			    var divMarketAmericaProductDetailsWidgetHeaderContent = divMarketAmericaProductDetailsWidgetContainer.children(":first");
			    divMarketAmericaProductDetailsWidgetHeaderContent.empty();
			    // Floating window header tab control
			    var divMarketAmericaProductDetailsWidgetHeaderTabs = '';
			    divMarketAmericaProductDetailsWidgetHeaderTabs += '<table width="100%" cellspacing="0" cellpadding="0" style="text-align: center;" class="tabButtonDefault">\
			        <tr>\
			            <td width="125px" style="border-top: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC;">\
			                <div id=\"MA_PD_1065292079_divMarketAmericaProductDetailsWidgetHeaderLogo\" class="divMarketAmericaProductDetailsWidgetHeaderLogo">&nbsp;</div>\
			            </td>\
			            <td width="50%" style="border-top: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC;">\
			                <div id="MA_PD_1065292079_tabBuyNow" type="button" class="tabButtonDefault tabBuyNow" value="Buy Now" onclick="MA_PD_1065292079_marketAmericaProductDetailsWidgetButtonClick(this);" style="text-align: center; float: left; font-size: 15px; width: 100%;">Buy Now</div>\
			            </td>\
			            <td width="50%" style="border-top: 1px solid #CCCCCC;">\
			                <div id="MA_PD_1065292079_tabBrowseMore" type="button" class="tabButtonDefault tabBrowseMore" value="Browse More" onclick="MA_PD_1065292079_marketAmericaProductDetailsWidgetButtonClick(this);" style="text-align: center; float: left; font-size: 15px; width: 100%;">Browse More</div>\
			            </td>\
			        </tr>\
			    </table>';
			    divMarketAmericaProductDetailsWidgetHeaderContent.append(divMarketAmericaProductDetailsWidgetHeaderTabs);
			    if (null != MA_PD_1065292079_productDetailsWidgetParentId)
			    {
			        // Move widget's container to the widget's placeholder
			        jQuery('#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetContainer').each(function (index, value)
			        {
			            jQuery(value).appendTo(jQuery('#' + MA_PD_1065292079_productDetailsWidgetParentId));
			        });
			        // Make widget's container position relative
			        jQuery('#MA_PD_1065292079_divMarketAmericaProductDetailsWidgetContainer').each(function (index, value)
			        {
			            jQuery(value).css('position', 'relative');
			            jQuery(value).css('top', '0');
			        });
			    }
			    // Activate the initial tab
			    jQuery("#MA_PD_1065292079_tabBuyNow").click();
			    // Activate the initial information tab
			    jQuery("#MA_PD_1065292079_anchBenefits").click();
			    MA_PD_1065292079_LoadProductDetails();
			});
		});
	}
}
if(typeof(window.maPDWidgetCSSLoaded)=='undefined'){
  MA_PD_1065292079_includeCss(MA_PD_1065292079_widgetRoot + '/themes/gray/theme.css');
  window.maPDWidgetCSSLoaded=true;
}
MA_PD_1065292079_initJQuery();
