// JScript File
if (typeof(ci_AddLeftCol) === "undefined") { var ci_AddLeftCol = true; }
if (typeof(cbRecipe) === "undefined") { var cbRecipe = false; }

var ci_bIE = (navigator.userAgent.toLowerCase().indexOf("msie") > -1);
var ci_bSafari = (navigator.userAgent.toLowerCase().indexOf("safari") > -1);
var ci_bMozilla = (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent));

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 
     var ieversion=new Number(RegExp.$1)
     if (ieversion>=8) {
        var cb_ContentLeftMargin = '0px';
        var cb_InstallLeftMargin = '-1px';
        //alert ('ie8');
     }
     else if (ieversion>=7) {
        var cb_ContentLeftMargin = '-1px';
        var cb_InstallLeftMargin = '-1px';
        //alert ('ie7');
     }
     else if (ieversion>=6) {
        var cb_ContentLeftMargin = '-1px';
        var cb_InstallLeftMargin = '0px';
        //alert ('ie6');
     }
}
else if (ci_bSafari) {
var cb_ContentLeftMargin = '1px';
var cb_InstallLeftMargin = '0px';
//alert ('safari');
}
else if (ci_bMozilla) {
var cb_ContentLeftMargin = '0px';
var cb_InstallLeftMargin = '-1px';
//alert ('fox');
}
    
var pidvalue = GetQueryStringValue ('pid');
var zidvalue = GetQueryStringValue ('zid');
var nidvalue = GetQueryStringValue ('nid');


// --------------------------------------------------------

    if (ci_AddLeftCol) {
        if (document.getElementById("TDContent") != null) { document.getElementById("TDContent").style.width = "985px"; }
        if (document.getElementById("DivContent") != null) { document.getElementById("DivContent").style.width = "985px"; document.getElementById("DivContent").style.cssFloat = "left"; }
        if (document.getElementById("NavTabContainerTable") != null) { document.getElementById("NavTabContainerTable").style.position="relative"; document.getElementById("NavTabContainerTable").style.left="177px"; document.getElementById("NavTabContainerTable").style.top="47px"; }
        if (document.getElementById("PersonalizationTab") != null) { document.getElementById("PersonalizationTab").style.position="absolute"; document.getElementById("PersonalizationTab").style.left="-530px"; document.getElementById("PersonalizationTab").style.top="-41px"; }    
    }
    else {
        if (document.getElementById("TDContent") != null) { document.getElementById("TDContent").style.width = "600px"; }
        if (document.getElementById("DivContent") != null) { document.getElementById("DivContent").style.width = "600px"; document.getElementById("DivContent").style.cssFloat = "left"; document.getElementById("DivContent").style.height = "650px"; }
        if (document.getElementById("PersonalizationTab") != null) { document.getElementById("PersonalizationTab").style.position="absolute"; document.getElementById("PersonalizationTab").style.left="-530px"; document.getElementById("PersonalizationTab").style.top="-68px"; }
        if (document.getElementById("NavTabContainerTable") != null) { document.getElementById("NavTabContainerTable").style.position="relative"; document.getElementById("NavTabContainerTable").style.left="-9px"; document.getElementById("NavTabContainerTable").style.top="74px"; }
    }

	var cb_LeftWidth = (ci_AddLeftCol == true ? 188 : 0 );
	var cb_RightWidth = (ci_AddLeftCol == true ? 200 : 0 );
	var cb_TableWrapWidth = (ci_AddLeftCol == true ? 985 : 600 );
	var cb_ContentTopMargin = (ci_AddLeftCol == true ? 47 : 74 );

