jQuery(document).ready(function(){

   

    jQuery("#notebookdialog").dialog({
      modal: true,
            bgiframe: true,
            width: 500,
            height: 200,
      autoOpen: false
      });


    jQuery(".notebook").click(function(e) {
        
        if (jQuery("#notebookdialog").length == 0) {
        	jQuery("body").prepend('<div id="notebookdialog"> <p>Specialised Smart board software is required to open this file.</p><p><a href="http://www.smarttech.com/us/Support/Browse+Support/Download+Software/Software/SMART+Notebook+Express/SMART+Notebook+Express/SMART+Notebook+Express"> Smart Notebook Express </a> software can be downloaded free of charge at SmartTech.com</p><p>Continue downloading the .notebook file?</p></div>');
        	jQuery("#notebookdialog").dialog({
      			modal: true,
            	bgiframe: true,
            	width: 500,
            	height: 200,
      			autoOpen: false
      		});
        }
         
        e.preventDefault();
        var theHREF = jQuery(this).attr("href");


        jQuery("#notebookdialog").dialog('option', 'buttons', {
        	
        	
        	
            "Continue": function () {
                  jQuery(this).dialog("close");
                    window.location.href = theHREF;
                    },
                "Cancel" : function() {
                    jQuery(this).dialog("close");
                    }
                });

            jQuery("#notebookdialog").dialog("open");

    });

});
