<!-- Vallatips -->
$(document).ready(function(){
	$(".slidingDiv").hide();
	$(".show").show();
		$('.show').click(function(){
		$(".slidingDiv").slideToggle();
		$(".show").hide();
		$(".hide").show();
		});
});
$(document).ready(function(){
	$(".slidingDiv").hide();
	$(".hide").hide();
		$('.hide').click(function(){
		$(".slidingDiv").slideToggle();
		$(".hide").hide();
		$(".show").show();
		});
});

<!-- Bildspel-bilder -->

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}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

<!-- Bildspel-länkar -->

function linkSwitch() {
    var $active = $('#linkshow .active');

    if ( $active.length == 0 ) $active = $('#linkshow .link:last');

    var $next =  $active.next().length ? $active.next()
        : $('#linkshow .link:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "linkSwitch()", 5000 );
});

var totalSlides = 0;
var currentSlide = 1;
var contentSlides = "";

$(document).ready(function(){
  $("#slideshow-previous").click(showPreviousSlide);
  $("#slideshow-next").click(showNextSlide);
 
  var totalWidth = 0;
  contentSlides = $(".slideshow-content");
  contentSlides.each(function(i){
    totalWidth += this.clientWidth;
    totalSlides++;
  });
  $("#slideshow-holder").width(totalWidth);
  $("#slideshow-scroller").attr({scrollLeft: 0});
  updateButtons();
});

function showPreviousSlide()
{
  currentSlide--;
  updateContentHolder();
  updateButtons();
}

function showNextSlide()
{
  currentSlide++;
  updateContentHolder();
  updateButtons();
}

function updateContentHolder()
{
  var scrollAmount = 0;
  contentSlides.each(function(i){
    if(currentSlide - 1 > i) {
      scrollAmount += this.clientWidth;
    }
  });
  $("#slideshow-scroller").animate({scrollLeft: scrollAmount}, 1000);
}

function updateButtons()
{
  if(currentSlide < totalSlides) {
    $("#slideshow-next").show();
  } else {
    $("#slideshow-next").hide();
  }
  if(currentSlide > 1) {
    $("#slideshow-previous").show();
  } else {
    $("#slideshow-previous").hide();
  }
}

function hideSuper()
{
	$('#sponsorinfo-1, #sponsorinfo-2, #sponsorinfo-3').css('backgroundPosition', 'top');
}
function showSuper()
{
    $('#sponsorinfo-1, #sponsorinfo-2, #sponsorinfo-3').css('backgroundPosition', 'bottom');
}

function validateForm()
{
var x = document.forms["sender"]["mail"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos < 1 || dotpos < atpos+2 || dotpos+2 >= x.length)
  {
  alert("Du har angett en felaktig e-postadress");
  return false;
  }
}

function validateForm2()
{
var x = document.forms["sender"]["email"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos < 1 || dotpos < atpos+2 || dotpos+2 >= x.length)
  {
  alert("Du har angett en felaktig e-postadress");
  return false;
  }
}