// --------------------------------------------------------	
function ConstructLogo()
{
   var cbLogo='<div style="position: absolute; top: 10px; left: 17px; width: 110px; height: 60px; z-index: 10000000;"><a class=ci_css_a href="'+ (cbRecipe?'../':'') +'offers.aspx?pid=' + pidvalue + '&nid=' + nidvalue + '&zid=' + zidvalue + '" title="Return to the homepage" style="width: 110px; height: 60px; cursor: hand; cursor: pointer;"><img class=ci_css_img src="http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/spacer.gif" style="width: 110px; height: 60px; cursor: hand; cursor: pointer;" border="0"></a></div>'
   + '<div class=ci_css_div style="position: absolute; top: 5px; left: 13px; width: 121px; height: 78px; z-index: 100000;'
   + (ci_bIE ? "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/cb_buglogo.png', sizingMethod='scale');" : "background: url(http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/cb_buglogo.png) no-repeat;" ) + '"></div>';
    return cbLogo;
}

// --------------------------------------------------------
function cbPopUp(id) {
    if (id == 1) {
    window.open( "http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_include/CouponBugTV.htm", "CouponBugTV", 
    "status = 1, height = 308, width = 520, resizable = 0, toolbar = no, location = no,directories = no" )
    }
}
		
// --------------------------------------------------------	
function ConstructRightColBanner()
{
    var cbRightColHTML="";
    var pidzidnid = GetQueryStringValue ('pid') + GetQueryStringValue ('zid') + GetQueryStringValue ('nid');
    if (ci_AddLeftCol) {
        cbRightColHTML="<table class=ci_css_table' style='margin: 0px; width: 180px;'>"
                +"<tr class=ci_css_tr><td class=ci_css_td style=''>"
                +"<iframe id='cimRightBanner' src='http://couponbar.coupons.com/adblob.asp?pzn=" + pidzidnid + "' scrolling=no frameborder=0 style='height:620px;width:160px; margin-top: 0px; margin-left: 0px;'></iframe>"
                +"</td></tr>"
                +"<tr class=ci_css_tr><td class=ci_css_td style=''>"
                +'<div class=ci_css_div id="cbSampleAd" style="margin-bottom: 2px; margin-left: 4px;"><a class=ci_css_a href="http://www.kqzyfj.com/click-3097859-10447682" target="_blank"><img class=ci_css_img src="http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/167x60_qh.gif" alt="Free Samples &amp; Coupons on Brand Name health Products" style="width: 167px; height: 60px; cursor: hand; cursor: pointer;" vspace="10" border="0"></a></div>'
                +'<div class=ci_css_div id="cbSampleTxt" style="margin-bottom: 5px; margin-left: 4px;"><a class=ci_css_a href="http://www.kqzyfj.com/click-3097859-10447682" target="_blank"><b>FREE Samples and Coupons</b> on brand name products from Quality Health</a></div>'
                +"</td></tr></table>";
    }
    else {
        cbRightColHTML=""; 
    }
    return cbRightColHTML;
}

// --------------------------------------------------------
function ConstructLeftColContent()
{
    if (document.getElementById("LocalNavTabContainerTD") != null) { var localtab = true; }
    if (localtab == undefined) { var localtab = false; }
    
    var cbLeftColHTML="";
    if (ci_AddLeftCol) {
        
        if (cbRecipe) {
        cbLeftColHTML="<div class=ci_css_div style='margin-top: " + cb_ContentTopMargin + "px; width: 163px; float: left; margin-left: 13px;'>"
            +"<div><a class=ci_css_a href='../offers.aspx?pid=" + pidvalue + "&nid=" + nidvalue + "&zid=" + zidvalue + "' title='Return to the homepage' style='cursor: hand; cursor: pointer;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/btn_printablecoupons.png' style='cursor: hand; cursor: pointer;'></a></div>"
            +'<div style="margin-top: 20px;"><a href="../themes/TS_CouponBug/_include/CouponBugTV.htm?pid=' + pidvalue + '&nid=' + nidvalue + '&zid=' + zidvalue + '&loc=' + (localtab ? 1 : 0 ) + '"><img src="http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/cb_commercial_btn.jpg" style=" cursor: hand; cursor: pointer;" border="0"></a></div>'
            +"</div>";
            }
        else {
            cbLeftColHTML="<div class=ci_css_div style='margin-top: " + cb_ContentTopMargin + "px; width: 163px; float: left; margin-left: 13px;'>"
            +"<div><a class=ci_css_a href='offers.aspx?pid=" + pidvalue + "&nid=" + nidvalue + "&zid=" + zidvalue + "' title='Return to the homepage' style='cursor: hand; cursor: pointer;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/btn_printablecoupons.png' style='cursor: hand; cursor: pointer;'></a></div>"
            +'<div style="margin-top: 20px;"><a href="themes/TS_CouponBug/_include/CouponBugTV.htm?pid=' + pidvalue + '&nid=' + nidvalue + '&zid=' + zidvalue + '&loc=' + (localtab ? 1 : 0 ) + '"><img src="http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/cb_commercial_btn.jpg" style=" cursor: hand; cursor: pointer;" border="0"></a></div>'
            +"</div>";
            }      
    }
    else {
        cbLeftColHTML=""; 
    }
    return cbLeftColHTML;
}

