Open a pdf after the viewer agrees to a disclaimer using jquery
<p>Before the viewer could see the pdf from a link, he/she has to agree to a disclaimer, that I have created as a pop-up. The pop-up works but the pdf does-not open after that. I think the syntax is wrong, So someone please correct it. Thanks.</p>

<pre><code>&lt;script type="text/javascript"   src="../../Scripts/jquery.cookie.js" &gt;&lt;/script&gt;


&lt;script type="text/javascript"&gt;
$(document).ready(function () {
    if ($.cookie("Interm") == "1") 
        {
        $('#mask').hide();
        $('.window').hide();                   
        $('a[href$="blah blah blah.pdf"]').attr('target', '_blank');

        }
    else{

        //Get the screen height and width
       var maskHeight = $(document).height();
        var maskWidth = $(document).width();

        //Set heigth and width to mask to fill up the whole screen
       $('#mask').css({ 'width': maskWidth, 'height': maskHeight });            

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center
        $('#dialog').css('top', winH / 2 - $('#dialog').height() / 2);
        $('#dialog').css('left', winW / 2 - $('#dialog').width() / 2);

        document.getElementById("dialog").style.display = "block";

        $('.window .close').click(function (e) 
           {                

            //expires after browser closes
            $.cookie("Interm", "1");                
            e.preventDefault();
            $('#mask').hide();
            $('.window').hide();
            $('a[href$="blah blah blah.pdf"]').attr('target', '_blank');
            }); 

    }
});
</code></pre>

<p>
</p>
