// Buttons for links:
button = new Array()
for (i=0 ; i <=24 ; i++)
{
	button[i] = new Image();
}

button2 = new Array()
for (i=0 ; i <=24 ; i++)
{
	button2[i] = new Image();
}
button[0].src = "/img/links/da_spl_news_ina.gif";
button[1].src = "/img/links/da_spl_news_act.gif";
button[2].src = "/img/links/da_spl_tour_ina.gif";
button[3].src = "/img/links/da_spl_tour_act.gif";
button[4].src = "/img/links/da_spl_disc_ina.gif";
button[5].src = "/img/links/da_spl_disc_act.gif";
button[6].src = "/img/links/da_spl_video_ina.gif";
button[7].src = "/img/links/da_spl_video_act.gif";
button[8].src = "/img/links/da_spl_forum_ina.gif";
button[9].src = "/img/links/da_spl_forum_act.gif";
button[10].src = "/img/links/arrow_ina.gif";
button[11].src = "/img/links/arrow_act.gif";
button[12].src = "/img/links/da_sterl_ina.gif";
button[13].src = "/img/links/da_sterl_act.gif";
button[14].src = "/img/links/da_disc_ina.gif";
button[15].src = "/img/links/da_disc_act.gif";
button[16].src = "/img/links/da_gallery_ina.gif";
button[17].src = "/img/links/da_gallery_act.gif";
button[18].src = "/img/links/da_video_ina.gif";
button[19].src = "/img/links/da_video_act.gif";
button[20].src = "/img/links/da_forum_ina.gif";
button[21].src = "/img/links/da_forum_act.gif";
button[22].src = "/img/links/da_links_ina.gif";
button[23].src = "/img/links/da_links_act.gif"; 

button2[0].src = "/img/links/en_spl_news_ina.gif";
button2[1].src = "/img/links/en_spl_news_act.gif";
button2[2].src = "/img/links/en_spl_tour_ina.gif";
button2[3].src = "/img/links/en_spl_tour_act.gif";
button2[4].src = "/img/links/en_spl_disc_ina.gif";
button2[5].src = "/img/links/en_spl_disc_act.gif";
button2[6].src = "/img/links/en_spl_video_ina.gif";
button2[7].src = "/img/links/en_spl_video_act.gif";
button2[8].src = "/img/links/en_spl_forum_ina.gif";
button2[9].src = "/img/links/en_spl_forum_act.gif";
button2[10].src = "/img/links/arrow_ina.gif";
button2[11].src = "/img/links/arrow_act.gif";
button2[12].src = "/img/links/en_sterl_ina.gif";
button2[13].src = "/img/links/en_sterl_act.gif";
button2[14].src = "/img/links/en_disc_ina.gif";
button2[15].src = "/img/links/en_disc_act.gif";
button2[16].src = "/img/links/en_gallery_ina.gif";
button2[17].src = "/img/links/en_gallery_act.gif";
button2[18].src = "/img/links/en_video_ina.gif";
button2[19].src = "/img/links/en_video_act.gif";
button2[20].src = "/img/links/en_forum_ina.gif";
button2[21].src = "/img/links/en_forum_act.gif";
button2[22].src = "/img/links/en_links_ina.gif";
button2[23].src = "/img/links/en_links_act.gif"; 
 
function da_change_pic(pic_name,pic_frame)
{
	//document[pic_name].src = button[pic_frame].src;
	document.getElementById(pic_name).src = button[pic_frame].src;
}

function en_change_pic(pic_name,pic_frame)
{
	//document[pic_name].src = button[pic_frame].src;
	document.getElementById(pic_name).src = button2[pic_frame].src;
}

// Clears mail contact input fields
function clearform(){
	if (document.newsletterform.email.value=="Min email") document.newsletterform.email.value="";
}   

// Stuff for the archive pop up
function archive(){
	var archiveaddress="/newsarc.popup.php";
	archivewinLeft		= (screen.availWidth / 2) - 400;
	archivewinTop		= (screen.availHeight / 2) - 24-300;
	archivefeatures	= "scrollbars=yes,width=800 ,height=600,top=" + archivewinTop + ",left=" + archivewinLeft + ",screenX=" + archivewinLeft + ",screenY=" + archivewinTop;
	archiveWin	= window.open(archiveaddress,"unsupported",archivefeatures);
	archiveWin.focus();
}

//Newsletter list administration:
function newspop(action){
	var address="/newsletter.php?action=" +action;
	winLeft         = (screen.availWidth / 2) - 175;
	winTop          = (screen.availHeight / 2) - 24 - 125;
	features        = "scrollbars=no,width=265,height=170,top=" + winTop + ",left=" + winLeft + ",screenX=" + winLeft + ",screenY=" + winTop;
	newsletterWin       = window.open(address,"unsupported",features);
	newsletterWin.focus();
}

//Gallery pictures, pretty old
function gallerypic(gallery,picture,titel,beskrivelse,dato,sted,copyright){
	var picaddress="/img/galleri/" +gallery + "/" +picture;
	document.getElementById('galleryhighlight').src = picaddress;
	var pictext="<b>" +titel +"</b><br>Dato: " + dato + "<br>Sted: " +sted +"<br>Fotograf: " + copyright + "<br><br>" +beskrivelse;
	document.getElementById('pictext').innerHTML=pictext;
}

