// Naive's Main Object Naive = { Box: { Content: {}, Lightbox: {}, Menu: {}, Player: {} }, Ctl: { Transition: {}, General: {}, Histo:{} }, Paths: { PATH_JST: '/public/js/front/', // Naïve's Javascript PATH_PLG: '/public/plugins/front/', // Naïve's JQuery plugins PATH_CSS: '/public/css/front/', // Naïve's Css PATH_IMG: '/public/img/front/', // Naïve's Images PATH_HTC: '/public/plugins/front/iepngfix/blank.gif', // HTC's blank image fix BASEURL: '/' // BaseUrl Site }, Language: null } // Skip a line for each file to avoid missing cariage return error Naive.Box.Content.Artist = { initialize: function () { this.initBoxes(); //Add the open/close boxes event this.initPicture(); this.initProData(); this.initConcert(); this.initCalendar(); this.initDiscography(); this.initVideos(); this.initTracklist(); this.resize(); $.preloadImages("/public/img/front/gui/bkg/bkgArtistLeftBoxBuyMusic.png", "/public/img/front/gui/bkg/bkgArtistProDataHover.png", "/public/img/front/gui/bkg/bkgToolTipsDownloadCenter.png", "/public/img/front/gui/bkg/bkgToolTipsContentCenter.png", "/public/img/front/gui/bkg/bkgArtRightTooltip.png", "/public/img/front/gui/bkg/bkgToolTipsDownloadRight.png", "/public/img/front/gui/bkg/bkgToolTipsDownloadCenter.png", "/public/img/front/gui/bkg/bkgToolTipsContentCenter.png", "/public/img/front/gui/bkg/artRightBoxVideoCarouselHover.png", "/public/img/front/gui/bkg/artRightBoxVideoCarouselHoverButtons.png", "/public/img/front/gui/bkg/bkgToolTipsAddPlaylistRight.png", "/public/img/front/gui/bkg/bkgToolTipsAddPlaylistAndPlayCenter.png"); }, initBoxes: function() { boxesButtons = ".artContactButton, .artDataButton, .artLeftBoxConcertButtonMusic, .artLeftBoxAgendaButtonMusic, .artCenterContentButton, .artRightBoxClipAndVideoHeaderButton, .artRightBoxOtherVideoHeaderButton, .artRightBoxLatestAlbumHeaderButton"; $(boxesButtons).unbind('click'); $(boxesButtons).click( function(){ if($(this).next().css("display") === "none") { if (!$.browser.msie) { $(this).next().fadeIn(200, function(){ Naive.Box.Content.Artist.resize(); }); } else { $(this).next().show(); Naive.Box.Content.Artist.resize(); } $(this).css({opacity:1}); } else { $(this).next().css({"display" : "none"}); Naive.Box.Content.Artist.resize(); if (!$.browser.msie) { $(this).css({opacity:0.7}); } } }); if (!$.browser.msie) { $(".artCenterContentButton.artHide").css({opacity:0.7}); } }, timeoutPicture:null, initPicture: function() { }, initProData: function() { $(".artDataContent select").unbind("change"); $(".artDataContent select").change(function() { $(this).next().hide(); $(this).next().load($(this).val(), function(data){ $(this).show(); Naive.Box.Content.Artist.resize(); Naive.Box.Content.Artist.initProData(); }); }); // Download tooltip on pro data element in left container $(".artMainProDownloadLink").tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", fixPNG: true, extraClass: "artMainProMoreInfoTooltip artMainProDownloadTooltip", left: -54, top: -45 }); // More info tooltip on pro data element in left container $(".artMainProMoreInfoLink").tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", fixPNG: true, extraClass: "artMainProMoreInfoTooltip", left: -135, top: -110 }); // Mouseover on pro data element in left container $(".artMainProData.artMainProDataDl").unbind('mouseover'); $(".artMainProData.artMainProDataDl").mouseover(function(){ $(this).addClass("artMainProDataHoverDl"); }); // Mouseout on pro data element in left container $(".artMainProData.artMainProDataDl").unbind('mouseout'); $(".artMainProData.artMainProDataDl").mouseout(function(){ $(this).removeClass("artMainProDataHoverDl"); }); // Mouseover on pro data element in left container $(".artMainProData.artMainProDataNoDl").unbind('mouseover'); $(".artMainProData.artMainProDataNoDl").mouseover(function(){ $(this).addClass("artMainProDataHoverNoDl"); }); // Mouseout on pro data element in left container $(".artMainProData.artMainProDataNoDl").unbind('mouseout'); $(".artMainProData.artMainProDataNoDl").mouseout(function(){ $(this).removeClass("artMainProDataHoverNoDl"); }); }, initConcert: function() { // Concert carousel on the left section for(i=1;i<4;i++) { $("#contentContainer" + i + " .artLeftBoxConcertCarousel").jCarouselLite({ btnNext : "#contentContainer" + i + " .artNavNextConcert", // Carousel search list elem Next Button btnPrev : "#contentContainer" + i + " .artNavPreviousConcert", // Carousel search list elem Back Button visible : 1, // Carousel search list elem visibility scroll : 1, // Carousel search list elem scrolled by speed : 800, // Carousel search list elem speed vertical : false, // Carousel search list elem direction circular : false // Carousel search list elem 's Loop }); } // Mouseover on concert element in left container $(".artLeftBoxConcertCarouselElement").unbind('mouseover'); $(".artLeftBoxConcertCarouselElement").mouseover(function(){ $(this).addClass("artLeftBoxConcertCarouselElementHover"); $(".artLeftBoxConcertCarouselMoreInfo", this).addClass("artLeftBoxAgendaCarouselMoreInfoHover"); $(".artLeftBoxCarouselDate", this).addClass("artLeftBoxCarouselDateHover"); }); // Mouseout on concert element in left container $(".artLeftBoxConcertCarouselElement").unbind('mouseout'); $(".artLeftBoxConcertCarouselElement").mouseout(function(){ $(this).removeClass("artLeftBoxConcertCarouselElementHover"); $(".artLeftBoxConcertCarouselMoreInfo", this).removeClass("artLeftBoxAgendaCarouselMoreInfoHover"); $(".artLeftBoxCarouselDate", this).removeClass("artLeftBoxCarouselDateHover"); }); }, initCalendar: function() { // Agenda carousel on the left section for(i=1;i<4;i++) { $("#contentContainer" + i + " .artLeftBoxAgendaCarousel").jCarouselLite({ btnNext : "#contentContainer" + i + " .artNavNextAgenda", // Agenda search list elem Next Button btnPrev : "#contentContainer" + i + " .artNavPreviousAgenda", // Agenda search list elem Back Button visible : 1, // Agenda search list elem visibility scroll : 1, // Agenda search list elem scrolled by speed : 800, // Agenda search list elem speed vertical : false, // Agenda search list elem direction circular : false // Agenda search list elem 's Loop }); } // Mouseover on agenda element in left container $(".artLeftBoxAgendaCarouselElement").unbind('mouseover'); $(".artLeftBoxAgendaCarouselElement").mouseover(function(){ $(this).addClass("artLeftBoxAgendaCarouselElementHover"); $(".artLeftBoxAgendaCarouselMoreInfo", this).addClass("artLeftBoxAgendaCarouselMoreInfoHover"); $(".artLeftBoxCarouselDate", this).addClass("artLeftBoxCarouselDateHover"); }); // Mouseout on agenda element in left container $(".artLeftBoxAgendaCarouselElement").unbind('mouseout'); $(".artLeftBoxAgendaCarouselElement").mouseout(function(){ $(this).removeClass("artLeftBoxAgendaCarouselElementHover"); $(".artLeftBoxAgendaCarouselMoreInfo", this).removeClass("artLeftBoxAgendaCarouselMoreInfoHover"); $(".artLeftBoxCarouselDate", this).removeClass("artLeftBoxCarouselDateHover"); }); }, initDiscography: function() { for(i=1;i<4;i++) { $("#contentContainer" + i + " .artDiscographyCarousel").jCarouselLite({ btnNext : "#contentContainer" + i + " .artNavNextDiscography", // Discography search list elem Next Button btnPrev : "#contentContainer" + i + " .artNavPreviousDiscography", // Discography search list elem Back Button visible : 1, // Discography search list elem visibility scroll : 1, // Discography search list elem scrolled by speed : 800, // Discography search list elem speed vertical : false, // Discography search list elem direction circular : false // Discography search list elem 's Loop }); } }, initVideos : function() { // Mouseover for clip & videos carousel elements $(".artRightBoxVideoCarouselElementContainer").unbind('mouseover'); $(".artRightBoxVideoCarouselElementContainer").mouseover(function(){ $(this).addClass("artRightBoxVideoCarouselElementContainerHover"); $(".artRightBoxVideoCarouselButtonContainer", this).css("visibility","visible"); }); $(".artRightBoxVideoCarouselElementContainer").unbind('mouseout'); $(".artRightBoxVideoCarouselElementContainer").mouseout(function(){ $(this).removeClass("artRightBoxVideoCarouselElementContainerHover"); $(".artRightBoxVideoCarouselButtonContainer", this).css("visibility","hidden"); }); $('.artButtonPlay').tooltip({ track: true, delay: 0, showURL: false, fixPNG: true, extraClass: "artButtonPlayTooltip", left: -117, top: -55 }); $('.artButtonAdd').tooltip({ track: true, delay: 0, showURL: false, fixPNG: true, extraClass: "artMusicButtonAddTooltip", left: -68, top: -55 }); // Download tooltip on media lists in right container $('.artButtonDownload').tooltip({ track: true, delay: 0, showURL: false, fixPNG: true, extraClass: "artButtonDownloadTrackTooltip", left: -95, top: -45 }); for(intCompteur = 1; intCompteur<4; intCompteur++) { // Clips and videos carousel $("#contentContainer" + intCompteur + " .artVideo1 .artRightBoxVideoContentMusicCarousel").jCarouselLite({ btnNext : "#contentContainer" + intCompteur + " .artVideo1 .artNavNextVideos", // Clips and videos search list elem Next Button btnPrev : "#contentContainer" + intCompteur + " .artVideo1 .artNavPreviousVideos", // Clips and videos search list elem Back Button visible : 1, // Clips and videos search list elem visibility scroll : 1, // Clips and videos search list elem scrolled by speed : 800, // Clips and videos search list elem speed vertical : false, // Clips and videos search list elem direction circular : false // Clips and videos search list elem 's Loop }); // Clips and videos carousel $("#contentContainer" + intCompteur + " .artVideo2 .artRightBoxVideoContentMusicCarousel").jCarouselLite({ btnNext : "#contentContainer" + intCompteur + " .artVideo2 .artNavNextVideos", // Clips and videos search list elem Next Button btnPrev : "#contentContainer" + intCompteur + " .artVideo2 .artNavPreviousVideos", // Clips and videos search list elem Back Button visible : 1, // Clips and videos search list elem visibility scroll : 1, // Clips and videos search list elem scrolled by speed : 800, // Clips and videos search list elem speed vertical : false, // Clips and videos search list elem direction circular : false // Clips and videos search list elem 's Loop }); } }, initTracklist: function() { $(".artRightBoxTrackListContainer").unbind('mouseover'); $(".artRightBoxTrackListContainer").mouseover(function(){ $(this).addClass('artRightBoxTrackListContainerHover'); $(".artRightBoxTrackListNumber", this).css("color","#FFFFFF"); }); $(".artRightBoxTrackListContainer").unbind('mouseout'); $(".artRightBoxTrackListContainer").mouseout(function(){ $(this).removeClass('artRightBoxTrackListContainerHover'); $(".artRightBoxTrackListNumber", this).css("color",""); }); }, resize: function() { //Resize the scrollbar clearTimeout(Naive.Ctl.Content.timeoutResize); Naive.Ctl.Content.timeoutResize = setTimeout(function(){ sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); }, 100); //Resize the left background $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .artContentLeftMain").css({"height":"" }); heightFooter = 145; contentHeight = $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .sizeContent").innerHeight() - heightFooter; $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .artContentLeftMain").css({"height":contentHeight }); } } Naive.Box.Content.Calendar = { initialize: function () { // Calendar search list $(function() { $(".calSearchResult").jCarouselLite({ btnNext : ".calSearchListNext", // Calendar search list elem Next Button btnPrev : ".calSearchListPrevious", // Calendar search list elem Back Button visible : 6, // Calendar search list elem visibility scroll : 6, // Calendar search list elem scrolled by speed : 800, // Calendar search list elem speed vertical : true, // Calendar search list elem direction circular : false // Calendar search list elem 's Loop }); }); $("#contentContainer1 a[rel=ajaxCalendarDetail]").unbind('click'); $("#contentContainer1 a[rel=ajaxCalendarDetail]").click(function(){ strUrl = $(this).attr("href") + "/ajax"; $("#contentContainer1 .calRightDetailsContentContainer").fadeOut(50); $("#contentContainer1 .calSearchResultMusicActive").removeClass("calSearchResultMusicActive").addClass("calSearchResultMusic"); $("#contentContainer1 .calSearchResultDvdActive").removeClass("calSearchResultDvdActive").addClass("calSearchResultDvd"); $("#contentContainer1 .calSearchResultBookActive").removeClass("calSearchResultBookActive").addClass("calSearchResultBook"); $("#contentContainer1 .calSearchResultYouthActive").removeClass("calSearchResultYouthActive").addClass("calSearchResultYouth"); if($(this).parent().hasClass("calSearchResultMusic")) { $(this).parent().removeClass("calSearchResultMusic").addClass("calSearchResultMusicActive"); } if($(this).parent().hasClass("calSearchResultDvd")) { $(this).parent().removeClass("calSearchResultDvd").addClass("calSearchResultDvdActive"); } if($(this).parent().hasClass("calSearchResultBook")) { $(this).parent().removeClass("calSearchResultBook").addClass("calSearchResultBookActive"); } if($(this).parent().hasClass("calSearchResultYouth")) { $(this).parent().removeClass("calSearchResultYouth").addClass("calSearchResultYouthActive"); } $("#contentContainer1 .calRightDetailsContentContainer").load(strUrl, null, function() { $("#contentContainer1 .calRightDetailsContentContainer").fadeIn(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer2 a[rel=ajaxCalendarDetail]").unbind('click'); $("#contentContainer2 a[rel=ajaxCalendarDetail]").click(function(){ strUrl = $(this).attr("href") + "/ajax"; $("#contentContainer2 .calRightDetailsContentContainer").fadeOut(50); $("#contentContainer2 .calSearchResultMusicActive").removeClass("calSearchResultMusicActive").addClass("calSearchResultMusic"); $("#contentContainer2 .calSearchResultDvdActive").removeClass("calSearchResultDvdActive").addClass("calSearchResultDvd"); $("#contentContainer2 .calSearchResultBookActive").removeClass("calSearchResultBookActive").addClass("calSearchResultBook"); $("#contentContainer2 .calSearchResultYouthActive").removeClass("calSearchResultYouthActive").addClass("calSearchResultYouth"); if($(this).parent().hasClass("calSearchResultMusic")) { $(this).parent().removeClass("calSearchResultMusic").addClass("calSearchResultMusicActive"); } if($(this).parent().hasClass("calSearchResultDvd")) { $(this).parent().removeClass("calSearchResultDvd").addClass("calSearchResultDvdActive"); } if($(this).parent().hasClass("calSearchResultBook")) { $(this).parent().removeClass("calSearchResultBook").addClass("calSearchResultBookActive"); } if($(this).parent().hasClass("calSearchResultYouth")) { $(this).parent().removeClass("calSearchResultYouth").addClass("calSearchResultYouthActive"); } $("#contentContainer2 .calRightDetailsContentContainer").load(strUrl, null, function() { $("#contentContainer2 .calRightDetailsContentContainer").fadeIn(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer3 a[rel=ajaxCalendarDetail]").unbind('click'); $("#contentContainer3 a[rel=ajaxCalendarDetail]").click(function(){ strUrl = $(this).attr("href") + "/ajax"; $("#contentContainer3 .calRightDetailsContentContainer").fadeOut(50); $("#contentContainer3 .calSearchResultMusicActive").removeClass("calSearchResultMusicActive").addClass("calSearchResultMusic"); $("#contentContainer3 .calSearchResultDvdActive").removeClass("calSearchResultDvdActive").addClass("calSearchResultDvd"); $("#contentContainer3 .calSearchResultBookActive").removeClass("calSearchResultBookActive").addClass("calSearchResultBook"); $("#contentContainer3 .calSearchResultYouthActive").removeClass("calSearchResultYouthActive").addClass("calSearchResultYouth"); if($(this).parent().hasClass("calSearchResultMusic")) { $(this).parent().removeClass("calSearchResultMusic").addClass("calSearchResultMusicActive"); } if($(this).parent().hasClass("calSearchResultDvd")) { $(this).parent().removeClass("calSearchResultDvd").addClass("calSearchResultDvdActive"); } if($(this).parent().hasClass("calSearchResultBook")) { $(this).parent().removeClass("calSearchResultBook").addClass("calSearchResultBookActive"); } if($(this).parent().hasClass("calSearchResultYouth")) { $(this).parent().removeClass("calSearchResultYouth").addClass("calSearchResultYouthActive"); } $("#contentContainer3 .calRightDetailsContentContainer").load(strUrl, null, function() { $("#contentContainer3 .calRightDetailsContentContainer").fadeIn(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer1 .calFormMonth").change(function(){ monthRequest = $(this).val(); strUrl = "/calendar/list" + monthRequest + '/ajax'; $("#contentContainer1 .calContentContainer").fadeOut(50); $("#contentContainer1 .calContentContainer").load(strUrl, function(){ $("#contentContainer1 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer2 .calFormMonth").change(function(){ monthRequest = $(this).val(); strUrl = "/calendar/list" + monthRequest + '/ajax'; $("#contentContainer2 .calContentContainer").fadeOut(50); $("#contentContainer2 .calContentContainer").load(strUrl, function(){ $("#contentContainer2 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer3 .calFormMonth").change(function(){ monthRequest = $(this).val(); strUrl = "/calendar/list" + monthRequest + '/ajax'; $("#contentContainer3 .calContentContainer").fadeOut(50); $("#contentContainer3 .calContentContainer").load(strUrl, function(){ $("#contentContainer3 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer1 .calFormCategory").change(function(){ catRequest = $(this).val(); strUrl = "/calendar/list" + catRequest + '/ajax'; $("#contentContainer1 .calContentContainer").fadeOut(50); $("#contentContainer1 .calContentContainer").load(strUrl, function(){ $("#contentContainer1 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer2 .calFormCategory").change(function(){ catRequest = $(this).val(); strUrl = "/calendar/list" + catRequest + '/ajax'; $("#contentContainer2 .calContentContainer").fadeOut(50); $("#contentContainer2 .calContentContainer").load(strUrl, function(){ $("#contentContainer2 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer3 .calFormCategory").change(function(){ catRequest = $(this).val(); strUrl = "/calendar/list" + catRequest + '/ajax'; $("#contentContainer3 .calContentContainer").fadeOut(50); $("#contentContainer3 .calContentContainer").load(strUrl, function(){ $("#contentContainer3 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer1 .calFormRegion").change(function(){ catRequest = $(this).val(); strUrl = "/calendar/list" + catRequest + '/ajax'; $("#contentContainer1 .calContentContainer").fadeOut(50); $("#contentContainer1 .calContentContainer").load(strUrl, function(){ $("#contentContainer1 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer2 .calFormRegion").change(function(){ catRequest = $(this).val(); strUrl = "/calendar/list" + catRequest + '/ajax'; $("#contentContainer2 .calContentContainer").fadeOut(50); $("#contentContainer2 .calContentContainer").load(strUrl, function(){ $("#contentContainer2 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); $("#contentContainer3 .calFormRegion").change(function(){ catRequest = $(this).val(); strUrl = "/calendar/list" + catRequest + '/ajax'; $("#contentContainer3 .calContentContainer").fadeOut(50); $("#contentContainer3 .calContentContainer").load(strUrl, function(){ $("#contentContainer3 .calContentContainer").fadeIn(200); Naive.Box.Content.Calendar.initialize(); Naive.Ctl.Content.initialize(); }); }); } } Naive.Box.Content.Category = { initialize: function () { // Categories new's configuration for(i=1;i<4;i++) { $(function() { $("#contentContainer" + i + " .catNewsCarousel").jCarouselLite({ btnNext : "#contentContainer" + i + " .btnCatNewsForward", // News' Next Button btnPrev : "#contentContainer" + i + " .btnCatNewsBackward", // News' Back Button visible : 3, // News' visibility scroll : 3, // News' scrolled by speed : 800, // News' speed circular : false // News' Loop }); }); } // // Categories artists list $(function() { $(".catArtistsSearch input").keyup(function(){ $(this).parent().next().next().load($(this).attr('rel'), {strSearch: this.value}, function() { Naive.Ctl.Content.initialize(); Naive.Box.Content.Category.updateArtists(); }); }); $(".catArtistsSearch input").focus(function() { if($(this).attr("value") == $(this).attr("relValue")) { $(this).attr("value", ""); } }); $(".catArtistsSearch input").blur(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("relValue")); } }); }); $(window).resize(function(){ Naive.Box.Content.Category.resize(); }); Naive.Box.Content.Category.updateArtists(); }, updateArtists: function() { // Categories artists list for(i=1;i<4;i++) { $(function() { $("#contentContainer" + i + " .catArtistsResults").jCarouselLite({ btnNext : "#contentContainer" + i + " .catArtistsNext", // Artists Next Button btnPrev : "#contentContainer" + i + " .catArtistsPrevious", // Artists Back Button mouseWheel : true, visible : 8, // Artists visibility scroll : 8, // Artists scrolled by speed : 800, // Artists speed vertical : true, // Artists direction circular : false // Artists Loop }); }); } }, resize: function(){ if($(window).height() >= 699) { $(".catScrollPane").css({"background": "url('/public/img/front/gui/bkg/bkgCatScrollPane.gif')"}); } else { $(".catScrollPane").css({"background": "none"}); } } } Naive.Box.Content.Home = { initialize: function () { // // Homepage new's configuration $(function() { for(i=1;i<4;i++) { $("#contentContainer" + i + " .headlines").jCarouselLite({ btnNext : "#contentContainer" + i + " .btnNewsForward", // News' Next Button btnPrev : "#contentContainer" + i + " .btnNewsBackward", // News' Back Button visible : 4, // News' visibility scroll : 4, // News' scrolled by speed : 800, // News' speed auto : false, // News' auto scroll every (ms) circular : false // News' Loop }); } }); //Check if it's the first page to be loaded. If it is, let it minimized. Otherwised, open it. objNav = Naive.Ctl.NavHistory.getNav(); if(objNav.strPreviousUrl === null && objNav.strNextUrl === null) { Naive.Box.Content.Home.hideNews(); setTimeout(Naive.Box.Content.Home.showNews, 3000); } $('.news h2').unbind('click'); $('.news h2').click(function(){ if(Naive.Box.Content.Home.booShowNews === false) { Naive.Box.Content.Home.showNews(); } else { Naive.Box.Content.Home.hideNews(); } }); }, booShowNews: true, showNews: function() { $('.news').css({"height":"360px"}); sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); this.booShowNews = true; }, hideNews: function() { $('.news').css({"height":"35px"}); sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); this.booShowNews = false; } } Naive.Box.Content.Newsletter = { initialize: function () { $('.nlFormUnsubscription').submit(function() { var strUrl = $(this).attr("action"); var booRegionNewsletter = $(this).children().children().children(".nlBooRegionNewsletter").attr("checked") === true ? 1 :0; var booArtistNewsletter = $(this).children().children().children(".nlBooArtistNewsletter").attr("checked") === true ? 1 :0; var booPartnerNewsletter = $(this).children().children().children(".nlBooPartnerNewsletter").attr("checked") === true ? 1 :0; var booNewsletter = $(this).children().children().children(".nlBooNewsletter").attr("checked") === true ? 1 :0; jsonReturn = $.post(strUrl, { booRegionNewsletter: booRegionNewsletter, booArtistNewsletter: booArtistNewsletter, booNewsletter: booNewsletter, booPartnerNewsletter:booPartnerNewsletter}, function(data){ $(".nlSubmitMessage").show(); setTimeout(function() {$(".nlSubmitMessage").fadeOut(300)}, 3000); }, "json"); return false; }); } } Naive.Box.Content.Search = { currentUrlResults:null, initialize: function () { for(i=1;i<4;i++) { $("#contentContainer" + i + " .searchResultCarouselMusic").jCarouselLite({ visible : 3, // Calendar search list elem visibility scroll : 3, // Calendar search list elem scrolled by speed : 800, // Calendar search list elem speed vertical : false, // Calendar search list elem direction circular : false , btnNext: "#contentContainer" + i + " .searchResultCarouselNextMusic", btnPrev: "#contentContainer" + i + " .searchResultCarouselPrevMusic" }); } for(i=1;i<4;i++) { $("#contentContainer" + i + " .searchResultCarouselBook").jCarouselLite({ visible : 3, // Calendar search list elem visibility scroll : 3, // Calendar search list elem scrolled by speed : 800, // Calendar search list elem speed vertical : false, // Calendar search list elem direction circular : false , btnNext: "#contentContainer" + i + " .searchResultCarouselNextBook", btnPrev: "#contentContainer" + i + " .searchResultCarouselPrevBook" }); } for(i=1;i<4;i++) { $("#contentContainer" + i + " .searchResultCarouselDvd").jCarouselLite({ visible : 3, // Calendar search list elem visibility scroll : 3, // Calendar search list elem scrolled by speed : 800, // Calendar search list elem speed vertical : false, // Calendar search list elem direction circular : false , btnNext: "#contentContainer" + i + " .searchResultCarouselNextDvd", btnPrev: "#contentContainer" + i + " .searchResultCarouselPrevDvd" }); } for(i=1;i<4;i++) { $("#contentContainer" + i + " .searchResultCarouselYouth").jCarouselLite({ visible : 3, // Calendar search list elem visibility scroll : 3, // Calendar search list elem scrolled by speed : 800, // Calendar search list elem speed vertical : false, // Calendar search list elem direction circular : false , btnNext: "#contentContainer" + i + " .searchResultCarouselNextYouth", btnPrev: "#contentContainer" + i + " .searchResultCarouselPrevYouth" }); } for(i=1;i<4;i++) { $("#contentContainer" + i + " .searchResultCarouselPlaylist").jCarouselLite({ visible : 3, // Calendar search list elem visibility scroll : 3, // Calendar search list elem scrolled by speed : 800, // Calendar search list elem speed vertical : false, // Calendar search list elem direction circular : false , btnNext: "#contentContainer" + i + " .searchResultCarouselNextPlaylist", btnPrev: "#contentContainer" + i + " .searchResultCarouselPrevPlaylist" }); } for(i=1;i<4;i++) { $("#contentContainer" + i + " .searchResultCarouselOnlyOneCategory").jCarouselLite({ visible : 1, // Calendar search list elem visibility scroll : 1, // Calendar search list elem scrolled by speed : 800, // Calendar search list elem speed vertical : false, // Calendar search list elem direction circular : false , btnNext: "#contentContainer" + i + " .searchResultCarouselBigButtonContainerNext", btnPrev: "#contentContainer" + i + " .searchResultCarouselBigButtonContainerPrevious" }); } $(".searchPartLeft a").unbind("click"); $(".searchPartLeft a").click(function() { strUrlOneCat = $(this).attr("href"); if(Naive.Box.Content.Search.currentUrlResults === strUrlOneCat) { strUrlAllCat = $(this).attr("rel"); Naive.Box.Content.Search.currentUrlResults = strUrlAllCat; strUrl = strUrlAllCat; } else { Naive.Box.Content.Search.currentUrlResults = strUrlOneCat; strUrl = strUrlOneCat; } $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .searchPartLeft").next().fadeOut(200); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .searchPartLeft").next().load(strUrl, function(){ $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .searchPartLeft").next().fadeIn(200); Naive.Box.Content.Search.initialize(); Naive.Ctl.Content.initialize(); }); }); $(".searchTopMenu a").unbind("click"); $(".searchTopMenu a").click(function() { strUrl = $(this).attr("href"); Naive.Box.Content.Search.currentUrlResults = strUrl; SWFAddress.setValue(strUrl); Naive.Ctl.NavHistory.updateEntry(strUrl); strUrl = strUrl + '/ajaxsearch'; $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .searchResultsContainer").fadeOut(200); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .searchResultsContainer").load(strUrl, function(){ $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .searchResultsContainer").fadeIn(200); Naive.Box.Content.Search.initialize(); Naive.Ctl.Content.initialize(); }); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " a.searchTopMenuButton").addClass("searchTopMenuButtonInactive") .removeClass("searchTopMenuButton"); $(this).addClass("searchTopMenuButton") .removeClass("searchTopMenuButtonInactive"); }); } } Naive.Box.Content.Spirit = { initialize: function () { $(".spiritRightBoxVideoCarouselElementContainer").mouseover(function(){ $(this).addClass("spiritRightBoxVideoCarouselElementContainerHover"); $(".spiritRightBoxVideoCarouselButtonContainer", this).css("visibility","visible"); }); $(".spiritRightBoxVideoCarouselElementContainer").mouseout(function(){ $(this).removeClass("spiritRightBoxVideoCarouselElementContainerHover"); $(".spiritRightBoxVideoCarouselButtonContainer", this).css("visibility","hidden"); }); // Other content carousel navigation buttons for(i=1;i<4;i++) { $("#contentContainer" + i + " .spiritRightBoxOtherContentCarouseltest").jCarouselLite({ btnNext : "#contentContainer" + i + " .spiritNavigationContainerRightOtherContentCarousel .spiritNavNext", // Discography search list elem Next Button btnPrev : "#contentContainer" + i + " .spiritNavigationContainerRightOtherContentCarousel .spiritNavPrevious", // Discography search list elem Back Button visible : 1, // Other Content search list elem visibility scroll : 1, // Other Content search list elem scrolled by speed : 800, // Other Content search list elem speed vertical : false, // Other Content search list elem direction circular : false // Other Content search list elem 's Loop }); } } } Naive.Box.Content.Profile = { initialize: function () { //Catch the ENTER action on the form $(".profMessageForm").submit(function() { $('.profButtonSend').click(); return false; }); $(".profMainCarouselElem").mouseover(function(){ $(this).addClass("profMainCarouselElemHover"); $(".profMainCarouselElemName" , this).css("color", "#FFC900"); $(".profMainCarouselElemDesc" , this).css("color" , "#FFC900"); }); $(".profMainCarouselElem").mouseout(function(){ $(this).removeClass("profMainCarouselElemHover"); $(".profMainCarouselElemName" , this).css("color", "#FFF"); $(".profMainCarouselElemDesc" , this).css("color" , "#FFF"); //$(".spiritRightBoxVideoCarouselButtonContainer", this).css("visibility","hidden"); }); // Other content carousel navigation buttons for(i=1;i<4;i++) { $("#contentContainer" + i + " .profRightBoxOtherContentCarouseltest").jCarouselLite({ btnNext : "#contentContainer" + i + " .profNavigationContainerRightOtherContentCarousel .profNavNext", // Discography search list elem Next Button btnPrev : "#contentContainer" + i + " .profNavigationContainerRightOtherContentCarousel .profNavPrevious", // Discography search list elem Back Button visible : 5, // Other Content search list elem visibility scroll : 5, // Other Content search list elem scrolled by speed : 800, // Other Content search list elem speed vertical : true, // Other Content search list elem direction circular : false // Other Content search list elem 's Loop }); } // Other content carousel navigation buttons for(i=1;i<4;i++) { $("#contentContainer" + i + " .profCarouselRoutes").jCarouselLite({ btnNext : "#contentContainer" + i + " .profNavNextRoute", // Discography search list elem Next Button btnPrev : "#contentContainer" + i + " .profNavPreviousRoute",// Discography search list elem Back Button visible : 5, // Other Content search list elem visibility scroll : 5, // Other Content search list elem scrolled by speed : 800, // Other Content search list elem speed vertical : true, // Other Content search list elem direction circular : false // Other Content search list elem 's Loop }); } for(i=1;i<4;i++) { $("#contentContainer" + i + " .profPlaylistCarousel").jCarouselLite({ btnNext : "#contentContainer" + i + " .profPlaylistDown", // Discography search list elem Next Button btnPrev : "#contentContainer" + i + " .profPlaylistUp", // Discography search list elem Back Button visible : 3, // Other Content search list elem visibility scroll : 3, // Other Content search list elem scrolled by speed : 800, // Other Content search list elem speed vertical : true, // Other Content search list elem direction circular : false // Other Content search list elem 's Loop }); } $(".profMessageForm input, .profMessageForm textarea").focus(function() { if($(this).attr("value") == $(this).attr("rel")) { $(this).attr("value", ""); $(this).css({"color":"#000"}); } jsonReturn = $.post(Naive.Paths.BASEURL + "auth/isauth", {}, function(data) { if(data.authenticated === 0) { Naive.Ctl.Lightbox.showLogin(); } }, "json"); }); $(".profMessageForm input, .profMessageForm textarea").blur(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("rel")); $(this).css({"color":"#999"}); } }); $('.profButtonSend').click(function(){ jsonReturn = $.post(Naive.Paths.BASEURL + "auth/isauth", {}, function(data) { if(data.authenticated === 0) { Naive.Ctl.Lightbox.showLogin(); } else { i = Naive.Ctl.Content.currentContainer; if( $("#contentContainer" + i + " .profMessageFormSubject").attr("value") !== '' && $("#contentContainer" + i + " .profMessageFormSubject").attr("value") !== $("#contentContainer" + i + " .profMessageFormSubject").attr("rel") && $("#contentContainer" + i + " .profMessageFormContent").attr("value") !== '' && $("#contentContainer" + i + " .profMessageFormContent").attr("value") !== $("#contentContainer" + i + " .profMessageFormContent").attr("rel")) { var strUrl = $("#contentContainer" + i + " .profMessageForm").attr("action"); var strSubject = $("#contentContainer" + i + " .profMessageFormSubject").attr("value"); var strContent = $("#contentContainer" + i + " .profMessageFormContent").attr("value"); jsonReturn = $.post(strUrl, { strSubject: strSubject, strContent: strContent}, function(data){ //Message OK if(data.strError === 0) { Naive.Ctl.Lightbox.show('/profile/sendmail'); $(".profMessageFormSubject").attr("value", ""); $(".profMessageFormContent").attr("value", ""); $(".profMessageForm input, .profMessageForm textarea").blur(); //Message KO } else { $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormSubject").css({'color':'#F00'}); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormContent").css({'color':'#F00'}); setTimeout(function() { $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormSubject").css({'color':'#555'}); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormContent").css({'color':'#555'}); }, 2000); } }, "json"); } else { $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormSubject").css({'color':'#F00'}); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormContent").css({'color':'#F00'}); setTimeout(function() { $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormSubject").css({'color':'#555'}); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .profMessageFormContent").css({'color':'#555'}); }, 2000); } } }, "json"); }); } } Naive.Box.Content.Store = { initialize: function () { $('.storeFormNewsletter').submit(function() { var strUrl = $(this).attr("action"); var strEmail = $(this).children().children(".inputStoreSearch").attr("value"); jsonReturn = $.post(strUrl, { strEmail: strEmail}, function(data){ $(".storeNewsletterDisplay").html(data.strMessage); $(".storeNewsletterDisplay").show(); setTimeout(function() {$(".storeNewsletterDisplay").fadeOut(300)}, 3000); }, "json"); return false; }); } } Naive.Box.Lightbox.Flipbook = { initialize: function () { $("#lightboxContent").css({"opacity":0}); //Trigger once the image is loaded $("a[rel=flipAjax]").unbind('click'); $("a[rel=flipAjax]").click(function(){ strLink = $(this).attr("href"); $("#lightboxContent").css({"opacity":0}); $("#lightboxContent").load(strLink, null, function() { $("#lightboxContent img").load(function(){ Naive.Ctl.Lightbox.resize(); $("#lightboxContent").animate({"opacity":1}); }); }); }); $("#lightboxContent img").load(function(){ Naive.Ctl.Lightbox.resize(); $("#lightboxContent").css({"opacity":1}); }); } } Naive.Box.Lightbox.Identification = { initialize: function () { $('#formIdent').submit(function() { var strUrl = $(this).attr("action"); var strUsername = $("#identLeftLoginField").attr("value"); var strPassword = $("#identLeftLoginPassword").attr("value"); var booSaveValue = $('#identLeftLoginSaveCheck').attr("checked") === true ? 1 :0; jsonReturn = $.post(strUrl, { strUsername: strUsername, strPassword: strPassword, booSaveValue: booSaveValue}, function(data){ //Login ok if(data.strError === 0) { var strUrl = Naive.Ctl.Lightbox.strUrlAfterLogin; if(strUrl.length > 0) { Naive.Ctl.Lightbox.show(strUrl); } else { Naive.Ctl.Lightbox.hide(); Naive.Ctl.Content.reloadCurrent(); } Naive.Box.Menu.Bottom.showLogoutButton(); //Login ok but account not yet activated } else if(data.strError === "Account not activated"){ $('#identLost').hide(); $('#identLeftFormLogin').hide(); $('#identActiv').fadeIn(300); //Login KO } else { $("#identLeftMessageError").show(); setTimeout(function() {$("#identLeftMessageError").fadeOut(300)}, 3000); } }, "json"); return false; }); $('#formActiv').submit(function() { var strUrl = $(this).attr("action"); var strActivationCode = $("#identActivCodeInput").attr("value"); jsonReturn = $.post(strUrl, { strActivationCode: strActivationCode}, function(data){ //Activation Code OK if(data.strError === 0) { Naive.Ctl.Lightbox.hide(); //Activation Code KO } else { $("#identActivMessageError").show(); setTimeout(function() {$("#identActivMessageError").fadeOut(300)}, 3000); } }, "json"); return false; }); $('#identActivSendEmail a').click(function() { var strUrl = $(this).attr("rel"); jsonReturn = $.get(strUrl, {}, function(data){ //Activation Code OK if(data.strError === 0) { $("#identActivSendEmailMessage").show(); setTimeout(function() {$("#identActivSendEmailMessage").fadeOut(300)}, 3000); //Activation Code KO } else { $("#identActivSendEmailMessage").show(); setTimeout(function() {$("#identActivSendEmailMessage").fadeOut(100)}, 500); } }, "json"); return false; }); $('#formLost').submit(function() { var strUrl = $(this).attr("action"); var strEmail = $("#identLostEmailInput").attr("value"); jsonReturn = $.post(strUrl, { strEmail: strEmail}, function(data){ if(data.strError === 0) { $("#identLostMessageOk").show(); setTimeout(function() { $("#identLostMessageOk").fadeOut(300, function() { $('#identLost').hide(); $('#identLeftFormLogin').hide(); $('#identLeftFormLogin').fadeIn(300); }); }, 1000); } else { $("#identLostMessageError").show(); setTimeout(function() {$("#identLostMessageError").fadeOut(300)}, 3000); } }, "json"); return false; }); $('.identLeftForgetPass a').click(function(){ anchor = $(this).attr("href"); $('#identLost').hide(); $('#identActiv').hide(); $('#identLeftFormLogin').hide(); if(anchor.substring(anchor.length - 6, anchor.length) === "#login") { $('#identLeftFormLogin').fadeIn(300); } else if(anchor.substring(anchor.length - 13, anchor.length) === "#lostPassword") { $('#identLost').fadeIn(300); } else if(anchor.substring(anchor.length - 11, anchor.length) === "#identActiv") { $('#identActiv').fadeIn(300); } }); //Replace on safari the checkbox label if($.browser.safari) { $("#identLeftLoginSaveLabelDetail label").css({"top":"3px"}); } $("#identLeftLoginElement input").focus(function() { if($(this).attr("value") == $(this).attr("rel")) { $(this).attr("value", ""); $(this).css({"color":"#000"}); } }); $("#identLeftLoginElement input").blur(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("rel")); $(this).css({"color":"#999"}); } }); Naive.Box.Lightbox.Identification.animeImage(); }, currentImage: 0, animeImage: function(){ previousImage = this.currentImage; currentImage = (previousImage + 1)%3; arrImages = { 0: 'identRightBoxTransitionSecond', 1: 'identRightBoxTransitionFirst', 2: 'identRightBoxTransitionThird' } arrImagesEn = { 0: 'identRightBoxTransitionSecond_eng', 1: 'identRightBoxTransitionFirst_eng', 2: 'identRightBoxTransitionThird_eng' } $('.identRightBoxTransition').fadeOut(200, function(event) { $('.identRightBoxTransition').removeClass(arrImages[previousImage]) $('.identRightBoxTransition').addClass(arrImages[currentImage]).fadeIn(500); }); $('.identRightBoxTransition_eng').fadeOut(200, function(event) { $('.identRightBoxTransition_eng').removeClass(arrImagesEn[previousImage]) $('.identRightBoxTransition_eng').addClass(arrImagesEn[currentImage]).fadeIn(500); }); this.currentImage = currentImage; setTimeout(Naive.Box.Lightbox.Identification.animeImage, 3000); } } Naive.Box.Lightbox.Account = { initialize: function () { $("#accHomeButton").click( function(){ Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/"); }); $("#accProfileButton").click( function(){ Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/profile"); }); $("#accNewsButton").click( function(){ Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/news"); }); }, submitProfile:function() { $('#accForm').submit(); }, initializeHome: function() { // Artist on homepage $('#accHomeArtistCarousel').serialScroll({ items:'li', prev:'#accHomeLeftCarouselButtonUp', next:'#accHomeLeftCarouselButtonDown', offset:0, //when scrolling to photo, stop 230 before reaching it (from the left) step:10, axis:'y', start:1, //as we are centering it, start at the 2nd duration:2500, force:true, stop:true, lock:false, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: false //click on the images to scroll to them }); // Category on homepage $('#accHomeCarouselCategory').serialScroll({ items:'li', prev:'#accHomeLeftCarouselCategoryButtonUp', next:'#accHomeLeftCarouselCategoryButtonDown', offset:0, //when scrolling to photo, stop 230 before reaching it (from the left) step:10, axis:'y', start:1, //as we are centering it, start at the 2nd duration:2500, force:true, stop:true, lock:false, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: false //click on the images to scroll to them }); $('#accHomeRightButton').click(function(){ Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/news"); }); $('#accHomeLeftButton').click(function(){ Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/news"); }); $('#accHomeLeftTopButton').click(function(){ Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/profile"); }); $('#accHomeLeftBottomButton').click(function(){ Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/download"); }); }, initializeProfile: function() { $('#accForm').submit(function() { var strUrl = $(this).attr("action"); var strTitle = $(".accFormLoginSaveCheck:checked").attr("value"); var strFirstName = $("#accFormFirstname").attr("value"); var strLastName = $("#accFormFieldLastName").attr("value"); var dayBirth = $("#accFormBithDay").attr("value"); var monthBirth = $("#accFormBithMonth").attr("value"); var yearBirth = $("#accFormBithYear").attr("value"); var strEmail = $("#accFormFieldEmail").attr("value"); var strPassword = $("#accFormPassword").attr("value"); var strPassword2 = $("#accFormPasswordConfirmation").attr("value"); var booNaiveOptin = $("#accFormBooNaiveOptin").attr("checked") === true ? 1 :0; var booPartnerOptin = $("#accFormBooPartnerOptin").attr("checked") === true ? 1 :0; var strAddress = $("#accFormAddress").attr("value"); var strZipCode = $("#accFormZipcode").attr("value"); var strCity = $("#accFormCity").attr("value"); var strCountry = $("#accFormcountry").attr("value"); var strWorkActivity = $("#accFormProfession").attr("value"); var intChildren = $("#accFormChildren").attr("value"); var intNaiveProducts = $("#accFormNaiveWorks").attr("value"); var booDisplayName = $("#accFormDisplayName").attr("checked") === true ? 1 :0; var booDisplayBirthdate = $("#accFormDisplayBirthdate").attr("checked") === true ? 1 :0; var booDisplayCity = $("#accFormDisplayCity").attr("checked") === true ? 1 :0; var booDisplayCountry = $("#accFormDisplayCountry").attr("checked") === true ? 1 :0; var booDisplayEmail = $("#accFormDisplayEmail").attr("checked") === true ? 1 :0; jsonReturn = $.post(strUrl, { strTitle: strTitle, strFirstName: strFirstName, strLastName: strLastName, dayBirth: dayBirth, monthBirth: monthBirth, yearBirth: yearBirth, strEmail: strEmail, strPassword: strPassword, strPassword2: strPassword2, booNaiveOptin: booNaiveOptin, booPartnerOptin: booPartnerOptin, strAddress: strAddress, strZipCode: strZipCode, strCity: strCity, strCountry: strCountry, strWorkActivity: strWorkActivity, intChildren: intChildren, intNaiveProducts: intNaiveProducts, booDisplayName: booDisplayName , booDisplayBirthdate :booDisplayBirthdate , booDisplayCity :booDisplayCity , booDisplayCountry :booDisplayCountry, booDisplayEmail :booDisplayEmail }, function(data){ if(data.strError === 0) { $("#accMyProfile").fadeOut('fast'); Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + "account/profile"); // $("#accLeftMessageOk").html(data.strOk); // $("#accLeftMessageOk").show(); // setTimeout(function() {$("#accLeftMessageOk").fadeOut(300)}, 3000); //Naive.Ctl.Lightbox.hide(); } else { $("#accLeftMessageError").html(data.strError); $("#accLeftMessageError").show(); setTimeout(function() {$("#accLeftMessageError").fadeOut(300)}, 3000); } }, "json"); return false; }); //at loading replace missing field by the name of it $("#accForm input").each(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("rel")); $(this).css({"color":"#999"}); } }); //when the user focus on an empty field, remove the name of it $("#accForm input").focus(function() { if($(this).attr("value") == $(this).attr("rel")) { $(this).attr("value", ""); $(this).css({"color":"#000"}); } }); //when the user leave an input empty, replace it by the name of it $("#accForm input").blur(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("rel")); $(this).css({"color":"#999"}); } }); $("#accPlayerMgmt").click(function() { Naive.Ctl.Lightbox.hide(); Naive.Box.Player.openPlaylistManager(); }); $(".accPlayerSkinImageEnabled").click(function(){ $(".accPlayerSkinImageEnabled").css({"border":"0px"}); $(this).css({"border":"1px #b4c7cb solid"}); strUrl = '/account/changeskinajax'; strSkinName = $(this).attr("rel"); jsonReturn = $.post(strUrl, { strSkinName: strSkinName}, function(data){ if(data.strError === 0) { document.getElementById('playerContainerFlash').reloadSkin(data.strSkinName); } else { alert("Error : Unkonwn skin!"); } }, "json"); }); }, initializeNews: function() { //When selecting a category in the select box, ajax-add it $("#accNewsListCategory").unbind('change'); $("#accNewsListCategory").change(function(){ idCat = $(this).val(); if(idCat > 0) { $("#accNewsCategoryCarousel ul").load('/account/newsaddcategoryajax/' + idCat, {}, function() { Naive.Box.Lightbox.Account.refreshNewsCategoryCarousel(); }); } }); //When selecting an artist in the select box, ajax-add it $("#accNewsListArtist").unbind('change'); $("#accNewsListArtist").change(function(){ idCat = $(this).val(); if(idCat > 0) { $("#accNewsArtistCarousel ul").load('/account/newsaddartistajax/' + idCat, {}, function() { Naive.Box.Lightbox.Account.refreshNewsArtistCarousel(); }); } }); Naive.Box.Lightbox.Account.refreshNewsCategoryCarousel(); Naive.Box.Lightbox.Account.refreshNewsArtistCarousel(); $("#accNewsCalendar input").click(function(){ booRegionOptin = $(this).val(); $.post('/account/newsregionajax/', {booRegionOptin: booRegionOptin}, function() { $("#accNewsCalendar").fadeOut('fast').fadeIn('fast'); }, "json"); }); $('#accNewsArtistCarousel').serialScroll({ items:'li', prev:'#accNewsArtistCarouselUp', next:'#accNewsArtistCarouselDown', offset:0, //when scrolling to photo, stop 230 before reaching it (from the left) step:10, axis:'y', start:1, //as we are centering it, start at the 2nd duration:2500, force:true, stop:true, lock:false, lazy:true, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: false //click on the images to scroll to them }); $('#accNewsCategoryCarousel').serialScroll({ items:'li', prev:'#accNewsCategoryCarouselUp', next:'#accNewsCategoryCarouselDown', offset:0, //when scrolling to photo, stop 230 before reaching it (from the left) step:10, axis:'y', start:1, //as we are centering it, start at the 2nd duration:2500, force:true, stop:true, lock:false, lazy:true, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: false //click on the images to scroll to them }); $("#accNewsSearchArtist").autocomplete("/account/searchartist", { width: 178, selectFirst: true, cacheLength: 100, max:100 }); $("#accNewsSearchArtist").focus(function(){ $(this).val(""); }); $("#accNewsSearchArtist").blur(function(){ $(this).val($(this).attr("rel")); }); $("#accNewsSearchArtist").result(function(event, data, formatted) { if (data) { $(this).val($(this).attr("rel")); $(this).blur(); idCat = data[1]; $("#accNewsArtistCarousel ul").load('/account/newsaddartistajax/' + idCat, {}, function() { Naive.Box.Lightbox.Account.refreshNewsArtistCarousel(); }); } }); }, refreshNewsCategoryCarousel: function() { $(".accNewsCarouselElemCategory .accNewsDeleteCategory").unbind('click'); $(".accNewsCarouselElemCategory .accNewsDeleteCategory").click(function(){ idCat = $(this).attr("rel"); $("#accNewsCategoryCarousel ul").load('/account/newsremovecategoryajax/' + idCat, {}, function() { Naive.Box.Lightbox.Account.refreshNewsCategoryCarousel(); }); }); $("#accNewsListCategory").val(0); // Mouseover on news Element $(".accNewsCarouselElemCategory").unbind('mouseover'); $(".accNewsCarouselElemCategory").mouseover(function(){ $(this).addClass("accNewsCarouselElemHoverCategory"); }); // Mouseout on news Element $(".accNewsCarouselElemCategory").unbind('mouseout'); $(".accNewsCarouselElemCategory").mouseout(function(){ $(this).removeClass("accNewsCarouselElemHoverCategory"); }); }, refreshNewsArtistCarousel: function() { $(".accNewsCarouselElem .accNewsDelete").unbind('click'); $(".accNewsCarouselElem .accNewsDelete").click(function(){ idCat = $(this).attr("rel"); $("#accNewsArtistCarousel ul").load('/account/newsremoveartistajax/' + idCat, {}, function() { Naive.Box.Lightbox.Account.refreshNewsArtistCarousel(); }); }); $("#accNewsListArtist").val(0); // Mouseover on artist Element $(".accNewsCarouselElem").unbind('mouseover'); $(".accNewsCarouselElem").mouseover(function(){ $(this).addClass("accNewsCarouselElemHover"); }); // Mouseout on artist Element $(".accNewsCarouselElem").unbind('mouseout'); $(".accNewsCarouselElem").mouseout(function(){ $(this).removeClass("accNewsCarouselElemHover"); }); } } Naive.Box.Lightbox.Register = { initialize: function () { $('#regForm').submit(function() { var strUrl = $(this).attr("action"); var strTitle = $(".regFormLoginSaveCheck:checked").attr("value"); var strFirstName = $("#regFormFirstname").attr("value"); var strLastName = $("#regFormFieldLastName").attr("value"); var dayBirth = $("#regFormBithDay").attr("value"); var monthBirth = $("#regFormBithMonth").attr("value"); var yearBirth = $("#regFormBithYear").attr("value"); var strEmail = $("#regFormFieldEmail").attr("value"); var strEmail2 = $("#regFormEmailConfirmation").attr("value"); var strUsername = $("#regFormPseudo").attr("value"); var strPassword = $("#regFormPassword").attr("value"); var strPassword2 = $("#regFormPasswordConfirmation").attr("value"); var booOptin = $("#regFormBooOptin").attr("checked") === true ? 1 :0; var booOptinPartner = $("#regFormBooOptinPartner").attr("checked") === true ? 1 :0; var strAddress = $("#regFormAddress").attr("value"); var strZipCode = $("#regFormZipcode").attr("value"); var strCity = $("#regFormCity").attr("value"); var strCountry = $("#regFormcountry").attr("value"); var strProfession = $("#regFormProfession").attr("value"); var intChildren = $("#regFormChildren").attr("value"); var intNaiveWorks = $("#regFormNaiveWorks").attr("value"); var idCategory = []; $("#regFormIdCategory input:checked").each(function(){ idCategory.push($(this).attr("value")); }); $("#regFormIdCategoryTeen input:checked").each(function(){ idCategory.push($(this).attr("value")); }); jsonReturn = $.post(strUrl, { strTitle: strTitle, strFirstName: strFirstName, strLastName: strLastName, dayBirth: dayBirth, monthBirth: monthBirth, yearBirth: yearBirth, strEmail: strEmail, strEmail2: strEmail2, strUsername: strUsername, strPassword: strPassword, strPassword2: strPassword2, booOptin: booOptin, booOptinPartner: booOptinPartner, strAddress: strAddress, strZipCode: strZipCode, strCity: strCity, strCountry: strCountry, strProfession: strProfession, intChildren: intChildren, intNaiveWorks: intNaiveWorks, 'idCategory[]': idCategory}, function(data){ if(data.strError === 0) { $("#regWelcomeTitleUsername").html($("#regFormFirstname").attr("value") + " " + $("#regFormFieldLastName").attr("value")); $("#regMainContent").hide(); $("#regFormHint").hide(); $("#regWelcome").fadeIn(); //Naive.Ctl.Lightbox.hide(); } else { $("#regLeftMessageError").html(data.strError); $("#regLeftMessageError").show(); setTimeout(function() {$("#regLeftMessageError").fadeOut(300)}, 3000); } }, "json"); return false; }); $('#regFormPseudoButton').click(function() { var strUrl = $(this).attr("href"); var strUsername = $("#regFormPseudo").attr("value"); jsonReturn = $.post(strUrl, { strUsername: strUsername}, function(data){ $("#regLeftMessageError").html(data.strMessage); $("#regLeftMessageError").show(); setTimeout(function() {$("#regLeftMessageError").fadeOut(300)}, 3000); }, "json"); return false; }); $("#regForm input").focus(function() { if($(this).attr("value") == $(this).attr("rel")) { $(this).attr("value", ""); $(this).css({"color":"#000"}); } }); $("#regForm input").blur(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("rel")); $(this).css({"color":"#999"}); } }); $('#regFormSelectLayerCategoryTeen').focus(function(){ $('#regFormNaiveWorks, #regFormSelectLayerCategory').fadeOut(); $(this).hide(1, function(){ $('#regFormIdCategoryTeen').fadeIn(300); $('#regFormCloseCategoryTeen').fadeIn(300); }); }); $('#regFormCatTeenCheckUncheckAll').click(function(){ $('#regFormIdCategoryTeenContainer input:checkbox').attr("checked",$(this).attr("checked")); }); $('#regFormCloseCategoryTeen').click(function(){ $(this).fadeOut(1, function(){ var valArray = $('#regFormIdCategoryTeenContainer input:checkbox:checked').serializeArray(); $('#regFormIdCategoryTeen').fadeOut(300); $('#regFormSelectLayerCategoryTeen').fadeIn(300); $("#regFormSelectCategoryTeenValue").empty(); jQuery.each(valArray, function(i, field){ $("#regFormSelectCategoryTeenValue").append( $('#catTeen' + field.value).html() + ","); }); if($("#regFormSelectCategoryTeenValue").html() == '') $("#regFormSelectCategoryTeenValue").html($('#regFormSelectCategoryTeenValue').attr('rel')); $('#regFormNaiveWorks, #regFormSelectLayerCategory').fadeIn(); }); }); $('#regFormSelectLayerCategory').focus(function(){ $(this).hide(1, function(){ $('#regFormIdCategory').fadeIn(300); $('#regFormCloseCategory').fadeIn(300); }); }); $('#regFormCatCheckUncheckAll').click(function(){ $('#regFormIdCategoryContainer input:checkbox').attr("checked",$(this).attr("checked")); }); $('#regFormCloseCategory').click(function(){ $(this).fadeOut(1, function(){ var valArray = $('#regFormIdCategoryContainer input:checkbox:checked').serializeArray(); $('#regFormIdCategory').fadeOut(300); $('#regFormSelectLayerCategory').fadeIn(300); $("#regFormSelectCategoryValue").empty(); jQuery.each(valArray, function(i, field){ $("#regFormSelectCategoryValue").append( $('#cat' + field.value).html() + ","); }); if($("#regFormSelectCategoryValue").html() == '') $("#regFormSelectCategoryValue").html($('#regFormSelectCategoryValue').attr('rel')); }); }); }, submit:function() { $('#regForm').submit(); }, login:function() { var strUrl = Naive.Paths.BASEURL + "auth/loginajax"; var strUsername = $("#regFormPseudo").attr("value"); var strPassword = $("#regFormPassword").attr("value"); var booSaveValue = 0; jsonReturn = $.post(strUrl, { strUsername: strUsername, strPassword: strPassword, booSaveValue: booSaveValue}, function(data){ //Login ok if(data.strError === 0 || data.strError === "Account not activated") { return true; //Login KO } else { return false; } }, "json"); } } Naive.Box.Lightbox.Gallery = { initialize: function () { // Picture Gallery $('#galCarousel').serialScroll({ items:'li', prev:'#galNavPrevious', next:'#galNavNext', offset:0, //when scrolling to photo, stop 230 before reaching it (from the left) step:5, start:1, //as we are centering it, start at the 2nd duration:3200, force:true, stop:true, lock:false, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: false //click on the images to scroll to them }); //Trigger once the image is loaded $("#galPic img").load(function(){ Naive.Box.Lightbox.Gallery.placeElements(); }); $("a[rel=galAjax]").click(function(){ strLink = $(this).attr("href"); $("#galCentered").css({"opacity" : "0"}); $("#galDownload").css({"visibility" : "hidden"}); $("#galCentered").css({"width" : "860px"}); $("#galTextContent").css({"width" : "300px"}); $("#galCentered").load(strLink, null, function() { $("#galPic img").load(function(){ Naive.Box.Lightbox.Gallery.placeElements(); $("#galCentered").animate({"opacity" : "1"}); $("#galDownload").css({"visibility" : "visible"}); }); }); }); }, placeElements: function() { if($("#galTextContent").width() > 300) { $("#galTextContent").width(300); } contentWidth = $("#galPic").width() + $("#galText").width() + 10; if(contentWidth > 860) { contentWidth = 860; $("#galTextContent").css({"width" : (860 - $("#galPic").width() - 30) + "px"}); $("#galCentered").css({"width" : "860px"}); } else { $("#galCentered").css({"width" : contentWidth + "px"}); } $("#galTextBorder").css({"height" : $("#galTextContent").height() + "px"}); downloadBtnMargin = (860 - contentWidth) / 2; $("#galDownload").css({"top" : ($("#galPic img").height() - 50) + "px", "left" : (downloadBtnMargin + $("#galPic img").width() / 2 - 71) + "px", "visibility" : "visible"}); Naive.Ctl.Lightbox.resize(); $("#gal").css({"visibility" : "visible"}); } } Naive.Box.Lightbox.View = { initialize: function () { $("#viePic img").load(function(){ if($("#vieTextContent").width() > 300) { $("#vieTextContent").width(300); } $("#vieTextBorder").css({"height" : $("#vieTextContent").height() + "px"}); contentWidth = $("#viePic").width() + $("#vieText").width() + 10; if(contentWidth > 760) { contentWidth = 760; $("#vieTextContent").css({"width" : (760 - $("#viePic").width() - 30) + "px"}); $("#vieCentered").css({"width" : "760px"}); } else { $("#vieCentered").css({"width" : contentWidth + "px"}); } downloadBtnMargin = (760 - contentWidth) / 2; $("#vieDownload").css({"top" : ($("#viePic img").height() - 50) + "px", "left" : (downloadBtnMargin + $("#viePic img").width() / 2 - 71) + "px"}); Naive.Ctl.Lightbox.resize(); $("#vie").css({"visibility" : "visible"}); }); } } Naive.Box.Lightbox.Friend = { initialize: function () { $('#friendForm').submit(function() { Naive.Box.Lightbox.Friend.submit(); return false; }); $('#friendSubmissionName').click(function() { Naive.Box.Lightbox.Friend.submit(); }); $("#friendMainContainer input, #friendMainContainer textarea").focus(function() { if($(this).attr("value") == $(this).attr("rel")) { $(this).attr("value", ""); } }); $("#friendMainContainer input, #friendMainContainer textarea").blur(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("rel")); } }); }, submit: function() { var strUrl = $('#friendForm').attr("action"); var strName = []; $("#friendMainContainer .name").each(function(){ strName.push($(this).attr("value") !== $(this).attr("rel")?$(this).attr("value"):''); }); var strEmail = []; $("#friendMainContainer .email").each(function(){ strEmail.push($(this).attr("value") !== $(this).attr("rel")?$(this).attr("value"):''); }); var strMessage = $("#friendMainContainer textarea").attr("value") !== $("#friendMainContainer textarea").attr("rel")?$("#friendMainContainer textarea").attr("value"):''; var strLink = Naive.Ctl.NavHistory.getCurrentEntry(); var idPlaylist = $("#friendMainContainer .idPlaylist").attr("value"); var idRoute = $("#friendMainContainer .idRoute").attr("value"); jsonReturn = $.post(strUrl, { 'strName[]': strName, 'strEmail[]': strEmail, strMessage: strMessage, strLink: strLink, idPlaylist: idPlaylist, idRoute: idRoute}, function(data){ if(data.strError === 0) { $("#friendMainContainer").hide(); var strName = []; $("#friendMainContainer .name").each(function(){ strName.push($(this).attr("value") !== $(this).attr("rel")?$(this).attr("value"):''); }); var strEmail = []; $("#friendMainContainer .email").each(function(){ strEmail.push($(this).attr("value") !== $(this).attr("rel")?$(this).attr("value"):''); }); strHtml = ""; for(i=0; i<6; i++) { if(strName[i].length > 0) { strHtml = strHtml + "

