$(document).ready(function(){
    $("#example0").hide();
    $("#example1").hide();


//call checked function
$(".product_hw").click(function(){
      checked();
});

//Submit URL Tip
$("#sub_link").bind("mouseover", function(){ $("#example1").show(); });
$("#sub_link").bind("mouseout", function(){ $("#example1").hide(); });

//License URL Tip
$("#lic_note").bind("mouseover", function(){ $("#example0").show(); });
$("#lic_note").bind("mouseout", function(){ $("#example0").hide(); });

//License Window Click
$("#lic_note").click(function(){       
       window.open (this.href,'mywindow','location=0,status=1,scrollbars=1,width=510,height=500');
       return false; //returning false works like "preventdefault", stops the background page from loading.
});


//Pricing
function checked() {
    var box1 = document.getElementById("box1");
    var box2 = document.getElementById("box2");
    var price1 = 0.0; var price2 = 0.0; var finalprice = 0.0; var string5 = '';

        if (box1.checked == true)
        {
             var price1 = 99.00;
             document.getElementById("price").innerHTML = "$" + price1;
        }
        if (box2.checked == true)
        {
            var price2 = 89.00;
             document.getElementById("price").innerHTML = "$" + price2;
        }


    if (box1.checked == true && box2.checked == true) {
        finalprice = price1 + price2; minus = finalprice * 10 / 100;
        finalprice = price1 + price2;finalprice = finalprice - minus;
        string5 = ' - 10% Discount!';
    } else {
        finalprice = price1 + price2;
    }

    document.getElementById("price").innerHTML = "$" + finalprice.toFixed(2) + string5;

}

});
