﻿/*
// This code is needed to include the DTD widgets

<div id="dtd_container"></div>
<script type="text/javascript" src="<%=ResolveUrl("~/CC/js/GetMoreDealWidgets.js")%>"></script>
<script type="text/javascript"><!--
dtd_content_height = 500;
dtd_content_width = 345;
dtd_zip = 18064;
dtd_num_widgets = 5;
dtd_container_id = "dtd_container";
//-->
</script>
*/

var GetMoreDealWidgets = function () {
    var contentHeight = dtd_content_height;
    var contentWidth = dtd_content_width;
    var zipCode = dtd_zip;
    var numWidgets = dtd_num_widgets;
    var category = dtd_category;
    var container = document.getElementById(dtd_container_id);
    var output = "";
    var refCode = referral_code;

    // temporarily have to guess this
    var widgetAverageHeight = 140;

    output += "<iframe id='dtd_side' name='dtd_side' frameborder='0' src='http://www.doubletakedeals.com/Content/External/GetMoreDealWidgets.aspx?z=" + zipCode + "&h=" + contentHeight + "&w=" + contentWidth + "&n=" + numWidgets + "&c=" + encodeURIComponent(category)
            + "&refCode=" + refCode + "' height='" + ((numWidgets * widgetAverageHeight) + 60) + "' width='" + (contentWidth + 40) + "' style='border:none;'></iframe>";

    container.innerHTML = output;

    container.setAttribute("style", "width: " + (contentWidth + 40) + "px; height: " + ((numWidgets * widgetAverageHeight) + 60) + "px; margin: 0 0 0 15px;");
};

window.onload = GetMoreDealWidgets;
