var TRANS_TIME = 500; var flashvars = {}; var params = { wmode: "transparent" }; var attributes; var swf; var pathArray = window.location.pathname.split("/"); var section = pathArray[1]; var startIndex = 2; var movieName = ""; switch (section) { case "caught-on-roof" : swf = "CaughtOnRoof.swf"; attributes = {name: "CaughtOnRoof"}; var startAlbum = "album-"; startIndex = 0; flashvars = {startAlbumID: startAlbum } movieName = "CaughtOnRoof"; break; case "rooflive" : swf = "RoofLive.swf"; attributes = {name: "RoofLive"}; var startAlbum = "album-"; startIndex = 0; flashvars = {startAlbumID: startAlbum } movieName = "RoofLive"; break; case "photo-gallery" : swf = "Gallery.swf"; attributes = {name: "Gallery"}; var startAlbum = "album-"; startIndex = 0; flashvars = {startAlbumID: startAlbum } movieName = "Gallery"; break; case "" : swf = "Main.swf"; attributes = {name: "Main"}; flashvars = { base_path:pathArray[0],start:startIndex,day:false } movieName = "Main"; break; } swfobject.embedSWF(swf, "flash", "988", "480", "9.0.0", "js/expressInstall.swf", flashvars, params, attributes); $(function() { switch (section) { case "caught-on-roof" : case "rooflive" : case "photo-gallery" : changeSlide(startIndex + 1); break; default : changeSlide(startIndex); break; } }); function isReady() { return jsReady; } function pageInit() { jsReady = true; } function thisMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } else { return document[movieName]; } } //send to home flash function sendToActionScript(value) { thisMovie(movieName).sendToActionScript(value); } //send to gallery flash function sspLoadAlbum(value, index) { thisMovie(movieName).sspLoadAlbum(value, index); } //received from flash...rotates content below function sendToJavaScript(value) { var newValue = parseInt(value) + 1; changeSlide(newValue); } function changeSlide(index) { $('.rotator').show(); switch (section) { case "caught-on-roof" : $(".album-links option").each(function() { $(this).removeClass("active"); }); $(".album-links option:nth-child(" + index + ")").addClass("active"); $(".rotator").children().each(function() { $(this).removeClass("active"); //$(this).animate({opacity:0.0}, TRANS_TIME).addClass("just-chillin"); $(this).fadeOut(TRANS_TIME).addClass("just-chillin"); }); $(".rotator div:nth-child(" + index + ")").removeClass("just-chillin"); //$(".rotator div:nth-child(" + index + ")").animate({opacity: 1.0}, TRANS_TIME).addClass("active"); $(".rotator div:nth-child(" + index + ")").fadeIn(TRANS_TIME).addClass("active"); break; default : $(".links li").each(function() { $(this).removeClass("active"); }); $(".links li:nth-child(" + index + ")").addClass("active"); $(".rotator").children().each(function() { $(this).removeClass("active"); //$(this).animate({opacity:0.0}, TRANS_TIME).addClass("just-chillin"); $(this).fadeOut(TRANS_TIME).addClass("just-chillin"); }); $(".rotator div:nth-child(" + index + ")").removeClass("just-chillin"); //$(".rotator div:nth-child(" + index + ")").animate({opacity: 1.0}, TRANS_TIME).addClass("active"); $(".rotator div:nth-child(" + index + ")").fadeIn(TRANS_TIME).addClass("active"); break; } }