// JavaScript Document function slideSwitch() { var $active = $('#slideshow IMG.active'); if ( $active.length == 0 ) $active = $('#slideshow IMG:last'); var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first'); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 6000, function() { $active.removeClass('active last-active'); } ); } $(document).ready(function() { $('#slideshow IMG').css({opacity: 0.0}); $('#slideshow IMG:first').css({opacity: 1.0}); setInterval("slideSwitch()", 9000 ); $(".fancy").fancybox({ 'frameHeight': 392, 'frameWidth': 480, 'hideOnContentClick': true, 'zoomSpeedIn': 0, 'zoomSpeedOut': 0, 'overlayShow': false }); $.ajax({ url: '/ajax/facebook.asp', cache: false, dataType: "html", async: false, success: function(data) { $("#facebookContent").html(data); }, error: function() { $("#facebookContent").html(""); } }); $(document).ready(function() { $("a.flickrbilder").fancybox(); }); $(".fancy_small").fancybox({ 'frameHeight': 480, 'frameWidth': 640, 'hideOnContentClick': false, 'zoomSpeedIn': 0, 'zoomSpeedOut': 0, 'overlayShow': false }); $("div#FilmFieldContent a").fancybox({ 'frameHeight': 392, 'frameWidth': 480, 'hideOnContentClick': true, 'zoomSpeedIn': 0, 'zoomSpeedOut': 0, 'overlayShow': false }); $(".tvfunas").fancybox({ 'frameHeight': 650, 'frameWidth': 900, 'hideOnContentClick': true, 'zoomSpeedIn': 0, 'zoomSpeedOut': 0, 'overlayShow': false }); //Högerpuffar $(document).ready(function() { //activePuff1(); //activePuff2(); }); function activePuff1() { $(".activePuff").hide(); } function activePuff2() { $(".inactivePuffTop").hide(); } function puffActivate(e) { //alert($(e).css("height")); if($(e).css("height") != "128px") { puffDeactivate(document.getElementById("puff_left_newsletter")); $(e).children(".inactivePuff").hide(); $(e).children(".activePuff").show(); $(e).removeClass("puffinactive"); $(e).addClass("puffactive"); /* $(e).css("height","128px"); $(e).css("background-image","url(/bilder/design/puff_bg_selected.png)"); */ puffDeactivateTop(document.getElementById("puff_left_blog")); } } function puffDeactivate(e) { $(e).children(".inactivePuff").show(); $(e).children(".activePuff").hide(); $(e).removeClass('puffactive'); $(e).addClass('puffinactive'); /* $(e).css("height","87px"); $(e).css("background-image","url(/bilder/design/puff_bg_inactive.png)"); */ } function puffActivateTop(e) { $(e).children(".inactivePuffTop").hide(); $(e).children(".activePuffTop").show(); $(e).removeClass('puffinactivetop'); $(e).addClass('puffactivetop'); /* $(e).css("height","127px"); $(e).css("margin-top","1px"); $(e).css("background-image","url(/bilder/design/puff_bg_active.png)"); */ } function puffDeactivateTop(e) { $(e).children(".inactivePuffTop").show(); $(e).children(".activePuffTop").hide(); $(e).removeClass('puffactivetop'); $(e).addClass('puffinactivetop'); /* $(e).css("height","87px"); $(e).css("margin-top","0"); $(e).css("background-image","url(/bilder/design/puff_bg_deselected.png)"); */ } //Öppnar och stänger puffarna till höger om textfältet $("#puff_left_blog").mouseover(function () { puffActivateTop(this); }); $("#puff_left_blog").mouseout(function () { puffDeactivateTop(this); }); $("#puff_left_skipass").mouseover(function () { puffActivate(this); }); $("#puff_left_skipass").mouseout(function () { puffDeactivate(this); }); $("#puff_left_weather").mouseover(function () { puffActivate(this); }); $("#puff_left_weather").mouseout(function () { puffDeactivate(this); }); $("#puff_left_vision").mouseover(function () { puffActivate(this); }); $("#puff_left_vision").mouseout(function () { puffDeactivate(this); }); $("#puff_left_webcam").mouseover(function () { puffActivate(this); }); $("#puff_left_webcam").mouseout(function () { puffDeactivate(this); }); $("#puff_left_newsletter").mouseover(function () { puffActivate(this); }); $("#puff_left_newsletter").mouseout(function () { puffDeactivate(this); }); //Byt till den bild användaren klickat på (webcam-galleriet) $(".camPic").click(function() { $("#camImage").attr('src',$(this).attr('src')); $(".camBox").css("background-image","url()"); $(this).parent(".camBox").css("background-image","url(/bilder/design/webcambg.gif)"); $(".activeText").css("display", "none"); $(".inactiveText").css("display", "block"); $(this).parent(".camBox").children(".inactiveText").css("display", "none"); $(this).parent(".camBox").children(".activeText").css("display", "block"); if ($(this).attr('id') != undefined) { var archive_path = $(this).attr('id'); $('#arkivbilder').html($('#arkivbilder_' + archive_path).html()); $(".camHourLink").removeClass("active"); $("#now_" + archive_path).addClass("active"); $('#arkivbilder').show(); } else { $('#arkivbilder').hide(); } }); $(".vidBox").mouseover(function() { $(this).css("background-image", "url(/bilder/design/vidBg.gif)"); $(this).children(".vidRubActive").css("display", "block"); $(this).children(".vidRubInactive").css("display", "none"); }); $(".vidBox").mouseout(function() { $(this).css("background-image", "url()"); $(this).children(".vidRubActive").css("display", "none"); $(this).children(".vidRubInactive").css("display", "block"); }); //$.ajax({ // url: "/includes/gettemp.asp", // cache: false, // success: function(html){ // $(".tempinfo").html(html); // } //}); }); function showWebCam(e, url) { $("#camImage").attr('src', url); $(".camHourLink").removeClass("active"); $(e).addClass("active"); return false; }