$(function(){
if ($('.imc_no_slideshow .pic img').length) {
$('.imc_no_slideshow .pic').each(function(){
var image = $(this).find('img').attr('src');
var alt = $(this).find('img').attr('alt');
$(this).find('img').remove();
$(this).backstretch(image);
$(this).find('img').attr('alt', alt);
});
}
$('.imc_no_slideshow').imarcomSlideshow({
afterSelect: function(ui) {
$(window).trigger('resize');
},
onInit: function() {
setTimeout(function() {
$(window).trigger('resize');
}, 0);
}
});
$(window).bind('resize', function() {
var $slide = $('.slide.active'),
$image = $slide.find('.slide-background'),
height;
if ($image.length) {
height = Math.max($image.height(), 330);
$slide.closest('.default_slide_section').height(height);
$slide.find('.slide_content').css({
"height": height,
"line-height": height + 'px'
});
if ($slide.find('.slide_blackboard').length) {
$slide.find('.slide_blackboard').css({
"height": height - 40,
"line-height": height - 40 + 'px'
})
}
}
});
setTimeout(function() {
$(window).resize();
}, 1000);
});