
function insertMedia()
{
for( var k = 0, l = arguments.length; k < l; k++ )
{
document.write( arguments[k] );
}
}
jQuery(function($){
var $this;
if (document.getElementById('slider')) {
var $slideshow = $('#slider'),
$slides    = $('> div', $slideshow),
_slides    = $slides.length - 1;
if (_slides > 0) {
var $banners = $('> a', $slides),
$nav     = $('ul a', $slideshow),
index    = 0,
timer;
$slides.not(':first').hide();
$slideshow.height($slideshow.height());
$nav.filter(':first').addClass('active');
function setIndex(index) {
clearTimeout(timer);
$slides.hide()
.filter($slides[index]).fadeIn(450);
$nav.removeAttr('class')
.filter($nav[index]).addClass('active');
timer = setTimeout(upIndex, 5450, 'JavaScript');
}
function upIndex() {
index = $nav.index($nav.filter('.active')) + 1;
if (index > _slides) {
index = 0;
}
setIndex(index);
}
timer = setTimeout(upIndex, 5450, 'JavaScript');
$banners.filter('[href="/"]').bind('click', function(event){
event.preventDefault();
}).css('cursor', 'default');
$nav.bind('click', function(event){
event.preventDefault();
if ($slides.is(':animated')) return false;
setIndex($nav.index(this));
});
} else {
$slideshow.find('ul').hide();
}
}
if (document.getElementById('members')) {
var $table = $('#members'),
$heads = $('tr.member-header', $table),
$tails = $('tr.member-content', $table).hide();
$heads.bind('click', function() {
$this = $(this);
if ($this.is('.active')) {
$this.removeClass('active').next().hide();
return;
}
$tails.hide();
$heads.removeClass('active');
$this.addClass('active').next().show();
}).find('a').bind('click', function(event) {
event.stopPropagation();
});
}
function focusBlur(selector, text) {
$(selector).focus(function(){
if ($(this).val() === text) {
$(this).val('');
}
}).blur(function(){
if ($(this).val() === '') {
$(this).val(text);
}
});
}
focusBlur('input[name="SearchText"]', 'Søk på sidene');
focusBlur('#sidemenu input[name="EMAIL"]', 'Din e-postadresse');
});

