"
$(".img_container.first").append "
"+$(this).data("video-title")+"
"
$(".img_container.first").append "
"+$(this).data("video-description")+"
"
$(".img_container.first").append "
"
$("#large").fadeIn(500)
position_img();
if $(window).height() > (maxheight+100)
$("#large .large-img").css
"max-height" : maxheight
else
$("#large .large-img").css
"max-height" : "85%"
if $(window).width() > (maxwidth+100)
$("#large .large-img").css
"max-width" : maxwidth
else
$("#large .large-img").css
"max-width" : "85%"
popover_resize();
$("#large .img_container.first").css
"padding-top": (($(window).height()- $("#large .img_container.first iframe").height()-50)/ 2)+"px"
#position_img();
false
$(".expandable_image").click ->
maxwidth = 1000
maxheight = 900
prev_link = $(this)
$("body").append "
"
title = false
$("#large").append "
"
$("#large").append "

"
$(".img_container.first").append "
.attr()
"
if $(this).attr "title"
title = $(this).attr "title"
$(".img_container.first").append "
"+title+"
"
$("#large .large-img").one "load", ->
$("#large").fadeIn(500)
position_img();
if $(window).height() > (maxheight+100)
$("#large .large-img").css
"max-height" : maxheight
else
$("#large .large-img").css
"max-height" : "85%"
if $(window).width() > (maxwidth+100)
$("#large .large-img").css
"max-width" : maxwidth
else
$("#large .large-img").css
"max-width" : "85%"
position_img();
false
$(".rea-gal a").click ->
maxwidth = 1000
maxheight = 900
prev_link = $(this)
$("body").append "
"
title = false
$("#large").append "

"
$("#large").append "

"
$("#large").append "

"
$("#large").append "
"
$(".img_container.first").append "
.attr()
"
if $(this).attr "title"
title = $(this).attr "title"
$(".img_container.first").append "
"+title+"
"
$("#large .large-img").one "load", ->
$("#large").fadeIn(500)
position_img();
if $(window).height() > (maxheight+100)
$("#large .large-img").css
"max-height" : maxheight
else
$("#large .large-img").css
"max-height" : "85%"
if $(window).width() > (maxwidth+100)
$("#large .large-img").css
"max-width" : maxwidth
else
$("#large .large-img").css
"max-width" : "85%"
position_img();
false
$("body").on "click", "#large", ->
$(this).fadeOut 300, ->
$(this).remove()
$("body").on "click" ,"#large .prev",->
if prev_link.prev("a").length > 0
link = prev_link.closest("a").prev("a")
else
link = prev_link.closest("div").children("a:last")
#titre = photo.find("h3")
$(".img_container.first").fadeOut 300, ->
$("#large h3").remove()
if link.attr "title"
title = link.attr "title"
$(".img_container.first").append "
"+title+"
"
$('#large .large-img').attr("src", link.attr("href"))
$("#large .large-img").one "load", ->
$(".img_container.first").fadeIn()
position_img();
prev_link = link
false
$("body").on "click" ,"#large .next",->
if prev_link.next("a").length > 0
link = prev_link.closest("a").next("a")
else
link = prev_link.closest("div").children("a:first")
#titre = photo.find("h3")
$(".img_container.first").fadeOut 300, ->
$("#large h3").remove()
if link.attr "title"
title = link.attr "title"
$(".img_container.first").append "
"+title+"
"
$('#large .large-img').attr("src", link.attr("href"))
$("#large .large-img").one "load", ->
$(".img_container.first").fadeIn()
position_img();
prev_link = link
false
left =0
top = 0
offset= 0
popover_resize = ->
$("#large").css "min-height", ($(window).height()-30)+"px"
$(".slider").each ->
$(this).css({"width": $(window).width()+"px"})
height = ($(window).height())
optimal_height = Math.round($(this).width()/ 1.66)
if optimal_height < height
height = optimal_height
$(this).css({"height": height+"px"})
position_img_now();
popover_resize()
$(window).on "popover_resize", ->
popover_resize()