 $(document).ready(function(){
      $(".instruct").css('display','none');
      blockLink();
          if( $.cookie("fI") == "true"){
          $(".instruct").fadeIn("slow");
             $.cookie("fI","null");
          }
	
    });
 
(function($){
   blockLink = function() {
     var eSent = $.cookie("eSent");
     if (eSent == null) { 
       var link = $(".block-link a").attr("href");
       $.cookie("link",link); 
       $(".block-link a").removeAttr("href");
       $(".block-link a").click(function (){
       $.cookie("redirect", "true");  
        var pathname = window.location.pathname;
        if(pathname.indexOf("contact") != -1 ){
          $(".instruct").fadeIn("slow");
        }else{
        window.location.replace( "/contact");
        $.cookie("fI", "true");
        }
           
       })
  }
   $(".subBtn").click(function (){
       if($.cookie("redirect") == "true"){
         var newLoc = $.cookie("link"); 
         window.open(newLoc,"Secure Area",'width=800,height=600,scrollbars=yes');
         $.cookie("fI", "null");     
         $.cookie("redirect", "null");
         $.cookie("eSent","ok", { path: '/',expires: 365 }); 
       }    
   })
};
})(jQuery);


