 <% if bulletin -%>

<div class="modal hide fade in banner-preview" id="bulletin-<%=bulletin.id%>">
  <div class="modal-header">
    <a class="close" data-dismiss="modal">×</a>
    <h3><%= t("modal.preview") %></h3>
  </div>
  <div class="modal-body">
    <p class="bulletin_slideshow">
			<iframe src=<%= panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id ,:preview=>true) %> style="width:1024px;height:300px" >

				</iframe>
	
			<%# preview_block_ad_images_helper(bulletin).each do |ad_image| -%>
				<%#= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => bulletin.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || bulletin.context || " ")) %>
			<%# end -%>
    </p>
  </div>
  <div class="modal-footer">
		
		<%= form_for bulletin, :url => panel_announcement_back_end_bulletin_approve_path(bulletin),:method => :post, :html => {:class => 'clear'} do |f| %>
		<%= f.label :approval_stat, t('approval_stat') %>
			<%= content_tag :label,:class => "radio inline" do -%>
				<%= f.radio_button :is_checked, true , {:class => 'privacy'} %> 
				<%= t('approval.pass') %>
			<% end -%>
			<%= content_tag :label,:class => "radio inline" do -%>
				<%= f.radio_button :is_checked, false, (!@bulletin.is_checked ? {:checked => true, :class => 'privacy'} : {})%> 
				<%= t('approval.not_pass') %>
			<% end -%>

				<%= label :is_checked_false, t('approval.not_pass_reason') %>
			    <%= f.text_field :not_checked_reason %>
			<%= f.submit t(:submit_approval),:class=>"btn"%>
		<% end %>

    <a href="#" class="btn" data-dismiss="modal"><%= t("modal.close") %></a>
  </div>
  <div>
  	<script type="text/javascript" src="/static/kernel.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
	
			// $("#bulletin-<%#=bulletin.title.dehumanize%>").on("show", function () {
			//   		$("#bulletin-<%#=bulletin.title.dehumanize%>").find(".bulletin_slideshow").cycle({delay: -1000, fx: "<%#= bulletin.ad_fx.nil?? "fade": bulletin.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 -%>
