 <% if page_context -%>

<div class="modal hide fade in banner-preview" id="page_context-<%=page_context.id%>" style="width:1024px;height:500px;margin-left:-512px">
  <div class="modal-header">
    <a class="close" data-dismiss="modal">×</a>
    <h3><%= t(:preview) %></h3>
  </div>
  <div class="modal-body">
    <p class="page_context_slideshow">

      <iframe src=<%= panel_page_content_back_end_view_path(page_context.page_id, :category_id => page_context.page_context_category.id ,:preview=>true) %> style="width:1000px;height:300px" >

        </iframe>
  
      <%# preview_block_ad_images_helper(page_context).each do |ad_image| -%>
        <%#= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => page_context.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || page_context.context || " ")) %>
      <%# end -%>
    </p>
  </div>
  <div class="modal-footer">
    
  
    <a href="#" class="btn" data-dismiss="modal"><%= t(:close) %></a>
  </div>
  <div>
    <script type="text/javascript" src="/static/kernel.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
  
      // $("#page_context-<%#=page_context.title.dehumanize%>").on("show", function () {
      //      $("#page_context-<%#=page_context.title.dehumanize%>").find(".page_context_slideshow").cycle({delay: -1000, fx: "<%#= page_context.ad_fx.nil?? "fade": page_context.ad_fx %>", timeoutFn: getTimeout });
      // });
    $(".modal").on("hidden", function () {
    $("#show_preview").remove();
      });
      
      $("iframe").load(function(){
          // Get the body element
          var frameBody = $("iframe").contents().find("body");

          // Get all links inside the BODY tag
          $('a', frameBody).click(function(e){
                  //Disable all default actions       
                  e.preventDefault();
          });
          $('input', frameBody).attr("disabled", true);
      });
    });
    </script>
  </div>
</div>



<% end -%>
