﻿var bid = 0;
var bid_keeper = true;
var inti;
var bannerialt = 2;

function hovermenu(menuid) {
	document.getElementById('ls'+menuid).className='ls';
	document.getElementById('rs'+menuid).className='rs';
	document.getElementById('ms'+menuid).className='active2';
}

function hovermenuout(menuid) {
	document.getElementById('ls'+menuid).className='ls2';
	document.getElementById('rs'+menuid).className='rs2';
	document.getElementById('ms'+menuid).className='';
}
/*
function getPageSize(){
	
				var xScroll, yScroll;
	
					if (window.innerHeight && window.scrollMaxY) {	
						xScroll = document.body.scrollWidth;
						yScroll = window.innerHeight + window.scrollMaxY;
					} else if (document.body.scrollHeight > document.body.offsetHeight){ // alle undtagen Explorer Mac
						xScroll = document.body.scrollWidth;
						yScroll = document.body.scrollHeight;
					} else { // Explorer Mac...virker også i Explorer 6, Mozilla og Safari
						xScroll = document.body.offsetWidth;
						yScroll = document.body.offsetHeight;
					}
	
				var windowWidth, windowHeight;
					if (self.innerHeight) {	// alle undtagen Explorer
						windowWidth = self.innerWidth;
						windowHeight = self.innerHeight;
					} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6
						windowWidth = document.documentElement.clientWidth;
						windowHeight = document.documentElement.clientHeight;
					} else if (document.body) { // Andre Explorers
						windowWidth = document.body.clientWidth;
						windowHeight = document.body.clientHeight;
			}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

 
*/
window.onload = function() {
	if(document.getElementById('banner2'))
		bannerialt = banner.length;	
  if(document.getElementById('banner')) {
	document.getElementById('banner').src = banner[0];
	document.getElementById('banner2').src = banner[1];
	document.getElementById('banner').style.visibility = 'visible';
	inti = setInterval("loop_banner()",3000);
  }
}

			var idnow = 1;
   			var doit = true;
			function skift_pic() {
					Effect.Fade('pic'+idnow, { duration: 3.0 });
					idnow++;
					if(idnow>2)
						idnow=1;
					Effect.Appear('pic'+idnow, { duration: 3.0 });
					doit = false;
					setTimeout("skift_pic()", 7000);
			}
			




function set_banner(bannertal) {
	clearInterval(inti);
	if(bannertal==bannerialt) 
		bannertal = 0;
	
	if(bid_keeper) {
		document.getElementById('banner2').src = banner[bannertal];
		
		setTimeout("Effect.Fade('banner', { duration: 3.0 })", 100);
		setTimeout("Effect.Appear('banner2', { duration: 3.0 })", 100);
		bid_keeper = false;
	} else {
		document.getElementById('banner').src = banner[bannertal];
		
		setTimeout("Effect.Fade('banner2', { duration: 3.0 })", 100);
		setTimeout("Effect.Appear('banner', { duration: 3.0 })", 100);
		bid_keeper = true;
	}
	bid = bannertal;
	inti = setInterval("loop_banner()",5000);
}

function loop_banner() {
	set_banner(bid+1);
}
