window.addEvent('domready', function() {
	var myAccordion = new Accordion($('menu'), 'div.toggler', 'div.element', {
		display: -1,
		opacity: false,
//		alwaysHide: true,
		duration: 800,
		transition: 'quart:out',
		fps: 60,

		onActive: function(toggler, element){
			toggler.setStyle('background-position', ' top center');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('background-position', 'top left');
		}
	});
		
		var onMenu = false;
		var menuExitFunction = function() { if(!onMenu) {myAccordion.display(3);} }
		$('menu').addEvent('mouseleave', function() { onMenu = false; menuExitFunction.delay(700) } );
		$('menu').addEvent('mouseenter', function() { onMenu= true; } );
		$$('.toggler').addEvent('mouseenter', function() { this.fireEvent('click'); });

		$$('.menu-item').addEvent('click', function() { $$('.menu-item').removeClass('active').addClass('background'); this.removeClass('background').addClass('active'); });
		$$('.menu-logo').addEvent('click', function() { $$('.menu-item').removeClass('active').addClass('background'); myAccordion.display(3); } );
});

var dataArray = new Array();
var optionsArray = new Array();

optionsArray[0] = {controller: true, hu: 'images/slides/kondishund/', thumbnails: false, titles: false, captions: false, width: 640, height: 360, delay: 2000, duration: 500, loop: false, onEnd: function() {ajaxpage('pages/hur_vi_arbetar.html', 'main', 1000)} }
optionsArray[1] = {controller: true, hu: 'images/slides/24h/', thumbnails: false, titles: false, captions: false, width: 640, height: 360, delay: 2000, duration: 500, loop: false, onEnd: function() {ajaxpage('pages/hur_vi_arbetar.html', 'main', 1000)} }
optionsArray[2] = {controller: true, hu: 'images/slides/sand/', thumbnails: false, titles: false, captions: false, width: 640, height: 360, delay: 2000, duration: 500, loop: false, onEnd: function() {ajaxpage('pages/hur_vi_arbetar.html', 'main', 1000)} }
optionsArray[3] = {controller: true, hu: 'images/slides/villa/', thumbnails: false, titles: false, captions: false, width: 640, height: 360, delay: 2000, duration: 500, loop: false, onEnd: function() {ajaxpage('pages/hur_vi_arbetar.html', 'main', 1000)} }

optionsArray[4] = {controller: true, hu: 'images/slides/bildgalleri/', thumbnails: false, titles: false, captions: true, width: 640, height: 360, delay: 5000, duration: 1500}
optionsArray[5] = {controller: true, hu: 'images/slides/jatteformat/', thumbnails: false, titles: false, captions: true, width: 640, height: 360, delay: 5000, duration: 1500}
optionsArray[6] = {controller: true, hu: 'images/slides/fotograf/', thumbnails: false, titles: false, captions: true, width: 640, height: 360, delay: 5000, duration: 1500}

dataArray[0] = {
  'wKondishundPan_01.jpg': { caption: '' },
  'wKondishundPan_02.jpg': { caption: '' },
  'wKondishundPan_03.jpg': { caption: '' },
  'wKondishundPan_04.jpg': { caption: '' },
  'wKondishundPan_05.jpg': { caption: '' },
  'wKondishundPan_06.jpg': { caption: '' },
  'wKondishundPan_07.jpg': { caption: '' },
  'wKondishundPan_08.jpg': { caption: '' },
  'wKondishundPan_09.jpg': { caption: '' },
  'wKondishundPan_10.jpg': { caption: '' },
  'wKondishundPan_11.jpg': { caption: '' },
  'wKondishundPan_12.jpg': { caption: '' },
  'wKondishundPan_13.jpg': { caption: '' },
  'wKondishundPan_14.jpg': { caption: '' },
  'wKondishundPan_15.jpg': { caption: '' },
  'wKondishundPan_16.jpg': { caption: '' }
};

dataArray[1] = {
  'w24H_Dag_a.jpg': { caption: '' }, 
  'w24H_Dag_b.jpg': { caption: '' }, 
  'w24H_Dag_c.jpg': { caption: '' },
  'w24H_Dag_d.jpg': { caption: '' }, 
  'w24H_Dag_e.jpg': { caption: '' }, 
  'w24H_Dag_f.jpg': { caption: '' },
  'w24H_Dag_g.jpg': { caption: '' }, 
  'w24H_Dag_h.jpg': { caption: '' }, 
  'w24H_Dag_i.jpg': { caption: '' }, 
  'w24H_Dag_j.jpg': { caption: '' }
};

dataArray[2] = {
  'wAdrSand_01.jpg': { caption: '' }, 
  'wAdrSand_02.jpg': { caption: '' }, 
  'wAdrSand_03.jpg': { caption: '' },
  'wAdrSand_04.jpg': { caption: '' }, 
  'wAdrSand_05.jpg': { caption: '' }, 
  'wAdrSand_06.jpg': { caption: '' },
  'wAdrSand_07.jpg': { caption: '' }, 
  'wAdrSand_08.jpg': { caption: '' }, 
  'wAdrSand_09.jpg': { caption: '' },
  'wAdrSand_10.jpg': { caption: '' },
  'wAdrSand_11.jpg': { caption: '' }
};

