function getPMT(){
$('#top').hide();
$('body').css('background-color','#ffffff');
var content = '
'+
//'';
$('#contentArea').append(content);
$('#landing').append(
''+
''+
'
'
);
//bgMove();
showMTProfile();
//showMTIntro();
$('#loading').fadeOut(500);
}
function bgMove(){
$('#landing #bg').animate({left:'-=30px'},6000,function(){
$('#landing #bg').animate({left:'+=30px'},6000,bgMove);
});
}
function showMTIntro(){
$('#MTtop .content').hide();
MOOVPlayer.pauseItem();
$('body').css('overflow','hidden');
$('#MTtop').append(''+
'
'+langJSON.musicTherapy.title+'
'+
'
'+
'
'+langJSON.musicTherapy.intro+'
'+
'
'+langJSON.musicTherapy.gotit+'
'+
'
');
setTimeout(function(){
$('#intro #title').fadeIn(1300);
},500);
setTimeout(function(){
$('#intro #image').fadeIn(1300);
},1500);
setTimeout(function(){
$('#intro #desc').fadeIn(1300);
},2500);
setTimeout(function(){
$('#intro #gotit').css('opacity',1);
},3500);
$('#MTtop #gotit').click(function(){
ga('send', 'event', 'mt_tutorial','click','music_therapy | tutorial');
document.getElementById("audioGuide").pause();
$('#MTtop #intro').fadeOut(1000,function(){
$('#MTtop .content').fadeIn(1000,function(){
$('body').css('overflow','auto');
});
setTimeout(function(){
$('#MTtop #title').fadeIn(1300);
},250);
setTimeout(function(){
$('#MTtop #schedule').fadeIn(1300);
},1250);
setTimeout(function(){
$('#MTtop .module').fadeIn(1300);
},2250);
setTimeout(function(){
mtMove();
},3250);
/*$('#MTtop .scroll').mouseover(function(){
clearInterval(mtMoveExecute);
$('#MTtop .scroll').stop();
$('#MTtop .scroll').unbind('mouseover');
});*/
});
});
document.getElementById("audioGuide").play();
setCookie("smi",'1',365);
}
function showMTProfile(){
var date = new Date;
var month = date.getMonth()+1;
var dd = date.getDate();
var hh = date.getHours();
var mm = date.getMinutes();
var ss = date.getSeconds();
var dateStr = [date.getFullYear(), month<10?'0':'', month, dd<10?'0':'', dd, hh<10?'0':'', hh, mm<10?'0':'', mm, ss<10?'0':'', ss].join('');
// console.log(dateStr);
ajaxCall(apiServer+'/moov/api/mtLanding/getMusicTherapy?region=HK&deviceType=web&dateTime='+dateStr, '',function(data){
ga('send', 'pageview', {
'page': hash,
'title': 'Musuic Therapy (PMT)'
});
if(data.resultCode=='0' || data.resultCode=='11'){
var content='';
for(var i = 0; i=0 ;j-- )
{
status+='';
date+=''+((j==0)?langJSON.musicTherapy.today:module.usage[j].date)+'';
}
}
if(module.moduleType=='RM_MT'){
for (var j = 0; j < module.modules.length;j++)
{
var cat=''+module.modules[j][lang+'Name']+''+
'
'
if(j%2==0){
row0+=cat;
}else{
row1+=cat;
}
}
}
});
bg=obj.image;
content+=''+
'
'+
'
'+
'
'+
'
'+obj[lang+"Name"]+'
'+
'
'+
'
'+obj[lang+"Title"]+'
'+
'
'+
status+
'
'+
'
'+
date+
'
'+
'
'+
'
'+
'
'+
'
'
}else if(obj.displayType=="textinfo"){
var moduleContent='';
obj.modules.forEach(function(module){
if(module.moduleType=='INTRO'){
var path='javascript:void(0)';
var callFunction='';
if(module.refType=='WEB'){
callFunction="openWeb('"+module.refValue+"'); ga('send', 'event', 'mt_home', 'click', '/music_therapy_p2/quiz');";
}else{
path='#/'+getMenuPath(module.refType, module.refValue);
}
moduleContent+='';
}
});
content+=''+
moduleContent+
'
';
}else if(obj.displayType=="artistpager"){
var artistListContent='';
var artistDescContent='';
obj.modules.forEach(function(module){
if(module.moduleType=='RATD'){
var screenWidth = $(window).width();
var slickwidth = 1104;
var slickLeft = 30;
if(screenWidth < 1440 && screenWidth > 995){
slickwidth = screenWidth*0.9-192;
slickLeft = (screenWidth*0.2166+30)-(screenWidth*0.0666)-216;
}else if(screenWidth <= 995){
slickwidth = 704;
slickLeft = -37;
}
for(var j = 0; j < module.artists.length; j++){
artist = module.artists[j];
artistListContent += ''+
'
'+
//'
'+
// '
'+
//'
'+
'
'+
'
'+
'
'+
'
'+
'
';
artistDescContent += ''+
'
'+
'
'+
'
'+
'
'+
'
'+artist.artist+'
'+
'
'+artist[lang+"Title"]+'
'+
'
'+((artist[lang+"Desc"].length<=99)?artist[lang+"Desc"]:(artist[lang+"Desc"].substring(0,98)+'...'))+'
'+
'
'+artist[lang+"Btn"]+'
'+
'
'+
'
';
}
}
});
content+=''+
'
'+
'
'+
'
'+obj[lang+"Title"]+'
'+
'
'+
'
'+
'
'+
artistListContent+
'
'+
'
'+
'
'+
'
'+
artistDescContent+
'
'+
'
'+
'
';
}else if(obj.displayType=="banner"){
var moduleContent='';
obj.modules.forEach(function(module){
if(module.moduleType=='BN'){
for (var j = 0; j < module.banners.length;j++)
{
var path='javascript:void(0)';
var callFunction='';
if(module.banners[j].refType=='WEB'){
callFunction="openWeb('"+module.banners[j].refValue+"'); ga('send', 'event', 'theraphy', 'banner', '"+module.banners[j].refValue+"');";
}else{
path='#/'+getMenuPath(module.banners[j].refType, module.banners[j].refValue);
}
moduleContent+='';
}
}
});
content+=''+
moduleContent+
'
';
}else if(obj.displayType=="gridpager"){
var artistListContent='';
var artistDescContent='';
obj.modules.forEach(function(module){
if(module.moduleType=='RPF_GP'){
for(var j = 0; j < module.profiles.length; j++){
var profile = module.profiles[j];
var path='#/'+getMenuPath(module.profiles[j].refType, module.profiles[j].refValue);
artistListContent += '';
}
}
});
content+=''+
'
'+
'
'+
'
'+obj[lang+"Title"]+'
'+
'
'+
'
'+
'
'+
artistListContent+
'
'+
'
'+
'
'+
'
'+
'
';
}
}
$('.view').html(content);
loadingOff();
if((getCookie("smi")==null || getCookie("smi")=='' ) ){
showMTIntro();
}else{
$('#MTtop .content').fadeIn(1000,function(){
$('body').css('overflow','auto');
});
setTimeout(function(){
$('#MTtop #title').fadeIn(1300);
},250);
setTimeout(function(){
$('#MTtop #schedule').fadeIn(1300);
},1250);
setTimeout(function(){
$('#MTtop .module').fadeIn(1300);
},2250);
setTimeout(function(){
mtMove();
},3250);
}
$('#landing.therapeutic .artist_list .moduleGrid').slick({
lazyLoad: 'ondemand',
centerMode:true,
dots: false,
infinite: true,
slidesToShow: 5,
slidesToScroll: 1,
focusOnSelect: true,
asNavFor: '.therapeutic .artist_desc .moduleGrid'
});
$('#landing.therapeutic .artist_desc .moduleGrid').slick({
lazyLoad: 'ondemand',
centerMode:true,
dots: false,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
focusOnSelect: true,
centerPadding:'15%',
asNavFor: '.therapeutic .artist_list .moduleGrid'
});
$('#landing.therapeutic .grid_list .moduleGrid').slick({
lazyLoad: 'ondemand',
dots: false,
infinite: true,
slidesToShow: 5,
slidesToScroll: 1,
draggable: false,
centerMode:true
});
$('#MTtop .module').mouseover(function(){
$('#MTtop #arrowLeft, #MTtop #arrowRight').stop().fadeIn();
});
$('#MTtop .module').mouseleave(function(){
$('#MTtop #arrowLeft, #MTtop #arrowRight').stop().fadeOut();
});
$('#MTtop #arrowLeft').mouseover(function(){
$('#MTtop .scroll').stop();
$('#MTtop .scroll').animate({'left':'-50%'},2000);
});
$('#MTtop #arrowRight').mouseover(function(){
$('#MTtop .scroll').stop();
$('#MTtop .scroll').animate({'left':'0%'},2000);
});
$('#MTtop #arrowBottom').unbind();
$('#MTtop #arrowBottom').click(function(){
//$(document).scrollTop($('#landing.therapeutic .element.textinfo').position().top);
$('body').animate({scrollTop: $('#landing.therapeutic .element.textinfo').position().top});
});
$('.gridpager #arrowLeft').click(function(){
$('#landing.therapeutic .grid_list .moduleGrid').slick('slickPrev');
});
$('.gridpager #arrowRight').click(function(){
$('#landing.therapeutic .grid_list .moduleGrid').slick('slickNext');
});
}
});
}
function mtMove(){
$('#MTtop .scroll').animate({'left':'-50%'},15000,function(){
//$('#MTtop .scroll').animate({'left':'0%'},15000);
})
}