// var gClickFlag = false;
var gResizeInitCount = 0;
function veo_commonInit()
{
var gIsAutoPlay = true;
$.each($(".topSlider .sliderItem"), function(_i, _el){
if($(_el).find('.videoWrapper').data("video") !== undefined){
gIsAutoPlay = false;
}
});
$(".topSlider").slick
(
{
dots: true,
infinite: true,
speed: 300,
slidesToShow: 1,
adaptiveHeight: true,
fade: true,
autoplay: gIsAutoPlay,
autoplaySpeed: 5000
}
);
$(".topSlider").on
(
"beforeChange",
function(pEvent, pSlick, pCurrentSlide, pNextSlide)
{
var _video = $(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").find(".videoWrapper").data("video");
$(".topSlider").find(".sliderItem").removeClass("active");
$(".topSlider").find(".sliderItem").find(".message").removeClass("active");
$(".topSlider").find(".sliderItem").find(".message").find(".title").css({"padding-bottom": "0"});
$(".topSliderMessage").find(".title").css({"padding-bottom": "0"});
$(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").addClass("active");
if ($(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").find(".message").length > 0)
{
$(".topSliderMessage").html($(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").find(".message").find("td").html());
}
else
{
$(".topSliderMessage").html("");
}
updateSliderVideo($(".topSlider"), $(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]"), _video);
}
);
/*
$(".topSlider").on
(
"afterChange",
function(pEvent, pSlick, pCurrentSlide)
{
}
);
*/
$(".topSlider").find(".sliderItem").removeClass("active");
$(".topSlider").find(".sliderItem[data-slick-index=0]").addClass("active");
if ($(".topSlider").find(".sliderItem[data-slick-index=0]").find(".message").length > 0)
{
$(".topSliderMessage").html($(".topSlider").find(".sliderItem[data-slick-index=0]").find(".message").find("td").html());
}
else
{
$(".topSliderMessage").html("");
}
updateSliderVideo($(".topSlider"), $(".topSlider").find(".sliderItem.active"), $(".topSlider").find(".sliderItem.active").find(".videoWrapper").data("video"));
$(".playgroup").slick
(
{
dots: false,
infinite: true,
autoplaySpeed: 4000,
speed: 600,
slidesToShow: 1,
adaptiveHeight: false,
fade: false,
autoplay: true,
cssEase: 'cubic-bezier(0.86, 0, 0.07, 1)'
}
);
$(".playgroup").on
(
"beforeChange",
function(pEvent, pSlick, pCurrentSlide, pNextSlide)
{
$(".playgroup").find(".playgroupItem").removeClass("active");
$(".playgroup").find(".playgroupItem[data-slick-index=" + pNextSlide + "]").addClass("active");
}
);
$(".playgroup").find(".playgroupItem").removeClass("active");
$(".playgroup").find(".playgroupItem[data-slick-index=0]").addClass("active");
$(".experientialEducation").slick
(
{
dots: false,
infinite: false,
speed: 300,
slidesToShow: 1,
adaptiveHeight: false,
fade: true,
autoplay: false
}
);
$(".experientialEducation").on
(
"beforeChange",
function(pEvent, pSlick, pCurrentSlide, pNextSlide)
{
var _video = $(".experientialEducation").find(".experientialEducationItem[data-slick-index=" + pNextSlide + "]").find(".videoWrapper").data("video");
$(".experientialEducation").find(".experientialEducationItem").removeClass("active");
$(".experientialEducation").find(".experientialEducationItem[data-slick-index=" + pNextSlide + "]").addClass("active");
updateSliderVideo($(".experientialEducation"), $(".experientialEducation").find(".experientialEducationItem.active"), $(".experientialEducation").find(".experientialEducationItem.active").find(".videoWrapper").data("video"));
$(".experientialEducation").find(".experientialEducationItem.active").find(".mobileBtn").hide();
if ($(".experientialEducation").find(".experientialEducationItem.active").find(".videoBtn").length > 0)
{
var _path = $(".experientialEducation").find(".experientialEducationItem.active").find(".videoBtn").attr("href");
// console.log("P2: " + _path);
$(".experientialEducation").find(".experientialEducationItem.active").find(".mobileBtn").attr("href", _path);
$(".experientialEducation").find(".experientialEducationItem.active").find(".mobileBtn").show();
}
}
);
$(".experientialEducation").find(".experientialEducationItem").removeClass("active");
$(".experientialEducation").find(".experientialEducationItem[data-slick-index=0]").addClass("active");
var _video = $(".experientialEducation").find(".experientialEducationItem[data-slick-index=0]").find(".videoWrapper").data("video");
$(".experientialEducation").find(".experientialEducationItem").removeClass("active");
$(".experientialEducation").find(".experientialEducationItem[data-slick-index=0]").addClass("active");
updateSliderVideo($(".experientialEducation"), $(".experientialEducation").find(".experientialEducationItem.active"), $(".experientialEducation").find(".experientialEducationItem.active").find(".videoWrapper").data("video"));
$(".experientialEducation").find(".experientialEducationItem.active").find(".mobileBtn").hide();
if ($(".experientialEducation").find(".experientialEducationItem.active").find(".videoBtn").length > 0)
{
var _path = $(".experientialEducation").find(".experientialEducationItem.active").find(".videoBtn").attr("href");
$(".experientialEducation").find(".experientialEducationItem.active").find(".mobileBtn").attr("href", _path);
$(".experientialEducation").find(".experientialEducationItem.active").find(".mobileBtn").show();
}
$(".imgSlider").slick
(
{
dots: false,
infinite: false,
speed: 300,
slidesToShow: 1,
adaptiveHeight: true,
fade: true,
autoplay: false
}
);
$(".imgSlider").on
(
"beforeChange",
function(pEvent, pSlick, pCurrentSlide, pNextSlide)
{
$(".imgSlider").find(".sliderItem").removeClass("active");
$(".imgSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").addClass("active");
}
);
$(".imgSlider").find(".sliderItem").removeClass("active");
$(".imgSlider").find(".sliderItem[data-slick-index=0]").addClass("active");
$(Responsive.getInstance()).on
(
"responsive",
function(pEvent, pResponsive_str)
{
$(".topSlider").find(".sliderItem").find(".message").removeClass("active");
$(".topSlider").find(".sliderItem").find(".message").find(".title").css({"padding-bottom": "0"});
$(".topSliderMessage").find(".title").css({"padding-bottom": "0"});
}
);
$(window).on
(
"resize",
function(pEvent, pResponsive_str)
{
gResizeInitCount++;
if ((gResizeInitCount < 2) || ($(window).width() != gDisplayWidth))
{
gDisplayWidth = $(window).width();
$("html, body").removeClass("transitionFreeze").addClass("transitionFreeze");
if ($(".campusMenuWrapper").length > 0)
{
updateCampusMenu($(".campusMenuWrapper").find("#"));
}
if ($(".learningwithusMenuWrapper").length > 0)
{
updateLearningwithusMenu($(".learningwithusMenuWrapper").find("#"));
}
if ($(".tabMenuWrapper").length > 0)
{
if(gCurrentTab != '') {
updateTabMenu(gCurrentTab);
}
// 20180115 call closeFaqItems() only when it is declared
if (typeof closeFaqItems !== 'undefined' && typeof closeFaqItems === 'function') {
closeFaqItems();
}
}
setTimeout
(
function ()
{
$("html, body").removeClass("transitionFreeze");
},
10
);
}
}
);
}
function veo_campusInit()
{
$(".campusMenu").find("input[type='radio']").on
(
"change",
function (pEvent)
{
updateCampusMenu($(pEvent.currentTarget));
}
);
gDisplayWidth = $(window).width();
gCurrentCampusSection = $(".campusMenuWrapper").find("#").val();
$(".campusMenuWrapper").find("#").trigger("click");
updateCampusMenu($(".campusMenuWrapper").find("#"));
}
function veo_learningwithusInit()
{
$(".learningwithusMenu").find("input[type='radio']").on
(
"change",
function (pEvent)
{
updateLearningwithusMenu($(pEvent.currentTarget));
}
);
gDisplayWidth = $(window).width();
gCurrentLearningwithusSection = $(".learningwithusMenuWrapper").find("#").val();
$(".learningwithusMenuWrapper").find("#").trigger("click");
}
function updateSliderVideo(pSlider, pSliderItem, pVideo)
{
var _html = null;
var _popVideoType = pSliderItem.data("type");
var _popVideo = pSliderItem.data("id");
_html = '';
if (pVideo != undefined)
{
if ($("body").hasClass("deviceDesktop"))
{
_html += '';
}
}
if ((_popVideoType != undefined) && (_popVideoType != ""))
{
_html += '';
}
pSliderItem.find(".videoWrapper").html(_html);
}
function toggleMessage(pTarget)
{
var _target = $(".topSlider").find(".sliderItem." + pTarget);
var _messageHeight = _target.find(".message").find(".desc").height();
var _mobileMessageHeight = $(".topSliderMessage").find(".desc").height();
if (_target.find(".message").hasClass("active"))
{
_target.find(".message").removeClass("active");
_target.find(".message").find(".title").css({"padding-bottom": "0"});
$(".topSliderMessage").find(".title").css({"padding-bottom": "0"});
}
else
{
_target.find(".message").removeClass("active").addClass("active");
_target.find(".message").find(".title").css({"padding-bottom": _messageHeight + "px"});
$(".topSliderMessage").find(".title").css({"padding-bottom": _mobileMessageHeight + "px"});
}
}