// --------------------------------------------------------	
function ConstructLeaderBoard()
{
    var cbLeaderboardHTML="";
    var pidzidnid = GetQueryStringValue ('pid') + GetQueryStringValue ('zid') + GetQueryStringValue ('nid');
    if (ci_AddLeftCol) {
        cbLeaderboardHTML="<div style='position: relative; float: left;  left: 120px; width: 729px; height: 90px;'>"
                +"<iframe id='cimFtrBanner' src='http://couponbar.coupons.com/adblob.asp?pzn=" + pidzidnid + "&ftr=1' scrolling=no frameborder=0 style='margin-top: 3px; width: 729px; height: 90px;'></iframe>"
                +"</div>";
    }
    else {
        cbLeaderboardHTML=""; 
    }
    return cbLeaderboardHTML;
}

// --------------------------------------------------------
function ConstructFooterContent()
{
    var FooterHTML="";
    if (ci_AddLeftCol) {
        FooterHTML="<div class=ci_css_div style='float: left; position: relative; left: 10px; top: 30px; width: 965px; height: 109px; border-top: 1px solid #e4e4e4; padding-top: 10px; padding-bottom: 10px;'>"
               + ConstructLeaderBoard()
               +"</div>"
               +"<div class=ci_css_div style='float: left; position: relative; left: 10px; top: 20px; width: 965px; height: 109px; border-top: 1px solid #e4e4e4; text-align: center; padding-top: 10px;'>"
               +"<div class=ci_css_div style='position: absolute; left: 10px; top: 10px;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/poweredby_cc.png' style='' border='0' /></div>"    
               +"<div class=ci_css_div id='cbFooterDIV' style='width: 710px; text-align: center;'>"
               +"<a href='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_include/aboutus.htm' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>About Us</a>&nbsp; | &nbsp;<a href='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_include/help.htm' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Help</a>&nbsp; | &nbsp;<a href='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_include/contactus.htm' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Contact Us</a>&nbsp; | &nbsp;<a href='http://www.coupons.com/corp/source/u_termofuse.asp?vf=y' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Terms of Use</a>&nbsp; | &nbsp;<a href='http://www.coupons.com/corp/source/u_privacypolicy.asp' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Privacy Policy</a>"
               +"</div>"
               +"<div class=ci_css_div style='width: 710px; margin-top: 10px; margin-left: 120px; margin-right: 120px; text-align: center;'>"
               +"<span class='cbFooterSpan'>&copy; 2010 Coupons.com Incorporated. All Rights Reserved.</span>"
               +"</div>"
               +"<div class=ci_css_div style='width: 240px; margin-top: 10px; margin-left: 350px; margin-right: 350px;'>"
               +"<a href='http://www.truste.org/ivalidate.php?url=www.coupons.com&sealid=101' target='_blank' style='cursor: hand; cursor: pointer;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/truste.gif' style='margin-right: 30px;cursor: hand; cursor: pointer;' border='0' /></a><a href='http://www.bbbonline.org/cks.asp?id=1060221103954' target='_blank' style='cursor: hand; cursor: pointer;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/ReliabilitySeal.gif' border='0' style='cursor: hand; cursor: pointer;' /></a>"
               +"</div>"
               +"</div>";
    } 
    else {
        FooterHTML="<div class=ci_css_div style='float: left; position: relative; left: 10px; top: 60px; width: 575px; height: 109px; border-top: 1px solid #e4e4e4; text-align: center; padding-top: 10px;'>"
               +"<div class=ci_css_div style='position: absolute; left: 0px; top: 10px;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/poweredby_cc.png' style='' border='0' /></div>" 
               +"<div class=ci_css_div id='cbFooterDIV' style='width: 575px; text-align: center;'>"
               +"<a href='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_include/aboutus.htm' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>About Us</a>&nbsp; | &nbsp;<a href='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_include/help.htm' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Help</a>&nbsp; | &nbsp;<a href='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_include/contactus.htm' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Contact Us</a>&nbsp; | &nbsp;<a href='http://www.coupons.com/corp/source/u_termofuse.asp?vf=y' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Terms of Use</a>&nbsp; | &nbsp;<a href='http://www.coupons.com/corp/source/u_privacypolicy.asp' onclick=\"window.open(this.href, '_blank', 'toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes'); return false;\" class='cbFooterLnk' target='_blank'>Privacy Policy</a>"
               +"</div>"
               +"<div class=ci_css_div style='width: 575px; margin-top: 10px; text-align: center;'>"
               +"<span class='cbFooterSpan'>&copy; 2010 Coupons.com Incorporated. All Rights Reserved.</span>"
               +"</div>"
               +"<div class=ci_css_div style='width: 240px; margin-top: 10px; margin-left: 165px; margin-right: 165px;'>"
               +"<a href='http://www.truste.org/ivalidate.php?url=www.coupons.com&sealid=101' target='_blank' style='cursor: hand; cursor: pointer;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/truste.gif' style='margin-right: 30px;cursor: hand; cursor: pointer;' border='0' /></a><a href='http://www.bbbonline.org/cks.asp?id=1060221103954' target='_blank' style='cursor: hand; cursor: pointer;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/ReliabilitySeal.gif' border='0' style='cursor: hand; cursor: pointer;' /></a>"
               +"</div>"
               +"</div>";        
    }
    return FooterHTML;
}
// --------------------------------------------------------
function WhyInstall()
{
var WhyInstallHTML="";
if (ci_AddLeftCol) {
    WhyInstallHTML="<div id='ciLeftWhyInstall' style='margin-top: 20px; margin-left: 7px; position: relative; top: 35px; width: 176px; height: 289px; background-image: url(http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/install_leftbg.png); background-repeat: no-repeat; background-position: top left; vertical-align: top;'>"
        +"<table class=ci_css_table style='width: 154px;'><tr class=ci_css_tr>"
        +"<td class=ci_css_td style='width: 140px;padding-top:10px;padding-left:10px;'>"
        +"<h2 class='cbTxt' style='margin-bottom: 7px; margin-top: 2px; padding: 0px;'>Why Install the Coupon Printer?</h2>"
        +"<div class='cbTxt' style='margin-bottom: 7px; font-size: 11px; line-height: 12px;'>The coupon printer contains security features needed to provide you with coupons you can use in a store. It does not install any third-party software, adware, or spyware, nor does it collect any personal information.</div>"
        +"<div class='cbTxt' style='margin-bottom: 7px;'><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/PrivacyPolicy.gif' style='cursor:hand;'  alt='PrivacyPolicy'>&nbsp;&nbsp;<a class=ci_css_a href='http://www.coupons.com/solutions/main/SubPrivacy.asp' target='_newWin'> <font color=CadetBlue>Privacy Policy</font></a></div>"                           	
        +"<a class=ci_css_a href='http://www.truste.org/pvr.php?page=validate&softwareProgramId=37&sealid=112' target='_newWin' ><img class=ci_css_img src='http://download2.coupons.com/7/19/7125/1450/print.coupons.com/CouponWeb/Themes/TS_CouponBug/_images/trusted_download_reverse.gif' style='margin-top:5px;cursor:hand;cursor:pointer'></a>"
        +"</td></tr></table>"
        +"</div>";          
} 
else {
    WhyInstallHTML="";          
}
return WhyInstallHTML;
}

    