" + strName[i] + "
" + strEmail[i] + "

"; } } $("#friendResultContent").append(strHtml); $("#friendResult").fadeIn(); setTimeout(function() {Naive.Ctl.Lightbox.hide();}, 3000); //Naive.Ctl.Lightbox.hide(); } else { $("#friendMessageError").html(data.strError); $("#friendMessageError").show(); setTimeout(function() {$("#friendMessageError").fadeOut(300)}, 3000); } }, "json"); } } Naive.Box.Menu.Bottom = { initialize: function(){ // // Homepage ticker's configuration $(function() { $("#bottomMenuNews").jCarouselLite({ auto : 3000, // Ticker' speed speed : 400 // Ticker' auto scroll every (ms) }); }); $('#bottomMenu').fadeIn(1000); $('#bottomMenuLinks').fadeIn(1000); }, showLogoutButton: function() { $("#bottomMenuLogout").css({"display": "inline"}); }, hideLogoutButton: function() { $("#bottomMenuLogout").css({"display": "none"}); Naive.Box.Explorer.reinitialize(); } } Naive.Box.Menu.Container = { initialize: function(){ //Catch the ENTER action on the form $("#contentHeaderSearchFormForm").submit(function() { $("#searchButtonGo").click(); return false; }); $("#searchButtonGo").click(function() { if($("#contentHeaderSearchForm input").attr("value") != "" && $("#contentHeaderSearchForm input").attr("value") != $("#contentHeaderSearchForm input").attr("rel")) { strLink = Naive.Paths.BASEURL + 'search/all/all/content/' + encodeURI($("#contentHeaderSearchForm input").attr("value").replace("/","")); Naive.Ctl.Content.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); Naive.Ctl.Stats.trackPageview(strLink); Naive.Box.Menu.Container.updateArrows(); } }); $("#advanceSearchBottomButton").click(function() { if($("#contentHeaderSearchForm input").attr("value") != "" && $("#contentHeaderSearchForm input").attr("value") != $("#contentHeaderSearchForm input").attr("rel")) { $("#advanceSearchDiv").slideUp(50); strLink = Naive.Paths.BASEURL + 'search/' + $("#searchAdvancedCat").attr('value') + '/content/' + encodeURI($("#contentHeaderSearchForm input").attr('value').replace("/","")); Naive.Ctl.Content.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); Naive.Ctl.Stats.trackPageview(strLink); Naive.Box.Menu.Container.updateArrows(); } }); $(".contentContainerExplorer a").click(function() { if(Naive.Box.Explorer.isDisplayed) { Naive.Box.Explorer.hide(); } else { Naive.Box.Explorer.show(null, null); } }); $("#contentHistoricPrevious").click(function(){ if(Naive.Ctl.Content.actionInProgress === false) { objNav = Naive.Ctl.NavHistory.backNav(); if(objNav.strPreviousUrl !== null) { Naive.Ctl.Content.loadPrevious(objNav.strPreviousUrl); SWFAddress.setValue(objNav.strCurrentUrl); Naive.Ctl.Stats.trackPageview(objNav.strCurrentUrl); Naive.Box.Menu.Container.updateArrows(); } } }); $("#contentHistoricNext").click(function(){ if(Naive.Ctl.Content.actionInProgress === false) { objNav = Naive.Ctl.NavHistory.nextNav(); if(objNav.strNextUrl !== null) { Naive.Ctl.Content.loadNext(objNav.strNextUrl); SWFAddress.setValue(objNav.strCurrentUrl); Naive.Ctl.Stats.trackPageview(objNav.strCurrentUrl); Naive.Box.Menu.Container.updateArrows(); } } }); $("#contentHistoricFirst").click(function(){ if(Naive.Ctl.Content.actionInProgress === false) { if(Naive.Ctl.NavHistory.getNav().strPreviousUrl !== null) { objNav = Naive.Ctl.NavHistory.firstNav(); Naive.Ctl.Content.loadFirst(objNav); SWFAddress.setValue(objNav.strCurrentUrl); Naive.Ctl.Stats.trackPageview(objNav.strCurrentUrl); Naive.Box.Menu.Container.updateArrows(); } } }); $("#contentHistoricLast").click(function(){ if(Naive.Ctl.Content.actionInProgress === false) { if(Naive.Ctl.NavHistory.getNav().strNextUrl !== null) { objNav = Naive.Ctl.NavHistory.lastNav(); Naive.Ctl.Content.loadLast(objNav); SWFAddress.setValue(objNav.strCurrentUrl); Naive.Ctl.Stats.trackPageview(objNav.strCurrentUrl); Naive.Box.Menu.Container.updateArrows(); } } }); $("#searchQuery").focus(function() { if($(this).attr("value") == $(this).attr("rel")) { $(this).attr("value", ""); } }); $("#searchQuery").blur(function() { if($(this).attr("value") == "") { $(this).attr("value", $(this).attr("rel")); } }); $("#advanceButtonSearch").click(function(){ $("#advanceSearchDiv").slideDown(500); }); $("#advanceButtonSearchClose").click(function(){ $("#advanceSearchDiv").slideUp(500); }); }, updateArrows:function() { //Now that we moved, disable/enable arrows objNav = Naive.Ctl.NavHistory.getNav(); if(objNav.strPreviousUrl === null) { $("#contentHistoricPrevious, #contentHistoricFirst").css({"opacity":0.08, "cursor": "auto"}); } else { $("#contentHistoricPrevious, #contentHistoricFirst").css({"opacity":1.0, "cursor": "pointer"}); } if(objNav.strNextUrl === null) { $("#contentHistoricNext, #contentHistoricLast").css({"opacity":0.08, "cursor": "auto"}); } else { $("#contentHistoricNext, #contentHistoricLast").css({"opacity":1.0, "cursor": "pointer"}); } } } Naive.Box.Menu.Top = { timeoutRevue:null, timeoutMusic:null, timeoutDvd:null, timeoutBooks:null, timeoutYouth:null, initialize: function(){ //Menu Revue $('#topMenuRevue').mouseover( function() { $('#topMenuSubMusic').hide(); $('#topMenuSubDvd').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubYouth').hide(); $("#topMenuSubRevue").fadeIn(150); clearTimeout(Naive.Box.Menu.Top.timeoutRevue); }); $('#topMenuRevue').mouseout( function() { Naive.Box.Menu.Top.timeoutRevue = setTimeout("$('#topMenuSubRevue').fadeOut(50)",6000); }); $('#topMenuSubRevue').mouseover( function() { clearTimeout(Naive.Box.Menu.Top.timeoutRevue); }); $('#topMenuSubRevue').mouseout( function() { Naive.Box.Menu.Top.timeoutRevue = setTimeout("$('#topMenuSubRevue').fadeOut(50)",6000); }); //Menu Music $('#topMenuMusic').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubDvd').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubYouth').hide(); $("#topMenuSubMusic").fadeIn(150); clearTimeout(Naive.Box.Menu.Top.timeoutMusic); }); $('#topMenuMusic').mouseout( function() { Naive.Box.Menu.Top.timeoutMusic = setTimeout("$('#topMenuSubMusic').fadeOut(50)",6000); }); $('#topMenuSubMusic').mouseover( function() { clearTimeout(Naive.Box.Menu.Top.timeoutMusic); }); $('#topMenuSubMusic').mouseout( function() { Naive.Box.Menu.Top.timeoutMusic = setTimeout("$('#topMenuSubMusic').fadeOut(50)",6000); }); //Menu DVD $('#topMenuDvd').mouseover( function() { $('#topMenuSubMusic').hide(); $('#topMenuSubRevue').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubYouth').hide(); $("#topMenuSubDvd").fadeIn(150); clearTimeout(Naive.Box.Menu.Top.timeoutDvd); }); $('#topMenuDvd').mouseout( function() { Naive.Box.Menu.Top.timeoutDvd = setTimeout("$('#topMenuSubDvd').fadeOut(50)",6000); }); $('#topMenuSubDvd').mouseover( function() { clearTimeout(Naive.Box.Menu.Top.timeoutDvd); }); $('#topMenuSubDvd').mouseout( function() { Naive.Box.Menu.Top.timeoutDvd = setTimeout("$('#topMenuSubDvd').fadeOut(50)",6000); }); //Menu Books $('#topMenuBooks').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubMusic').hide(); $('#topMenuSubDvd').hide(); $('#topMenuSubYouth').hide(); $("#topMenuSubBooks").fadeIn(150); clearTimeout(Naive.Box.Menu.Top.timeoutBooks); }); $('#topMenuBooks').mouseout( function() { Naive.Box.Menu.Top.timeoutBooks = setTimeout("$('#topMenuSubBooks').fadeOut(50)",6000); }); $('#topMenuSubBooks').mouseover( function() { clearTimeout(Naive.Box.Menu.Top.timeoutBooks); }); $('#topMenuSubBooks').mouseout( function() { Naive.Box.Menu.Top.timeoutBooks = setTimeout("$('#topMenuSubBooks').fadeOut(50)",6000); }); //Menu Youth $('#topMenuYouth').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubMusic').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubDvd').hide(); $("#topMenuSubYouth").fadeIn(150); clearTimeout(Naive.Box.Menu.Top.timeoutYouth); }); $('#topMenuYouth').mouseout( function() { Naive.Box.Menu.Top.timeoutYouth = setTimeout("$('#topMenuSubYouth').fadeOut(50)",6000); }); $('#topMenuSubYouth').mouseover( function() { clearTimeout(Naive.Box.Menu.Top.timeoutYouth); }); $('#topMenuSubYouth').mouseout( function() { Naive.Box.Menu.Top.timeoutYouth = setTimeout("$('#topMenuSubYouth').fadeOut(50)",6000); }); //Menu Calendar $('#topMenuCalendar').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubMusic').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubDvd').hide(); $("#topMenuSubYouth").hide(); }); //Menu Naive $('#topMenuNaive').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubMusic').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubDvd').hide(); $("#topMenuSubYouth").hide(); }); //Menu Alternaive $('#topMenuAlternaive').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubMusic').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubDvd').hide(); $("#topMenuSubYouth").hide(); }); //Menu My Account $('#topMenuAccount').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubMusic').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubDvd').hide(); $("#topMenuSubYouth").hide(); }); //Menu Store $('#topMenustore').mouseover( function() { $('#topMenuSubRevue').hide(); $('#topMenuSubMusic').hide(); $('#topMenuSubBooks').hide(); $('#topMenuSubDvd').hide(); $("#topMenuSubYouth").hide(); }); $('#toptopMenu').fadeIn(1000); } } Naive.Box.Explorer = { isLoaded:false, isDisplayed:false, show: function(strIdStartBubble, strIdStartRoute) { if(this.isLoaded === false || strIdStartBubble !== null || strIdStartRoute !== null) { var s1 = new SWFObject(Naive.Paths.BASEURL + "public/flash/explorer/explorer.swf","explorerContainerFlash","760","405","9"); s1.addVariable("strXmlUrl",Naive.Paths.BASEURL + "explorer/configxml/"); s1.addVariable("strFlashUrl",Naive.Paths.BASEURL + "public/flash/explorer/"); s1.addVariable("strLocale", Naive.Language); if(strIdStartBubble !== null ) { s1.addVariable("strIdStartBubble", strIdStartBubble); } if(strIdStartRoute !== null) { s1.addVariable("strIdStartRoute", strIdStartRoute); } s1.addParam("wmode","transparent"); s1.addParam("allowFullScreen", "true"); s1.addParam("scale","noscale"); s1.write("explorer"); this.isLoaded = true; } else { document.getElementById('explorerContainerFlash').processOn(); } $("#explorer").css({"visibility" : "visible"}); $('#contentContainer1, #contentContainer2, #contentContainer3').css({"display" : "none"}); $('#contentContainerExplorerText').html($('#contentContainerExplorerText').attr("relHide")); this.isDisplayed = true; sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); }, hide: function() { if($("#explorer").css("visibility") === "visible") { document.getElementById('explorerContainerFlash').processOff(); $("#explorer").css({"visibility" : "hidden"}); $('#contentContainer1, #contentContainer2, #contentContainer3').css({"display" : "block"}); $('#contentContainerExplorerText').html($('#contentContainerExplorerText').attr("relShow")); Naive.Ctl.Content.reloadCurrent(); } this.isDisplayed = false; sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); }, loadArtist: function(idArtist) { jsonReturn = $.get('/player/getseoname/artist/' + idArtist, {}, function(data){ //Login ok if(data.strError === 0) { strLink = '/artist/' + data.strSeoName; Naive.Ctl.Content.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); Naive.Ctl.Stats.trackPageview(strLink); Naive.Box.Menu.Container.updateArrows(); Naive.Box.Explorer.hide(); } }, "json"); }, loadFlipbook: function(idWork) { jsonReturn = $.get('/player/getseoname/work/' + idWork, {}, function(data){ //Login ok if(data.strError === 0) { strLink = '/flipbook/' + data.strSeoName; Naive.Ctl.Lightbox.show(strLink); Naive.Ctl.Stats.trackPageview(strLink); } }, "json"); }, loadOrder: function(idWork) { jsonReturn = $.get('/player/getseoname/work/' + idWork, {}, function(data){ //Login ok if(data.strError === 0) { strLink = '/order/' + data.strSeoName; Naive.Ctl.Lightbox.show(strLink); Naive.Ctl.Stats.trackPageview(strLink); } }, "json"); }, reinitialize:function() { if(this.isLoaded === true) { document.getElementById('explorerContainerFlash').jsReset(); } } } Naive.Box.Player = { height:0, width:0, sizePlayer:"minimized", isMinimized: function() { if(this.sizePlayer === "minimized") { return true; } else { return false; } }, resize: function(sizePlayer){ switch(sizePlayer) { case "minimized": $("#player").css({"height":"50px", "width":"235px", "z-index":"0"}); $("#playerContainer").css({"height":"50px", "width":"235px", "z-index":"0"}); this.sizePlayer = "minimized"; setTimeout(function(){Naive.Ctl.Content.resize("minimized")}, 300); break; case "maximized": $("#player").css({"height":"100%", "width":"100%", "z-index":"10000"}); $("#playerContainer").css({"height":"100%", "width":"100%", "z-index":"10000"}); this.sizePlayer = "maximized"; setTimeout(function(){Naive.Ctl.Content.resize("maximized")}, 300); break; case "default": $("#player").css({"height":"100%", "width":"235px", "z-index":"0"}); $("#playerContainer").css({"height":"100%", "width":"235px", "z-index":"0"}); this.sizePlayer = "default"; setTimeout(function(){Naive.Ctl.Content.resize("default")}, 300); break; default: throw { name: "Error in Naive.Box.Player.resize()", message: "Unknown argument" } } }, initialize: function() { }, playTrack: function(idTrack) { document.getElementById('playerContainerFlash').playTrack(idTrack); }, addTrack: function(idTrack) { document.getElementById('playerContainerFlash').addTrack(idTrack); }, addTracks: function(arrObjTracks) { document.getElementById('playerContainerFlash').addMultiTrack(arrObjTracks); }, playTracks: function(arrObjTracks) { document.getElementById('playerContainerFlash').playMultiTrack(arrObjTracks); }, playPlaylist: function(idPlaylist) { document.getElementById('playerContainerFlash').buildList(idPlaylist); }, sendToFriend: function(idPlaylist) { Naive.Ctl.Lightbox.show(Naive.Paths.BASEURL + 'friend/player/' + idPlaylist); }, addArrayTracks: function(arrTracks) { for(i=0;i < arrTracks.length; i++) { Naive.Box.Player.addTrack(arrTracks[i]); } }, playArrayTracks: function(arrTracks) { for(i=arrTracks.length - 1;i >=0 ; i--) { Naive.Box.Player.playTrack(arrTracks[i]); } }, openPlaylistManager: function() { document.getElementById('playerContainerFlash').openPlaylistManager(); } } Naive.Ctl.Content = { MIN_TOP: 20, // The content will not go above the top menu MIN_HEIGHT: 405, // Minimum height for content WIDTH: 760, // Width of the content timeoutResize: null, previousContainer: 3, currentContainer: 1, nextContainer: 2, actionInProgress: false, /* INITIALIZE : Perform initialization of the content (ajax links activation for example)*/ initialize: function() { $("a[rel=transition]").unbind('click'); $("a[rel=transition]").click(function(){ strLink = $(this).attr("href"); // BUG IE : Remove the domain in the href link which is automatically added by IE on AJAX Content if(strLink.indexOf("http://") != -1) { nbCharToRemove = strLink.indexOf("/", 7); strLink = strLink.substring(nbCharToRemove); } Naive.Ctl.Content.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); Naive.Ctl.Stats.trackPageview(strLink); Naive.Box.Menu.Container.updateArrows(); }); $("a[rel=lightbox]").unbind('click'); $("a[rel=lightbox]").click(function(){ strLink = $(this).attr("href"); Naive.Ctl.Lightbox.show(strLink); Naive.Ctl.Stats.trackPageview(strLink); }); }, /* RESIZE : Use this when resizing the window booPlayerMinimized : indicate if the Player is minimized (true) or not (false) Note : The timer is here to avoid firing the script many times when using with IE6 */ resize: function(sizePlayer){ // Get the window height and calculate the top pixel of the content div windowHeight = $(window).height(); contentHeightMin = Naive.Ctl.Content.MIN_HEIGHT; contentHeight = $("#contentContainer" + Naive.Ctl.Content.currentContainer + " .sizeContent").innerHeight(); contentHeight = contentHeight === 0?contentHeightMin:contentHeight; //Pour faciliter le debug topMin = Naive.Ctl.Content.MIN_TOP; contentBodyHeight = windowHeight - 30 - 108 - 50; //available space for the content if(contentBodyHeight < contentHeight) { contentBodyHeight = contentBodyHeight > contentHeightMin?contentBodyHeight:contentHeightMin; } else { contentBodyHeight = contentHeight; } contentTop = ((windowHeight - contentBodyHeight - 175) / 2 ) + Naive.Ctl.Content.MIN_TOP; contentTop = (contentTop >= Naive.Ctl.Content.MIN_TOP)?contentTop:Naive.Ctl.Content.MIN_TOP; contentTop = contentTop + 12; windowWidth = $(window).width(); playerWidth = (sizePlayer === "minimized") ? 0 : 211; contentLeft = ((windowWidth - playerWidth - Naive.Ctl.Content.WIDTH) / 2 ); contentLeft = (contentLeft < 1) ? 1 : contentLeft; $("#contentContainer" + this.currentContainer).css({"height": contentBodyHeight}); $("#contentContainer" + this.currentContainer + " .jScrollPaneContainer").css({"height": contentBodyHeight}); $("#contentContainer" + this.currentContainer + " .jScrollPaneContainer").jScrollPane({showArrows:true, scrollbarWidth: 16}); $("#contentContainer").animate({"top": contentTop, "left": contentLeft}); $("#explorer").animate({"top": contentTop + 103, "left": contentLeft}) $("#loadingContent").css({"top": contentTop + 200, "left": contentLeft + 230}); $("#toptopMenu").css({"width": windowWidth + "px"}); $("#player").css({"height": windowHeight + "px"}); }, /* LOADCURRENT : Load the strUrl page in the central content container, slide the previous page on the left and clear the next slide strUrl : Url of the page to AJAX load*/ loadCurrent: function(strUrl) { Naive.Box.Explorer.hide(); this.actionInProgress = true; this.previousContainer = this.currentContainer; this.currentContainer = ((this.currentContainer + 1) % 3) + 1; this.nextContainer = ((this.currentContainer + 1) % 3) + 1; $("#loading").css({display:"block"}); $("#contentContainer" + this.nextContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.previousContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.currentContainer + " select").css({"visibility": "visible"}); $("#contentContainer" + this.currentContainer).css({ left: "0px", opacity: 0}); $("#contentContainer" + this.nextContainer).html('').css({ left: "762px", opacity: 0.2}); $("#contentContainer" + this.previousContainer).animate({ left: "-762px", opacity: 0.2}, null, function(){ $("#contentContainer" + Naive.Ctl.Content.currentContainer).load(strUrl, null, function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.currentContainer).css({ opacity: 1.0}); $("#loading").css({display:"none"}); }); }); setTimeout("Naive.Ctl.Content.actionInProgress = false;",500); }, /* LOADHOME : Load the homepage and clean the history*/ loadHome: function() { this.actionInProgress = true; Naive.Ctl.NavHistory.clearNav(); strUrl = Naive.Paths.BASEURL; $("#contentContainer" + Naive.Ctl.Content.currentContainer).load(strUrl, null, function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.currentContainer).css({ opacity: 1.0}); }); setTimeout("Naive.Ctl.Content.actionInProgress = false;",500); }, /* RELOAD : Load the strUrl in the current container, without sliding pages*/ reloadCurrent: function() { this.actionInProgress = true; $("#loading").css({display:"block"}); objNav = Naive.Ctl.NavHistory.getNav(); strUrl = objNav.strCurrentUrl; $("#contentContainer" + Naive.Ctl.Content.currentContainer).load(strUrl, null, function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.currentContainer).css({ opacity: 1.0}); $("#loading").css({display:"none"}); }); setTimeout("Naive.Ctl.Content.actionInProgress = false;",500); }, /* LOADPREVIOUS : Load the strUrl in the previous container, and slide the other pages on the right strUrl : Url of the page to AJAX load*/ loadPrevious: function(strUrl) { Naive.Box.Explorer.hide(); this.actionInProgress = true; this.nextContainer = this.currentContainer; this.currentContainer = ((this.currentContainer) % 3) + 1; this.previousContainer = ((this.currentContainer) % 3) + 1; $("#loading").css({display:"block"}); $("#contentContainer" + this.nextContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.previousContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.currentContainer + " select").css({"visibility": "visible"}); $("#contentContainer" + this.previousContainer).html(''); $("#contentContainer" + this.currentContainer).animate({ left: "0px", opacity: 1.0}); $("#contentContainer" + this.previousContainer).css({ left: "-762px"}).html(''); $("#contentContainer" + this.nextContainer).animate({ left: "762px", opacity: 0.2 }, null, function(){ sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.previousContainer).load(strUrl, null, function() { $("#contentContainer" + Naive.Ctl.Content.previousContainer).css({ opacity: 0.2}); }); $("#loading").css({display:"none"}); }); setTimeout("Naive.Ctl.Content.actionInProgress = false;",500); }, /* LOADPREVIOUS : Load the strUrl in the next container, and slide the other pages on the left strUrl : Url of the page to AJAX load*/ loadNext: function(strUrl) { Naive.Box.Explorer.hide(); this.actionInProgress = true; this.previousContainer = this.currentContainer; this.currentContainer = ((this.currentContainer + 1) % 3) + 1; this.nextContainer = ((this.currentContainer + 1) % 3) + 1; $("#loading").css({display:"block"}); $("#contentContainer" + this.nextContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.previousContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.currentContainer + " select").css({"visibility": "visible"}); $("#contentContainer" + this.currentContainer).animate({ left: "0px", opacity: 1.0}); $("#contentContainer" + this.nextContainer).html('').css({ left: "762px", opacity: 0}); $("#contentContainer" + this.previousContainer).animate({ left: "-762px", opacity: 0.2 }, null, function(){ sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.nextContainer).load(strUrl, null, function() { $("#contentContainer" + Naive.Ctl.Content.nextContainer).css({ opacity: 0.2}); }); $("#loading").css({display:"none"}); }); setTimeout("Naive.Ctl.Content.actionInProgress = false;",500); }, /* LOADFIRST : Reload the first two pages of the flow objNav = { currentPosition : Integer which indicate how many pages have been loaded. The first page is 0, the second 1, etc. strUrlCurrent : Url of the current page to AJAX load strUrlNext : Url of the next page to AJAX load } Note : the currentPosition help to determine if pages must be reloaded or just slided.*/ loadFirst: function(objNav) { Naive.Box.Explorer.hide(); this.actionInProgress = true; $("#loading").css({display:"block"}); if(objNav.currentDistance === 1) { this.loadPrevious(); } else if(objNav.currentDistance === 2) { this.nextContainer = this.previousContainer; this.previousContainer = ((this.nextContainer + 1) % 3) + 1; this.currentContainer = ((this.previousContainer + 1) % 3) + 1; $("#contentContainer" + this.previousContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.currentContainer + " select").css({"visibility": "visible"}); $("#contentContainer" + this.nextContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.previousContainer).html(''); $("#contentContainer" + this.nextContainer).css({ opacity:0, left: "770px" }).animate({ opacity:0.2}); $("#contentContainer" + this.previousContainer).css({ opacity:0.2, left: "-770px" }); $("#contentContainer" + this.currentContainer).css({ left: 0 }); $("#contentContainer" + this.currentContainer).load(objNav.strCurrentUrl, null, function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.currentContainer).animate({ opacity: 1}, function(){ $("#loading").css({display:"none"}); }); }); } else if(objNav.currentDistance > 2) { $("#contentContainer" + this.previousContainer).html(''); $("#contentContainer" + this.currentContainer).css({ opacity:0}).html(''); $("#contentContainer" + this.nextContainer).css({ opacity:0}).html(''); $("#contentContainer" + this.currentContainer).load(objNav.strCurrentUrl, null, function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.currentContainer).animate({ opacity: 1}, function(){ $("#loading").css({display:"none"}); }); }); $("#contentContainer" + this.nextContainer).load(objNav.strNextUrl, null, function() { $("#contentContainer" + Naive.Ctl.Content.nextContainer).animate({ opacity: 0.2}); }); } setTimeout("Naive.Ctl.Content.actionInProgress = false;",500); }, /* LOADLAST : Reload the first two pages of the flow objNav = { currentPosition : Integer which indicate how many pages have been loaded. The first page is 0, the second 1, etc. strUrlCurrent : Url of the current page to AJAX load strUrlNext : Url of the next page to AJAX load } Note : the currentPosition help to determine if pages must be reloaded or just slided.*/ loadLast: function(objNav) { Naive.Box.Explorer.hide(); this.actionInProgress = true; $("#loading").css({display:"block"}); if(objNav.currentDistance === 1) { this.loadNext(); } else if(objNav.currentDistance === 2) { this.previousContainer = this.nextContainer; this.currentContainer = ((this.previousContainer + 1) % 3) + 1; this.nextContainer = ((this.currentContainer + 1) % 3) + 1; $("#contentContainer" + this.previousContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.currentContainer + " select").css({"visibility": "visible"}); $("#contentContainer" + this.nextContainer + " select").css({"visibility": "hidden"}); $("#contentContainer" + this.nextContainer).html(''); $("#contentContainer" + this.previousContainer).css({ opacity:0, left: "-770px" }).animate({ opacity:0.2}); $("#contentContainer" + this.nextContainer).css({ opacity:0.2, left: "770px" }); $("#contentContainer" + this.currentContainer).css({ left: 0 }); $("#contentContainer" + this.currentContainer).load(objNav.strCurrentUrl, null, function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.currentContainer).animate({ opacity: 1}, function(){ $("#loading").css({display:"none"}); }); }); } else if(objNav.currentDistance > 2) { $("#contentContainer" + this.nextContainer).html(''); $("#contentContainer" + this.currentContainer).css({ opacity:0}).html(''); $("#contentContainer" + this.previousContainer).css({ opacity:0}).html(''); $("#contentContainer" + this.currentContainer).load(objNav.strCurrentUrl, null, function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#contentContainer" + Naive.Ctl.Content.currentContainer).animate({ opacity: 1}, function(){ $("#loading").css({display:"none"}); }); }); $("#contentContainer" + this.previousContainer).load(objNav.strPreviousUrl, null, function() { $("#contentContainer" + Naive.Ctl.Content.previousContainer).animate({ opacity: 0.2}); }); } setTimeout("Naive.Ctl.Content.actionInProgress = false;",500); }, /* LOADPAGE : LOAD A SPECIFIC PAGE, BY GIVING THE TYPE OF PAGE AND ALL THE PARAMETERS*/ loadPage: function(strPageType, strSeoName) { switch(strPageType) { case 'work': strLink = Naive.Paths.BASEURL + 'work/' + strSeoName; this.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); Naive.Ctl.Stats.trackPageview(strLink); Naive.Box.Menu.Container.updateArrows(); break; case 'artist': strLink = Naive.Paths.BASEURL + 'artist/' + strSeoName; this.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); Naive.Ctl.Stats.trackPageview(strLink); Naive.Box.Menu.Container.updateArrows(); break; case 'profile': strLink = Naive.Paths.BASEURL + 'profile/' + strSeoName; this.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); Naive.Ctl.Stats.trackPageview(strLink); Naive.Box.Menu.Container.updateArrows(); break; } } } //This is the main file that initialize the environment. $(document).ready(function(){ Naive.Box.Menu.Top.initialize(); Naive.Box.Menu.Container.initialize(); Naive.Box.Menu.Bottom.initialize(); Naive.Box.Player.initialize(); sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); $("#content").fadeIn(); $("#loading").fadeOut(); $(window).resize(function() { sizePlayer = Naive.Box.Player.sizePlayer; Naive.Ctl.Content.resize(sizePlayer); if(Naive.Ctl.Lightbox.displayed === true) { Naive.Ctl.Lightbox.resize(); } }); Naive.Ctl.Content.initialize(); }); Naive.Ctl.Lightbox = { timeoutResize: null, displayed: false, /* INITIALIZE : Perform initialization of the content (ajax links activation for example)*/ initialize: function() { $("a[rel=transition]").unbind('click'); $("a[rel=transition]").click(function(){ strLink = $(this).attr("href"); // BUG IE : Remove the domain in the href link which is automatically added by IE on AJAX Content if(strLink.indexOf("http://") != -1) { nbCharToRemove = strLink.indexOf("/", 7); strLink = strLink.substring(nbCharToRemove); } Naive.Ctl.Content.loadCurrent(strLink); Naive.Ctl.NavHistory.addEntry(strLink); SWFAddress.setValue(strLink); }); $("a[rel=lightbox]").unbind('click'); $("a[rel=lightbox]").click(function(){ Naive.Ctl.Lightbox.show($(this).attr("href")); }); }, show: function(strUrl) { if(this.displayed === false ) { this.displayed = true; $("#lightboxCloseButton").click(function(){ Naive.Ctl.Lightbox.hide(); }); $("#lightboxContent").load(strUrl, null, function() { Naive.Ctl.Lightbox.resize(); $("#lightbox").fadeIn("slow"); }); $("#contentContainer" + Naive.Ctl.Content.currentContainer + " select").css({"visibility": "hidden"}); } else { $("#lightboxContent").hide(); $("#lightboxContent").load(strUrl, null, function() { Naive.Ctl.Lightbox.resize(); $("#lightboxContent").fadeIn("slow"); }); } }, hide: function() { if(this.displayed === true ) { this.displayed = false; $("#lightbox").fadeOut("fast"); $("#lightboxContent").html(''); } $("#contentContainer" + Naive.Ctl.Content.currentContainer + " select").css({"visibility": "visible"}); }, strUrlAfterLogin: "", showLogin: function(strUrl){ if(strUrl) this.strUrlAfterLogin = strUrl.length > 0 ? strUrl : ""; this.show('auth/login'); }, resize: function() { if(this.displayed === true) { clearTimeout(this.timeoutResize); this.timeoutResize = setTimeout(function(){ //Content Top adjustment heightContent = $("#lightboxContent > div:first-child").height(); heightWindow = $(window).height(); topContent = (heightWindow - heightContent) / 2; //Content Left adjustment widthContent = $("#lightboxContent > div:first-child").width(); widthWindow = $(window).width(); leftContent = (widthWindow - widthContent) / 2; $("#lightboxContent").css({"left": leftContent, "top": topContent}); //Close Button Adjustment leftContentButton = leftContent + widthContent + 10; topContentButton = topContent - 5; $("#lightboxCloseButton").css({"left": leftContentButton, "top": topContentButton}); }); } } } Naive.Ctl.NavHistory = { arrPages: [], arrUrls: [], currentPage:0, currentId: 0, addEntry: function(strUrl) { //Add the url just after the current id this.currentId = this.currentId + 1; this.arrUrls[this.currentId] = strUrl; //Update the page number this.arrPages[this.currentPage] = { arrUrls: this.arrUrls, currentId: this.currentId } this.currentPage += 1; if((this.arrUrls.length - 1) > this.currentId) { nbIdToDelete = this.arrUrls.length - this.currentId - 1; this.arrUrls.splice(this.currentId + 1, nbIdToDelete); } }, updateEntry: function(strUrl) { //Add the url just after the current id this.arrUrls[this.currentId] = strUrl; }, getCurrentEntry: function() { return this.arrUrls[this.currentId]; }, getNav: function() { strCurrentUrl = this.arrUrls[this.currentId]; if(this.currentId > 0) { strPreviousUrl = this.arrUrls[this.currentId - 1]; } else { strPreviousUrl = null; } if(this.currentId < (this.arrUrls.length - 1)) { strNextUrl = this.arrUrls[this.currentId + 1]; } else { strNextUrl = null; } objNav = { strPreviousUrl: strPreviousUrl, strCurrentUrl: strCurrentUrl, strNextUrl: strNextUrl } return objNav; }, backNav: function() { //If we are not already on the first page, if(this.currentId > 0) { //get the previous url this.currentId = this.currentId - 1; strCurrentUrl = this.arrUrls[this.currentId]; strPreviousUrl = this.arrUrls[this.currentId - 1]; } else { strCurrentUrl = this.arrUrls[this.currentId]; strPreviousUrl = null; } //Update the page number this.arrPages[this.currentPage] = { arrUrls: this.arrUrls, currentId: this.currentId } this.currentPage += 1; objNav = { strPreviousUrl: strPreviousUrl, strCurrentUrl: strCurrentUrl } return objNav; }, nextNav: function() { if(this.currentId < (this.arrUrls.length - 1)) { this.currentId = this.currentId + 1; strNextUrl = this.arrUrls[this.currentId + 1]; strCurrentUrl = this.arrUrls[this.currentId]; } else { strCurrentUrl = this.arrUrls[this.currentId]; strNextUrl = null; } //Update the page number this.arrPages[this.currentPage] = { arrUrls: this.arrUrls, currentId: this.currentId } this.currentPage += 1; objNav = { strCurrentUrl: strCurrentUrl, strNextUrl: strNextUrl } return objNav; }, firstNav: function() { currentDistance = this.currentId; strCurrentUrl = this.arrUrls[0]; if(this.arrUrls.length > 1) { strNextUrl = this.arrUrls[1]; } else { strNextUrl = null; } this.currentId = 0; //Update the page number this.arrPages[this.currentPage] = { arrUrls: this.arrUrls, currentId: this.currentId } this.currentPage += 1; objNav = { currentDistance : currentDistance, strCurrentUrl: strCurrentUrl, strNextUrl : strNextUrl } return objNav; }, lastNav: function() { lastPosition = this.arrUrls.length - 1; currentDistance = lastPosition - this.currentId; strCurrentUrl = this.arrUrls[lastPosition]; if(this.arrUrls.length > 1) { strPreviousUrl = this.arrUrls[lastPosition - 1]; } else { strPreviousUrl = null; } this.currentId = lastPosition; //Update the page number this.arrPages[this.currentPage] = { arrUrls: this.arrUrls, currentId: this.currentId } this.currentPage += 1; objNav = { currentDistance : currentDistance, strCurrentUrl: strCurrentUrl, strPreviousUrl : strPreviousUrl } return objNav; }, updateBrowser: function(idPage) { //Update the page number this.arrUrls = this.arrPages[idPage].arrUrls; this.currentId = this.arrPages[idPage].currentId; this.currentPage = idPage; }, clearNav: function() { this.currentId = 0; this.arrUrls = []; } } Naive.Ctl.Stats = { trackPageview: function(strLink) { GoogleAnalytics1 = _gat._getTracker("UA-2868372-20"); GoogleAnalytics1._trackPageview(strLink); GoogleAnalytics2 = _gat._getTracker("UA-4542315-6"); GoogleAnalytics2._trackPageview(strLink); } }