
function show_photograph() {
	$('.caption').show();
	$('.caption').animate({height: 20},500);
			
		
}

function hide_photograph() {
	
	$('.caption').animate({height: 1},500,function(){$('.caption').hide();});
			
		
}



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}, 2000, function() {
            $active.removeClass('active last-active');
        });
}

function toppbilde() {
	$('#toppbilde').css('opacity',0.1);
	$('#toppbilde').fadeTo('Slow',1.0);
}

function swap(arg, arg2) {
	$('.caption').hide();
	$('#stort').fadeTo('fast',0.1);
	$('#stort').attr('src','http://kundeweb.aggressive.no/users/historiskehadeland.no/Aktorer/stor/'+arg);
	$('#stort').fadeTo('Slow',1.0);
	//$('#image-paging > ul > li > a').removeClass('pass').addClass('act');
	if(arg2 !== "") {$('.caption').html('Fotograf: ' + arg2);}
}



function boks() {
	$('div#forsidebokser > div.boks').mouseover(function() {
		$(this).css('background','#879c06');
		//$(this > ".inner").css('background','#ff0000');
		$(this).css('cursor','pointer');
	});
	
	$('div#forsidebokser > div.boks').mouseout(function() {
		$(this).css('background','#fff');
	});
}

function aktorer(){
	$("#left div.frontartikler div.frontartikkel img").mouseover(function(){
		$(this).fadeTo('fast',0.6);
	});
	$("#left div.frontartikler div.frontartikkel img").mouseout(function(){
		$(this).fadeTo('fast',1.0);
	});
}

function ajax(arg){
  		$.ajax({
			url: 'ajax.asp?mnd=' + arg,
			success: function(data) {
				$('#aktivitetskalender').html(data);		
			}
		});
	}
	
function ajax2(arg){
  		$.ajax({
			url: 'ajax_nyhet.asp?m=54131&n=' + arg ,
			success: function(data) {
				$('#nyhet').html(data);		
			}
		});
	}
	

	
	
	

$(document).ready(function() {
	boks();
	if($('#slideshow')){ setInterval( "slideSwitch()", 3500 );}
	aktorer();
	 if($('#toppbilde')) { toppbilde() };
	 
});


