!function (a, b, c, d) {
var e = a(b);
a.fn.lazyload = function (f) {
function g() {
var b = 0;
i.each(function () {
var c = a(this);
if (!j.skip_invisible || c.is(":visible")) if (a.abovethetop(this, j) || a.leftofbegin(this, j));
else if (a.belowthefold(this, j) || a.rightoffold(this, j)) {
if (++b > j.failure_limit) return !1
} else c.trigger("appear"),
b = 0
})
}
var h, i = this,
j = {
threshold: 0,
failure_limit: 0,
event: "scroll",
effect: "show",
container: b,
data_attribute: "original",
skip_invisible: !0,
appear: null,
load: null,
placeholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"
};
return f && (d !== f.failurelimit && (f.failure_limit = f.failurelimit, delete f.failurelimit), d !== f.effectspeed && (f.effect_speed = f.effectspeed, delete f.effectspeed), a.extend(j, f)),
h = j.container === d || j.container === b ? e : a(j.container),
0 === j.event.indexOf("scroll") && h.bind(j.event,
function () {
return g()
}),
this.each(function () {
var b = this,
c = a(b);
b.loaded = !1,
(c.attr("src") === d || c.attr("src") === !1) && c.is("img") && c.attr("src", j.placeholder),
c.one("appear",
function () {
if (!this.loaded) {
if (j.appear) {
var d = i.length;
j.appear.call(b, d, j)
}
a("
").bind("load",
function () {
var d = c.attr("data-" + j.data_attribute);
c.hide(),
c.is("img") ? c.attr("src", d) : c.css("background-image", "url('" + d + "')"),
c[j.effect](j.effect_speed),
b.loaded = !0;
var e = a.grep(i,
function (a) {
return !a.loaded
});
if (i = a(e), j.load) {
var f = i.length;
j.load.call(b, f, j)
}
}).attr("src", c.attr("data-" + j.data_attribute))
}
}),
0 !== j.event.indexOf("scroll") && c.bind(j.event,
function () {
b.loaded || c.trigger("appear")
})
}),
e.bind("resize",
function () {
g()
}),
/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion) && e.bind("pageshow",
function (b) {
b.originalEvent && b.originalEvent.persisted && i.each(function () {
a(this).trigger("appear")
})
}),
a(c).ready(function () {
g()
}),
this
},
a.belowthefold = function (c, f) {
var g;
return g = f.container === d || f.container === b ? (b.innerHeight ? b.innerHeight : e.height()) + e.scrollTop() : a(f.container).offset().top + a(f.container).height(),
g <= a(c).offset().top - f.threshold
},
a.rightoffold = function (c, f) {
var g;
return g = f.container === d || f.container === b ? e.width() + e.scrollLeft() : a(f.container).offset().left + a(f.container).width(),
g <= a(c).offset().left - f.threshold
},
a.abovethetop = function (c, f) {
var g;
return g = f.container === d || f.container === b ? e.scrollTop() : a(f.container).offset().top,
g >= a(c).offset().top + f.threshold + a(c).height()
},
a.leftofbegin = function (c, f) {
var g;
return g = f.container === d || f.container === b ? e.scrollLeft() : a(f.container).offset().left,
g >= a(c).offset().left + f.threshold + a(c).width()
},
a.inviewport = function (b, c) {
return !(a.rightoffold(b, c) || a.leftofbegin(b, c) || a.belowthefold(b, c) || a.abovethetop(b, c))
},
a.extend(a.expr[":"], {
"below-the-fold": function (b) {
return a.belowthefold(b, {
threshold: 0
})
},
"above-the-top": function (b) {
return !a.belowthefold(b, {
threshold: 0
})
},
"right-of-screen": function (b) {
return a.rightoffold(b, {
threshold: 0
})
},
"left-of-screen": function (b) {
return !a.rightoffold(b, {
threshold: 0
})
},
"in-viewport": function (b) {
return a.inviewport(b, {
threshold: 0
})
},
"above-the-fold": function (b) {
return !a.belowthefold(b, {
threshold: 0
})
},
"right-of-fold": function (b) {
return a.rightoffold(b, {
threshold: 0
})
},
"left-of-fold": function (b) {
return !a.rightoffold(b, {
threshold: 0
})
}
})
} (jQuery, window, document); ;
$(function () {
try {
$("img.lazy").lazyload();
} catch (e) { }
posButton();
$(window).resize(function () {
posButton();
});
$('.z_slide_show_container').mouseenter(function () {
$('#slide_show_pre,#slide_show_next').show();
posButton();
});
$('.z_slide_show_container').mouseleave(function () {
$('#slide_show_pre,#slide_show_next').hide();
});
var fs_tab_a = $('#facility_service_tab li a');
var fs_ul = $('#facility_service_box .cruise_common_ul');
//tabFunc(fs_tab_a, fs_ul);
var voyage_tab_a = $('#voyage_tab li a');
var voyage_sw_list = $('#cruise_voyage_box .line_intro_w');
//tabFunc(voyage_tab_a, voyage_sw_list);
if ($('.cruise_intro_txt p').eq(0).height() > 100) {
$('.cruise_intro_con').addClass('cruise_intro_con_more');
}
$(document).off('mouseenter', '.cruise_intro_con_more');
$(document).on('mouseenter', '.cruise_intro_con_more',
function () {
$('.cruise_intro_txt').css({
'height': 'auto'
});
$('.zk').hide();
$('.cruise_intro_con_more').css({
'border-bottom': '1px dotted #ddd'
});
});
$(document).off('mouseleave', '.cruise_intro_con_more');
$(document).on('mouseleave', '.cruise_intro_con_more',
function () {
$('.cruise_intro_txt').css({
'height': '96px'
});
$('.zk').show();
$('.cruise_intro_con_more').css({
'border-bottom': 'none'
});
});
});
var posButton = function () {
var win_w = $(window).width();
var len_1 = parseInt((win_w - 1000) / 2, 10);
var len_2 = parseInt((win_w - 1190) / 2, 10);
var slide_show_pre_taker = $('#slide_show_pre_taker');
var slide_show_next_taker = $('#slide_show_next_taker');
slide_show_pre_taker.css({
'width': len_1,
'left': -1 * len_2
});
slide_show_next_taker.css({
'width': len_1,
'right': -1 * len_2
});
};
//var tabFunc = function (tabObjs, switchObjs) {
// tabObjs.each(function (i) {
// var index = i;
// $(this).hover(function () {
// var tobj = tabObjs.eq(index);
// tabObjs.removeClass('active');
// tobj.addClass('active');
// var vobj = switchObjs.eq(index);
// switchObjs.removeClass('active');
// vobj.addClass('active');
// $(window).scroll();
// },
// function () { });
// });
//}; ;
var slide_pre_index, slide_next_index, slide_now_index;
var slide_time_interval = null;
var slide_show_pre, slide_show_next, slide_show_objs, slide_show_len;
var slide_show_pre_obj, slide_show_next_obj, slide_show_now_obj;
var z_slide_show_tap;
var slide_go_tip = false;
$(function () {
slide_show_pre = $('#slide_show_pre');
slide_show_next = $('#slide_show_next');
slide_show_objs = $('.slide_show_obj');
slide_show_len = slide_show_objs.length;
z_slide_show_tap = $('.z_slide_show_tap li');
slide_pre_index = slide_show_len - 1;
slide_next_index = 1;
slide_now_index = 0;
slide_show_now_obj = slide_show_objs.eq(slide_now_index);
slide_show_next_obj = slide_show_objs.eq(slide_next_index);
slide_show_pre_obj = slide_show_objs.eq(slide_pre_index);
prepareWork();
z_slide_show_tap.each(function (i) {
var tindex = i;
$(this).bind('mouseenter',function () {
if (slide_time_interval) {
clearInterval(slide_time_interval);
}
slide_show_objs.stop();
var direct;
if ((slide_now_index < tindex) || (slide_now_index == slide_show_len - 1 && tindex == 0)) {
direct = 'left';
} else {
direct = 'right';
}
goSlideTo(tindex, direct);
});
});
//�����
slide_show_next.click();
});
var clickNum_left = 0;
var clickNum_right = 0;
var prepareWork = function () {
$(document).off('click', '#slide_show_next');
$(document).off('click', '#slide_show_pre');
$(document).on('click', '#slide_show_next',function () {
if (slide_go_tip) return false;
slide_go_tip = true;
slide_show_objs.stop(); (slide_next_index + clickNum_left < slide_show_len) ? slide_next_index = slide_next_index + clickNum_left : slide_next_index = (slide_next_index + clickNum_left) % slide_show_len;
goSlideTo(slide_next_index, 'left');
clickNum_left++;
});
$(document).on('click', '#slide_show_pre',function () {
if (slide_go_tip) return false;
slide_go_tip = true;
slide_show_objs.stop(); (slide_pre_index - clickNum_right) >= 0 ? slide_pre_index = slide_pre_index - clickNum_right : slide_pre_index = -1 * (slide_pre_index - clickNum_right) % slide_show_len;
goSlideTo(slide_pre_index, 'right');
clickNum_right++;
});
$(document).off('click', '.slide_next_obj_class');
$(document).off('click', '.slide_pre_obj_class');
$(document).on('click', '.slide_next_obj_class',function () {
slide_show_next.click();
});
$(document).on('click', '.slide_pre_obj_class',function () {
slide_show_pre.click();
});
};
var goSlideTo = function (index, direct) {
var tip1 = false,
tip2 = false;
if (index != slide_now_index) {
slide_setup_mask(index, direct);
if (direct == 'left') {
slide_show_now_obj.css({
zIndex: 4
}).animate({
left: 0,
top: 30,
width: 829,
height: 290
},
500,
function () {
tip1 = true;
if (tip2) {
slideRefreshFunc(direct);
}
});
slide_show_next_obj.css({
zIndex: 5
}).animate({
width: 1000,
height: 350,
left: 95,
top: 0
},
500,
function () {
tip2 = true;
if (tip1) {
slideRefreshFunc(direct);
}
});
z_slide_show_tap.removeClass('active');
z_slide_show_tap.eq(slide_next_index).addClass('active');
} else if (direct == 'right') {
slide_show_now_obj.css({
zIndex: 4
}).animate({
left: 361,
top: 30,
width: 829,
height: 290
},
500,
function () {
tip1 = true;
if (tip2) {
slideRefreshFunc(direct);
}
});
slide_show_pre_obj.css({
zIndex: 5
}).animate({
width: 1000,
height: 350,
left: 95,
top: 0
},
500,
function () {
tip2 = true;
if (tip1) {
slideRefreshFunc(direct);
}
});
z_slide_show_tap.removeClass('active');
z_slide_show_tap.eq(slide_pre_index).addClass('active');
}
}
};
var slideRefreshFunc = function (direct) {
clickNum_left = 0;
clickNum_right = 0;
if (direct == 'left') {
slide_now_index = slide_next_index;
} else {
slide_now_index = slide_pre_index;
}
slide_next_index = ((slide_now_index == slide_show_len - 1) ? 0 : slide_now_index + 1);
slide_now_index != 0 ? slide_pre_index = slide_now_index - 1 : slide_pre_index = slide_show_len - 1;
slide_show_now_obj = slide_show_objs.eq(slide_now_index);
slide_show_next_obj = slide_show_objs.eq(slide_next_index);
slide_show_pre_obj = slide_show_objs.eq(slide_pre_index);
slide_show_next_obj.addClass('slide_next_obj_class');
slide_show_pre_obj.addClass('slide_pre_obj_class');
slide_show_objs.each(function (i) {
if (i != slide_now_index && i != slide_next_index && i != slide_pre_index) {
$(this).hide();
} else {
if (i == slide_next_index) {
slide_show_next_obj.attr('style', 'width:829px;height:290px;left:361px;top:30px;z-index:3;');
}
if (i == slide_pre_index) {
slide_show_pre_obj.attr('style', 'width:829px;height:290px;left:0;top:30px;z-index:3;');
}
}
});
slide_go_tip = false;
};
var slide_setup_mask = function (index, direct) {
$('.slide_show_pre_mask').html('');
$('.slide_show_next_mask').html('');
$('.slide_next_obj_class').removeClass('slide_next_obj_class');
$('.slide_pre_obj_class').removeClass('slide_pre_obj_class');
if (direct == 'left') {
index != 0 ? slide_now_index = index - 1 : slide_now_index = slide_show_len - 1;
slide_next_index = index;
slide_now_index != 0 ? slide_pre_index = slide_now_index - 1 : slide_pre_index = slide_show_len - 1;
slide_show_now_obj = slide_show_objs.eq(slide_now_index);
slide_show_next_obj = slide_show_objs.eq(slide_next_index);
slide_show_pre_obj = slide_show_objs.eq(slide_pre_index);
var tnum = (index + 1 < slide_show_len ? index + 1 : 0);
$('.slide_show_next_mask').html(slide_show_objs.eq(tnum).html());
} else if (direct == 'right') {
index == slide_show_len - 1 ? slide_now_index = 0 : slide_now_index = index + 1;
slide_now_index == slide_show_len - 1 ? slide_next_index = 0 : slide_next_index = slide_now_index + 1;
slide_pre_index = index;
slide_show_now_obj = slide_show_objs.eq(slide_now_index);
slide_show_next_obj = slide_show_objs.eq(slide_next_index);
slide_show_pre_obj = slide_show_objs.eq(slide_pre_index);
var tnum = (slide_pre_index - 1 < 0 ? slide_show_len - 1 : slide_pre_index - 1);
$('.slide_show_pre_mask').html(slide_show_objs.eq(tnum).html());
}
slide_show_objs.each(function (i) {
if (i != slide_now_index && i != slide_next_index && i != slide_pre_index) {
$(this).hide();
} else {
if (i == slide_next_index) {
slide_show_next_obj.attr('style', 'width:829px;height:290px;left:361px;top:30px;z-index:3;');
}
if (i == slide_pre_index) {
slide_show_pre_obj.attr('style', 'width:829px;height:290px;left:0;top:30px;z-index:3;');
}
if (i == slide_now_index) {
slide_show_now_obj.attr('style', 'width:1000px;height:350px;left:95px;top:0;z-index:5;');
}
}
});
};