//Fade functions for news div
var oc=0;
function newsfadein() {
	oc2=oc/100;
	document.getElementById('newslyr').style.filter="alpha(opacity="+oc+")";
	document.getElementById('newslyr').style.opacity=oc2;		
	if(oc<=92) setTimeout('oc=oc+4;newsfadein()',1);
}

function newsfadeout() {
	oc2=oc/100;
	document.getElementById('newslyr').style.filter="alpha(opacity="+oc+")";
	document.getElementById('newslyr').style.opacity=oc2;
	if(oc>0) setTimeout('oc=oc-4;newsfadeout()',1);
	else document.getElementById('newslyr').style.display='none';
}


//Make an array for the different albums to fix disc section fade functions
var aoc=new Array(25);
var aoc2=new Array(25);		
var fic=new Array(25);
var fc=new Array(25);		
var x=0; 
for (x=0; x<25; x++){
	aoc[x]=50;
	aoc2[x]=50;
	fc[x]=0;
} 


//Disc section fades functions
function  discfade(disclyr,index,type){
	fc[index]++;
	if(type=="in") discfadein(disclyr,index,fc[index]);
	else if(type=="out") discfadeout(disclyr,index,fc[index]);
}

function discfadeout(disclyr,index,count){
	if(count<fc[index]) return;
	aoc2[index]=aoc[index]/100;
	document.getElementById(disclyr).style.filter="alpha(opacity="+aoc[index]+")";
	document.getElementById(disclyr).style.opacity=aoc2[index];
	if(aoc[index]>50) setTimeout("aoc["+index+"]=aoc["+index+"]-1;discfadeout('"+disclyr+"','"+index+"','"+count+"')",1);
}

function discfadein(disclyr,index,count){
	if(count<fc[index]) return;
	aoc2[index]=aoc[index]/100;
	document.getElementById(disclyr).style.filter="alpha(opacity="+aoc[index]+")";
	document.getElementById(disclyr).style.opacity=aoc2[index];
	if(aoc[index]<=99) setTimeout("aoc["+index+"]=aoc["+index+"]+1;discfadein('"+disclyr+"','"+index+"','"+count+"')",1);
}

// Lyrics fade functions:
var lyroc=0;
	function lyrfadein() {
	lyroc2=lyroc/100;
	document.getElementById('lyrlyr').style.filter="alpha(opacity="+lyroc+")";
	document.getElementById('lyrlyr').style.opacity=lyroc2;		
	if(lyroc<=90) setTimeout('lyroc=lyroc+4;lyrfadein()',1);
}

function lyrfadeout() {
	lyroc2=lyroc/100;
	document.getElementById('lyrlyr').style.filter="alpha(opacity="+lyroc+")";
	document.getElementById('lyrlyr').style.opacity=lyroc2;
	if(lyroc>0) setTimeout('lyroc=lyroc-4;lyrfadeout()',1);
	else document.getElementById('lyrlyr').style.display='none';
}

// Disc info fade functions:
var infoc=0;
	function infofadein() {
	infoc2=infoc/100;
	document.getElementById('infolyr').style.filter="alpha(opacity="+infoc+")";
	document.getElementById('infolyr').style.opacity=infoc2;		
	if(infoc<=90) setTimeout('infoc=infoc+4;infofadein()',1);
}

function infofadeout() {
	infoc2=infoc/100;
	document.getElementById('infolyr').style.filter="alpha(opacity="+infoc+")";
	document.getElementById('infolyr').style.opacity=infoc2;
	if(infoc>0) setTimeout('infoc=infoc-4;infofadeout()',1);
	else document.getElementById('infolyr').style.display='none';
}

// Disc buy fade functions:
var buyoc=0;
	function buyfadein() {
	buyoc2=buyoc/100;
	document.getElementById('buylyr').style.filter="alpha(opacity="+buyoc+")";
	document.getElementById('buylyr').style.opacity=buyoc2;		
	if(buyoc<=90) setTimeout('buyoc=buyoc+4;buyfadein()',1);
}

function buyfadeout() {
	buyoc2=buyoc/100;
	document.getElementById('buylyr').style.filter="alpha(opacity="+buyoc+")";
	document.getElementById('buylyr').style.opacity=buyoc2;
	if(buyoc>0) setTimeout('buyoc=buyoc-4;buyfadeout()',1);
	else document.getElementById('buylyr').style.display='none';
}
// Events events fade functions:
var eventsoc=0;
	function eventsfadein() {
	eventsoc2=eventsoc/100;
	document.getElementById('eventslyr').style.filter="alpha(opacity="+eventsoc+")";
	document.getElementById('eventslyr').style.opacity=eventsoc2;		
	if(eventsoc<=90) setTimeout('eventsoc=eventsoc+4;eventsfadein()',1);
}

function eventsfadeout() {
	eventsoc2=eventsoc/100;
	document.getElementById('eventslyr').style.filter="alpha(opacity="+eventsoc+")";
	document.getElementById('eventslyr').style.opacity=eventsoc2;
	if(eventsoc>0) setTimeout('eventsoc=eventsoc-4;eventsfadeout()',1);
	else document.getElementById('eventslyr').style.display='none';
}