dataArray[3] = {
  'wAdrVilla_01.jpg': { caption: '' }, 
  'wAdrVilla_02.jpg': { caption: '' }, 
  'wAdrVilla_03.jpg': { caption: '' }, 
  'wAdrVilla_04.jpg': { caption: '' }, 
  'wAdrVilla_05.jpg': { caption: '' }, 
  'wAdrVilla_06.jpg': { caption: '' }, 
  'wAdrVilla_07.jpg': { caption: '' }, 
  'wAdrVilla_08.jpg': { caption: '' }, 
  'wAdrVilla_09.jpg': { caption: '' }, 
  'wAdrVilla_10.jpg': { caption: '' }, 
  'wAdrVilla_11.jpg': { caption: '' }, 
  'wAdrVilla_12.jpg': { caption: '' }, 
  'wAdrVilla_13.jpg': { caption: '' }, 
  'wAdrVilla_14.jpg': { caption: '' }, 
  'wAdrVilla_15.jpg': { caption: '' }
};


dataArray[4] = {
  '02_wMosbF_02.jpg': { caption: '' }, 
  '03_wMosbE_02.jpg': { caption: 'Mosebacke i mitt huvud' }, 
  '04_wMosbE_01.jpg': { caption: '' }, 

  '30_wViasatMotor_01.jpg': { caption: '' }, 
  '29_wViasatMix_a.jpg': { caption: '' }, 
  '46_wHistory_01.jpg': { caption: 'Så nära du kan komma utan att ha varit där - Viasat History' },

  '05_wIKANOberg_01.jpg': { caption: 'Billån - Ikanobanken' }, 
  '06_wIKANOberg_02.jpg': { caption: '' }, 

  '25_wTaxilampa_01.jpg': { caption: 'Dela på en Flygtaxi' }, 
  '26_wTaxilampa_02.jpg': { caption: '' }, 

  '07_wPlasikAnsikte_01.jpg': { caption: 'Minska leendet' }, 

  '09_wPlasikAnsikte_03.jpg': { caption: '' }, 
  '10_wRadium_01.jpg': { caption: '' }, 
  '11_wRadium_02.jpg': { caption: '' }, 
  '12_wRadium_03.jpg': { caption: '' }, 
  '13_wRadium_04.jpg': { caption: '' }, 
  '14_wScania_omfarg_a.jpg': { caption: '' }, 
  '15_wScania_omfarg_b.jpg': { caption: '' }, 
  '16_wSkalmanklocka.jpg': { caption: 'Skalman-klocka' }, 
  '17_wSpokSurfare_01.jpg': { caption: '' }, 
  '18_wSpokSurfare_02.jpg': { caption: '' }, 
  '19_wSvenskFast_01.jpg': { caption: '' }, 
  '20_wSvenskFast_02.jpg': { caption: '' }, 
  '21_wSymbicourt_02.jpg': { caption: '' }, 
  '22_wSymbicourt_03.jpg': { caption: '' }, 
  '23_wTabortskugga_a.jpg': { caption: '' }, 
  '24_wTabortskugga_b.jpg': { caption: '' }, 

  '27_wToning_01.jpg': { caption: '' }, 
  '28_wToning_02.jpg': { caption: '' }, 

  '31_wAdobeHonaKott_01.jpg': { caption: 'Klassiska Adobe-bilder' }, 
  '32_wAdobeZebra_01.jpg': { caption: 'Klassiska Adobe-bilder' }, 
  '33_wBrisBorste_02.jpg': { caption: '' }, 
  '34_wBrisBorste.jpg': { caption: '' }, 
  '35_wBrisJeans.jpg': { caption: '' }, 
  '36_wBrisTatlHang_01.jpg': { caption: '' }, 
  '37_wCityMail_a.jpg': { caption: 'Rita med skräddarkrita' }, 
  '38_wCityMail_b.jpg': { caption: '' }, 
  '39_wCocacola_Tomte_b.jpg': { caption: '' }, 
  '40_wDofilus_01.jpg': { caption: '' }, 
  '41_wDofilus_03.jpg': { caption: '' }, 
  '42_wForexkort.jpg': { caption: '' }, 
  '43_wGevaliaKopp_01.jpg': { caption: '' }, 
  '44_wGevaliaKopp_02.jpg': { caption: '' }, 
  '45_wHarryP_01.jpg': { caption: '' }
};

dataArray[5] = {
  'wDyk_a.jpg': { caption: '' }, 
  'wDyk_b.jpg': { caption: '' }, 
  'wDyk_c.jpg': { caption: '' },
  'wDyk_d.jpg': { caption: '' }, 
  'wDyk_e.jpg': { caption: '' }, 
  'wDyk_f.jpg': { caption: '' },
  'wMotorBussbak_a.jpg': { caption: '' }, 
  'wMotorBussbak_b.jpg': { caption: '' }, 
  'wMotorBussbak_c.jpg': { caption: '' }
};

dataArray[6] = {
  '01_wSten_BroDalalven.jpg': { caption: 'Vill du ha hjälp med fotograferingen erbjuder vi fotograf Sten Jansin, som är vår husfotograf.' }, 
  '02_wSten_F0015.jpg': { caption: '' }, 
  '03_wSten_joo2.jpg': { caption: '' }, 
  '04_wSten_FOU_ICA.jpg': { caption: '' }, 
  '05_wSten_FOU_mobil.jpg': { caption: '' }, 
  '06_wSten_FOU_polis.jpg': { caption: '' }, 
  '07_wSten_FOU_bil.jpg': { caption: '' }, 
  '08_wSten_FOU_mjol.jpg': { caption: '' }, 
  '09_wSten_Lager.jpg': { caption: '' }
};



function loadSlide(slide,slideoptions) {
	    myShow = new Slideshow('show', dataArray[slide], optionsArray[slide]);
}
