
function download(id) {
if (!false ) {
    window.location.href = "http://www.untangle.com/How-to-Start-Your-14-Day-Free-Trial?sku=UN-80-LDB-0000-1YEAR";
    return false;
}
document.getElementById(id).innerHTML = '<p class="download-starting"><!-- --></p>';
var x = id;
try{Unm.trackExternalDownload('untangle-libitem-trial14-splitd');}catch(e){}
window.setTimeout(function(){
var div = document.getElementById(x);
div.innerHTML = '';
    div.innerHTML += '<br><p class="download-starting" style="margin-top:0px;padding-top:0px;background-position:5px 0px;margin-bottom:0.2em;">Download starting...<br/><span style="font-size:0.8em;font-weight:normal;">(on your Untangle Server)</span></p><p style="margin-top:0.5em;">If you experience problems with the download,<br/><a href="#" onclick="return download(\''+id+'\')">Restart the download</a><p>';
    //try to focuse the client window
    window.setTimeout(function(){if (window.opener) {window.opener.focus();}},1000);
    return false;
},1000);
return false;
}
try{Unm.setClientState('OffGUI');}catch(e){}var store_buttons_div = document.getElementById("store-buttons-div");
store_buttons_div.innerHTML = '<span id=\"action_buttons\" style=\"width:193px; height:125px;\"><a href=\"//store.untangle.com/wan-balancer-conf.html\" id=\"buy-now\"><img style=\"cursor:pointer; cursor:hand; margin-bottom: 4px;\" src=\"//store.untangle.com/skin/frontend/default/default/images/untangle/buy_now.gif\" alt=\"Buy\" /></a><br /><img style=\"cursor:pointer; cursor:hand; margin-top: 2px;\" src=\"//store.untangle.com/skin/frontend/default/default/images/untangle/free_trial.gif\" alt=\"Trial\" onClick=\"download(\'action_buttons\');\" /> <br /><a href=\"//store.untangle.com/customer/product/redeem\">Redeem Voucher</a>';
    var openDlg2;
    $(document).ready(function() {

    var loc = escape(window.location.href),
    r = Math.random() * 51212,
    src = "//store.untangle.com/wan-balancer-conf.html?___store=test&loc="+loc+"&rand="+r;

    openDlg2 = function() {
        $("#buy-dialog").dialog({
                disabled: true,
                draggable : false,
                width : 740,
                height : 450,
                modal : true,
                position : "center",
                resizable : false,
                title : "Shopping Cart",
                open : function (event,ui) {
                   this.dlg = false;
                   $("#buy-dialog").html("<iframe frameborder=\"0\" id=\"ifr-shopping-cart\" style=\"width:100%;height:98%;display:none;\" src=\""+src+"\">");
                   $("#ifr-shopping-cart")[0].style.display = "";
                },
                beforeclose : function(event,ui) {
                    if(this.dlg==false) {
                        $("#buy-dialog").dialog("widget").animate({opacity:0},100,"linear",function() {
                            this.dlg = true;
                            $("#buy-dialog")[0].innerHTML = "";
                            $("#buy-dialog").dialog("destroy");
                            if($("#your-cart").length == 1){
                                $("#your-cart")[0].style.display = "";
                                $("#your-cart").html("My Cart");
                                $("#your-cart").animate({"backgroundColor":"#FFF","color":"#444"},1500).animate({"backgroundColor":"#65C61B","color":"#FFF"},1300);
                            }
                        });
                        return false;
                    }

                }
        }

        );
    }

    $("#buy-now").bind("click",function() {
        r = Math.random() * 51212;
        src = "//store.untangle.com/wan-balancer-conf.html?___store=test&loc="+loc+"&rand="+r;
        openDlg2();
        return false;
    });
    /*
    $("#your-cart").bind("click",function(){
        r = Math.random() * 51212;
        src = "http://staging-store.untangle.com/checkout/cart/?___store=test&rand="+r+"&loc="+loc;
        openDlg();
        return false;
    });
    */

  });


if (top.location != location) { alert('The window is in a frame but is not ON-GUI with an Untangle box. The Untangle Store link may be blocked by your browsers security settings.'); }