$(function(){
obj_js.gallery=$.parseJSON(' {\"id\":\"282\",\"time_scroll\":\"9000\",\"view_ico_gallery\":\"1\",\"list_menu\":\"0\",\"photost\":{\"663\":{\"id\":\"663\",\"src\":\"azienda\\/2018\\/2018_a.jpg\",\"photo_text\":\"\",\"description_photo\":\"\",\"property_image\":{\"scale\":true,\"crop\":false,\"align\":\"center\",\"valign\":\"center\"}},\"664\":{\"id\":\"664\",\"src\":\"azienda\\/2018\\/2018_b.jpg\",\"photo_text\":\"\",\"description_photo\":\"\",\"property_image\":{\"scale\":true,\"crop\":false,\"align\":\"center\",\"valign\":\"center\"}},\"665\":{\"id\":\"665\",\"src\":\"azienda\\/2018\\/2018_c.jpg\",\"photo_text\":\"\",\"description_photo\":\"\",\"property_image\":{\"scale\":true,\"crop\":false,\"align\":\"center\",\"valign\":\"center\"}}},\"photos\":[{\"id\":\"663\",\"src\":\"azienda\\/2018\\/2018_a.jpg\",\"photo_text\":\"\",\"description_photo\":\"\",\"property_image\":{\"scale\":true,\"crop\":false,\"align\":\"center\",\"valign\":\"center\"}},{\"id\":\"664\",\"src\":\"azienda\\/2018\\/2018_b.jpg\",\"photo_text\":\"\",\"description_photo\":\"\",\"property_image\":{\"scale\":true,\"crop\":false,\"align\":\"center\",\"valign\":\"center\"}},{\"id\":\"665\",\"src\":\"azienda\\/2018\\/2018_c.jpg\",\"photo_text\":\"\",\"description_photo\":\"\",\"property_image\":{\"scale\":true,\"crop\":false,\"align\":\"center\",\"valign\":\"center\"}}]} ');
obj_js.image_active=0;
$('#photo_0').removeClass('hover');
$('#photo_0').addClass('active');
obj_js.original_w_img=0;
obj_js.original_h_img=0;
obj_js.time_scroll=setTimeout(timeGalleryScroll, 9000000);
$(window).bind('resize', function () {
obj_js.wind=getViewWindSize(obj_js.width_min,obj_js.height_min);
Resize();
});
Resize();
view_image();
$('a[href="http://www.coloridecora.net/it/50anni"]').attr('href', "").addClass("Video").removeClass("menu");
$(".Video").on({
mouseenter: function(e) {
e.preventDefault();
e.stopPropagation();
$(this).addClass('hover');
},
mouseleave: function(e) {
e.preventDefault();
e.stopPropagation();
$(this).removeClass('hover');
},
click: function(e) {
p=1280/768;
if (((obj_js.width)/128)>((obj_js.height)/768)) { // ing h
h=obj_js.height-120; w=Math.floor(h*p);
} else{ // ing w
w=obj_js.width-120; h=Math.floor(w/p); }
$("#video").attr({"href":"http://www.coloridecora.net/img/media/video.php"+"?w_v="+(w)+"&h_v="+(h)+"&w="+w+"&h="+h+"&u="+encodeURIComponent("http://www.coloridecora.net/img/media/50.mp4")+"&iframe=true&isfullscreen=true&width="+(w+20)+"&height="+(h+20)+""});
$("#video").prettyPhoto({pp_w:obj_js.width-20, pp_h:obj_js.height-20, deeplinking: false, show_title: false, allow_resize: false, social_tools: false, overlay_gallery:false}).click();
e.preventDefault();
e.stopPropagation();
return false;
}
});
$("#menu_C li").each(function( ) {
if ($(this).hasClass('active')) {
if ($(this).find(".more_data_desc").text().replace(/\s/g, "")!=""){
$(this).find(".curs_up_down").addClass('active'); $(this).find(".curs_up_down").addClass("open");
$(this).find(".more_data_desc").fadeIn(500,function() { } );
}
}
});
$("#menu_C > li .more_data").each(function( ) {
if ($(this).text().replace(/\s/g, "")!="") {$(this).show(); } else {$(this).hide();}
});
$("#cont_text_left").mCustomScrollbar({ theme:"dark",
advanced:{updateOnContentResize: true }});
$("#cont_text_left").mCustomScrollbar("scrollTo",$("#menu_C li.active"),{
moveDragger:false
});
$("#cont_gallery").mCustomScrollbar({
axis:"x",
theme:"dark-thin",
advanced:{autoExpandHorizontalScroll:true, updateOnContentResize: true }
});
$(".horizontal-images.content li div").on({
mouseenter: function(e) {
e.preventDefault();
e.stopPropagation();
if (!$(this).hasClass('active')) {
$(this).addClass('hover');
}
},
mouseleave: function(e) {
e.preventDefault();
e.stopPropagation();
$(this).removeClass('hover');
},
click: function(e) {
clearTimeout ( obj_js.time_scroll);
e.preventDefault();
e.stopPropagation();
if (!$(this).hasClass('active')) {
$(".horizontal-images.content li div").each(function( ) {
$(this).removeClass('active');
});
obj_js.image_active=($(this).attr('id').replace('photo_',''));
view_image();
$(this).removeClass('hover');
$(this).addClass('active');
}
},
});
$(".menu").on({
mouseenter: function(e) {
e.preventDefault();
e.stopPropagation();
if (!$(this).hasClass('active')) {
$(this).addClass('hover');
}
},
mouseleave: function(e) {
e.preventDefault();
e.stopPropagation();
$(this).removeClass('hover');
},
click: function(e) {
if ($(this).hasClass('no_cursor')) {
e.preventDefault();
e.stopPropagation();
return false;
}
}
})
$("#menu_C li").on({
mouseenter: function(e) {
e.preventDefault();
e.stopPropagation();
if (!$(this).hasClass('active')) {
$(this).addClass('hover');
}
},
mouseleave: function(e) {
e.preventDefault();
e.stopPropagation();
$(this).removeClass('hover');
},
click: function(e) {
$("#menu_C li").each(function( ) {
$(this).removeClass('active');
$(this).removeClass('active');
});
$(this).addClass('active');
window.location = $($(this).children("a")).attr("href");
e.preventDefault();
e.stopPropagation();
return false;
}
});
$(".curs_up_down").on({
mouseenter: function(e) {
e.preventDefault();
e.stopPropagation();
$(this).addClass('hover');
},
mouseleave: function(e) {
e.preventDefault();
e.stopPropagation();
$(this).removeClass('hover');
},
click: function(e) {
//$("#menu_C li").each(function( ) {
// $(this).removeClass('active');
// $(this).removeClass('active');
// });
if (!$(this).hasClass('active')) {
$(this).addClass('active'); $(this).addClass("open");
$(this).next().fadeIn(500,function() { } );
} else
{
$(this).removeClass('active');
$(this).next().fadeOut(500,function() { $(this).prev().removeClass("open"); });
}
e.preventDefault();
e.stopPropagation();
return false;
}
});
});
function timeGalleryScroll(){
obj_js.image_active++;
if (obj_js.image_active>=(obj_js.gallery['photos'].length)) {obj_js.image_active=0;}
$(".horizontal-images.content li div").each(function( ) {
$(this).removeClass('active');
});
view_image();
$("#photo_"+obj_js.image_active ).removeClass('hover');
$("#photo_"+obj_js.image_active ).addClass('active');
obj_js.time_scroll=setTimeout(timeGalleryScroll, 9000000);
$("#cont_gallery").mCustomScrollbar("scrollTo","#photo_"+obj_js.image_active,{
moveDragger:true
});
}
function view_image(){
$("#g_photo_cont").addClass('loading').removeClass('noloading');
$("#g_photo_cont").html($("
").load(function() {
obj_js.w_img=obj_js.original_w_img= $(this).width();
obj_js.h_img=obj_js.original_h_img=$(this).height();
var left=0, top=0;
var p_i=obj_js.gallery.photos[obj_js.image_active].property_image;
var ilt=calc_img_size(p_i,obj_js.original_w_img,obj_js.original_h_img,obj_js.img_width,obj_js.img_height);
obj_js.h_img=ilt.h_img; obj_js.w_img=ilt.w_img;
$(this).css({'height':obj_js.h_img+ 'px','width':obj_js.w_img+ 'px','margin-left':ilt.left+'px','margin-top':ilt.top+'px'}).fadeIn(function(){
$("#g_photo_cont").addClass('noloading').removeClass('loading');
var cachingObject = $('#page_right img').imageCaching( );
});
}).attr({"src":"http://www.coloridecora.net/img/"+(obj_js.gallery.photos[obj_js.image_active].src),"data-src":"http://www.coloridecora.net/img/"+(obj_js.gallery.photos[obj_js.image_active].src).replace('.','_@2x.')}).hide());
}
function ResizeImg(){
var left=0, top=0;
var aspimg=obj_js.original_w_img/obj_js.original_h_img;
var apsbox=obj_js.img_width/obj_js.img_height;
var p_i=obj_js.gallery.photos[obj_js.image_active].property_image;
var ilt=calc_img_size(p_i,obj_js.original_w_img,obj_js.original_h_img,obj_js.img_width,obj_js.img_height);
obj_js.h_img=ilt.h_img; obj_js.w_img=ilt.w_img;
$("#g_photo_cont img").css({'height':obj_js.h_img+ 'px','width':obj_js.w_img+ 'px','margin-left':ilt.left+'px','margin-top':ilt.top+'px'});
}
function Resize(){
obj_js.height=obj_js.wind.height;
obj_js.width=obj_js.wind.width;
var ll_w=(((obj_js.width-2*obj_js.margin)-obj_js.qq)/obj_js.mm);
var s_t=((((obj_js.width-2*obj_js.margin))-obj_js.qt)/obj_js.mt);
$("#page_left").css({'font-size':s_t+'em'});
$("#cont_text_left").width(ll_w-35);
$("#page_left").width(ll_w);
$("#page_right,#cont_gallery").css({"margin-left":(ll_w)+"px"});
obj_js.img_height=(obj_js.height-$("#cont_top").height()-150); obj_js.img_width=(obj_js.width-ll_w-2*obj_js.margin);
$("#ActionBox").css({ 'margin-top': '10px' });
if (($("#lista_menuA").height())<20){ $("#top_menuA").css({ 'margin-top': '20px' });} else { $("#top_menuA").css({ 'margin-top': '0px' }); }
$("#global").width(obj_js.width-2*obj_js.margin).height(obj_js.height-2*obj_js.margin);
$("#cont_center").height(obj_js.height-$("#cont_top").height()-140);
$("#g_photo_cont").height(obj_js.img_height).width(obj_js.img_width)
$("#cont_text_left").height(obj_js.height-$("#cont_top").height()-150);
$("#cont_text_left_div").css('min-height', obj_js.height-$("#cont_top").height()-150);
$("#extra_bottom").css({"margin-top":(obj_js.height-13)+"px"}).width(obj_js.width-2*obj_js.margin);
$("#cont_gallery").width(obj_js.width-ll_w-2*obj_js.margin);
if ((obj_js.original_w_img>0) && (obj_js.original_h_img>0)){
ResizeImg();
}
}