    
function showComparisonResponse(sku, image_path, referrer, user_display)
{    
   Element.hide($('comparisonImageDiv'));
   Element.show($('comparisonSection'));
    
    if(savedRequest == "")
    {
        Element.show('comparisonBody');
        $('comparisonBody').innerHTML = "<table width='100%' cellspacing=0 cellpadding=1><tr width='100%'><td width='100%'>No comparisons are available at this time.</td></tr></table>";
    }
    else
    {
        rText = savedRequest.parseJSON();
        var objects = new Array();
        objects["Sku"] = sku;
        objects["AffiliateProducts"] = rText.products;
        objects["Terms"] = rText.terms;
        
        $('comparisonBody').innerHTML = TrimPath.processDOMTemplate("affiliateProduct_jst", objects);
        //$('comparisonBody').innerHTML = label;
        Element.show('comparisonBody');
        Element.show('comparisonTable');
    }
}

    
function showComparisonResponse_Prototype(sku, image_path, referrer, user_display)
{    
   Element.hide($('comparisonImageDiv'));
   Element.show($('comparisonSection'));
    
    if(savedRequest.responseText == "")
    {
        Element.show('comparisonBody');
        $('comparisonBody').innerHTML = "<table width='100%' cellspacing=0 cellpadding=1><tr width='100%'><td width='100%'>No comparisons are available at this time.</td></tr></table>";
    }
    else
    {
        rText = savedRequest.responseText.parseJSON();
        var objects = new Array();
        objects["Sku"] = sku;
        objects["AffiliateProducts"] = rText.products;
        objects["Terms"] = rText.terms;
	    
        /*var label = '<table cellpadding="0" cellspacing="0" width="100% ">';//rText[0].AffiliateId;

        for(i=0; i<rText.length; i++)
        {
            var product = rText[i];
            label = label + "<tr width='100%' class='affiliate2_Row" + (i % 2) + "' ";

            label = label + "><td style='width:115px;height:40px'>";
            if(product.AffiliateId.toLowerCase() == "magsdirect.com")
            {
                label = label + "<a href='#magsdirect' id='magsdirect_link1'><img style='border:none;' src='/" + image_path;
                label = label + "/affiliate/" + product.AffiliateId + ".gif' /></a></td><td style='width:168px;'>";                
            }
            else{
                label = label + "<a href='#' onClick=pageTracker._trackPageview('/affiliate_click_out');window.open('process.aspx?type=affiliate&sku=";
                label = label + sku + "&our_price=" + mags_price + "&price=" + product.Price + "&affiliate_id=" + product.AffiliateId + "&link=" + product.Link + "&referrer=" + referrer;
                label = label + "&user_display=" + user_display;
                label = label + "')><img style='border:none;' src='/" + image_path;
                label = label + "/affiliate/" + product.AffiliateId + ".gif' /></a></td><td style='width:168px;'>";
            }

            if(product.AffiliateId.toLowerCase() == "magsdirect.com")
            {
                label = label + "<a id='magsdirect_link2' href='#magsdirect'>" + product.AffiliateId + "</a></td><td style='width:168px;'>";                
            }
            else{
                label = label + "<a href='#' onClick=pageTracker._trackPageview('/affiliate_click_out');window.open('process.aspx?type=affiliate&sku=";
                label = label + sku + "&our_price=" + mags_price + "&price=" + product.Price + "&affiliate_id=" + product.AffiliateId + "&link=" + product.Link + "&referrer=" + referrer;
                label = label + "&user_display=" + user_display;
                label = label + "')>" + product.AffiliateId + "</a>&nbsp;</td><td style='width:118px;'>";
           }
           
            label = label + '<div style="width:69px; height:10px; background:url('+"'"+image_path+'/popularity/border2.gif'+"'"+') no-repeat; padding:1px;">';
            label = label + '<div style="display:table;height:8px; filter:alpha(opacity=60); opacity:0.6; -moz-opacity:0.6; background-color:#ffffff;"><img src="'+image_path+'/popularity/popBG.gif" width="'+product.Popularity*100+'%" height="8" align="top"></div></div>';
                            
            label = label + "</td>";
            
            if(product.BestPrice.toLowerCase()=="true")
            {
                label = label + "<td style='width:29px;'><img src='"+image_path+"/price_bell.gif' /></td><td valign='bottom' style='width: 119px; font-size: 16px; font-weight: bold; font-family: arial;'><font style='color: red;'>$"+product.Price+"</font><br/><font style='font-size: 10px; color: red;'>Lowest Price</font></td><td style='width:69px;'><a ";
            }
            else
            {
                label = label + "<td style='width:29px;'></td><td style='width:119px; font-size:16px; font-weight:bold; font-family:arial;'>$"+product.Price+"</td><td style='width:69px;'><a ";
            }
            
            
            if(product.AffiliateId.toLowerCase() == "magsdirect.com")
            {
                label = label + " class='newLink' id='magsdirect_link3' href='#magsdirect'>More Info</a></td></tr>";                
            }
            else{                
                label = label + "href='#' onClick=pageTracker._trackPageview('/affiliate_click_out');window.open('process.aspx?type=affiliate&sku=";
                label = label + sku + "&our_price=" + mags_price + "&price=" + product.Price + "&affiliate_id=" + product.AffiliateId + "&link=" + product.Link + "&referrer=" + referrer;
                label = label + "&user_display=" + user_display;
                label = label + "') class='newLink'>More Info</a></td></tr>";
            }
            
            if(product.CouponText != "")
            {
                label = label + "<tr class='affiliate2_Row" + (i % 2) + "'><td ></td><td class='affiliate_CouponTableCell' colspan='5' style='font-size:10px;text-align:left;padding-left:6px;'>"+product.CouponText+"</td></tr>";
            }
        }

        label = label + "<tr style='height:4px;'><td colspan='6' class='affiliate_TableCell' style='font-size:8px;background-color:#EFEFEF;color:#777777;padding:1px;'>Disclaimer: Prices based on published information. We cannot guarrantee prices are accurate or authorized.</td></tr>";
        */
        $('comparisonBody').innerHTML = TrimPath.processDOMTemplate("affiliateProduct_jst", objects);
        //$('comparisonBody').innerHTML = label;
        Element.show('comparisonBody');
        Element.show('comparisonTable');
    }
    
}

