var slideshow_width='520px' //SET IMAGE WIDTH
var slideshow_height='360px' //SET IMAGE HEIGHT
var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)

var floatingZero

function generateArray(URLpiece,number){ 
//which filename and how many pictures in category or series?
 for (i=0;i<=number-1;i++){
  if (i>8){
   floatingZero = ""
  }
  else
  {
   floatingZero = "0"
  }
 fadeimages[i]=["pix/"+URLpiece+floatingZero+[i+1]+".jpg", "javascript:stop_showThisPix("+(i+1)+")", ""]
 }
}

f = (f.indexOf("?")!=-1)?f.substring(f.lastIndexOf("/")+1,f.indexOf("?")):f.substring(f.lastIndexOf("/")+1,f.length);

function correctSectionColors(){
 document.getElementById('About').style.color = AboutColor
 document.getElementById('PJ').style.color = PJColor
 document.getElementById('Misc').style.color = MiscColor
 document.getElementById('Sales').style.color = SalesColor
 document.getElementById('mainArea').style.backgroundColor = thisCatColor
}


var fadeimages=new Array()
//SET 1) IMAGE PATHS, 2) optional link, 3), optional link target:

switch(f) {
  case "pj.htm":
    fadeimages[0]=["pix/5_rusl01.jpg", "pj_orphanage.htm", ""]
    fadeimages[1]=["pix/2_sped01.jpg", "pj_leprosy.htm", ""]
    fadeimages[2]=["pix/8_life03.jpg", "pj_life.htm", ""]
    fadeimages[3]=["pix/4_bilibid03.jpg", "pj_prison.htm", ""]
    fadeimages[4]=["pix/3_earthquake05.jpg", "pj_earthquake.htm", ""]
    fadeimages[5]=["pix/1_nepal06.jpg", "pj_brick.htm", ""]
    fadeimages[6]=["pix/6_sm07.jpg", "pj_smoky.htm", ""]
	fadeimages[7]=["pix/7_LAOS01.jpg", "pj_laos.htm", ""]
    document.title=".: fbyrum.dk | Photos by F.Byrum :.";
  break;
  case "pj_brick.htm":
    generateArray('1_nepal',8)
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "pj_leprosy.htm":
    generateArray('2_sped',10)
    document.title=".: fbyrum.dk | Leprosy (Bangladesh) | Photos by F.Byrum :.";
  break;
  case "pj_earthquake.htm":
    generateArray('3_earthquake',7)
    document.title=".: fbyrum.dk | Earthquake (Peru) | Photos by F.Byrum :.";
  break;
  case "pj_prison.htm":
    generateArray('4_bilibid',10)
    document.title=".: fbyrum.dk | Bilibid Prison (The Philippines) | Photos by F.Byrum :.";
  break;
  case "pj_orphanage.htm":
    generateArray('5_rusl',5)
    document.title=".: fbyrum.dk | Orphanage (Russia) | Photos by F.Byrum :.";
  break;
  case "pj_smoky.htm":
    generateArray('6_sm',8)
    document.title=".: fbyrum.dk | Smoky Mountain (The Philippines) | Photos by F.Byrum :.";
  break;
  case "pj_laos.htm":
    generateArray('7_LAOS',10)
    document.title=".: fbyrum.dk | Smoky Mountain (Laos | Photos by F.Byrum :.";
  break;
  case "pj_life.htm":
    generateArray('8_life',19)
    document.title=".: fbyrum.dk | Daily Life | Photos by F.Byrum :.";
  break;
  case "misc.htm":
    thisCatColor = MiscColor
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
 	fadeimages[0]=["pix/b_bats01.jpg", "misc_bats.htm", ""]
 	fadeimages[1]=["pix/c_food01.jpg", "misc_food.htm", ""]
	fadeimages[2]=["pix/d_industri04.jpg", "misc_industri.htm", ""]
	fadeimages[3]=["pix/e_fyn02.jpg", "misc_fyn.htm", ""]
	fadeimages[4]=["pix/g_rom17.jpg", "misc_rom.htm", ""]
	fadeimages[5]=["pix/h_port13.jpg", "misc_bort.htm", ""]
	fadeimages[6]=["pix/f_aarhus02.jpg", "misc_aarhus.htm", ""]
	fadeimages[7]=["pix/j_collage01.jpg", "misc_collage.htm", ""]
    document.title=".: fbyrum.dk | Miscellaneous Pictures by F.Byrum :.";
  break;
  case "misc_bats.htm":
    thisCatColor = MiscColor
    generateArray('b_bats',8)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "misc_food.htm":
    thisCatColor = MiscColor
    generateArray('c_food',12)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "misc_industri.htm":
    thisCatColor = MiscColor
    generateArray('d_industri',12)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "misc_fyn.htm":
    thisCatColor = MiscColor
    generateArray('e_fyn',19)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;  
  case "misc_rom.htm":
    thisCatColor = MiscColor
    generateArray('g_rom',18)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "misc_port.htm":
    thisCatColor = MiscColor
    generateArray('h_port',15)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "misc_aarhus.htm":
    thisCatColor = MiscColor
    generateArray('f_aarhus',20)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "misc_collage.htm":
    thisCatColor = MiscColor
    generateArray('j_collage',5)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Brick Production (Nepal) | Photos by F.Byrum :.";
  break;
  case "artgal.htm":
    thisCatColor = ArtColor
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    generateArray('a_art',8)
    document.title=".: fbyrum.dk | International PhotoArt Gallery :.";
  break;
    case "news.htm":
    thisCatColor = NewsColor
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    fadeimages[0]=["pix/n_news01.jpg", "#", ""]
	fadeimages[1]=["pix/e_fyn01.jpg", "news_fyn.htm", ""]
    fadeimages[2]=["pix/f_aarhus01.jpg", "news_aarhus.htm", ""]
    fadeimages[3]=["pix/i_lama01.jpg", "news_lama.htm", ""]
	fadeimages[4]=["pix/j_amigos01.jpg", "news_amigos.htm", ""]
	fadeimages[5]=["pix/V01.jpg", "news_vesterhav.htm", ""]
    document.title=".: fbyrum.dk | International Photo Commercial :.";
  break;
  case "news_fyn.htm":
    thisCatColor = NewsColor
    generateArray('e_fyn',18)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Book Fyn | Photos by F.Byrum :.";
  break;
  case "news_aarhus.htm":
    thisCatColor = NewsColor
    generateArray('f_aarhus',20)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Book Aarhus | Photos by F.Byrum :.";
  break;
  case "news_lama.htm":
    thisCatColor = NewsColor
    generateArray('i_lama',1)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Lama | Photos by F.Byrum :.";
  break;
  case "news_amigos.htm":
    thisCatColor = NewsColor
    generateArray('j_amigos',1)
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Amigos | Photos by F.Byrum :.";
  break;
  case "news_laos.htm":
    thisCatColor = NewsColor
    generateArray('7_LAOS',10)    
	document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Smoky Mountain (Laos | Photos by F.Byrum :.";
  break;
  case "news_vesterhav.htm":
    thisCatColor = NewsColor
    generateArray('V',17)    
	document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    document.title=".: fbyrum.dk | Book Vesterhavet | Photos by F.Byrum :.";
  break;
  case "index.php":
    thisCatColor = MiscColor
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    generateArray('a_art',7)
    document.title=".: fbyrum.dk | International PhotoArt Gallery :.";
  break;
  default:
    thisCatColor = MiscColor
    document.getElementById('mainArea').style.backgroundColor = thisCatColor;
    generateArray('a_art',7)
    document.title=".: fbyrum.dk | International PhotoArt Gallery :.";
  break;
}

function fitSalesAndAbout(){
 switch(f) {
  case "sales.htm":
    thisCatColor = SalesColor
    document.getElementById('mainArea').style.backgroundColor = thisCatColor
    document.getElementById('Sales').style.color = thisCatColor
  break;
  case "about.htm":
    thisCatColor = AboutColor
    document.getElementById('mainArea').style.backgroundColor = thisCatColor
    document.getElementById('About').style.color = thisCatColor
  break;
  default:
    return;
  break;
 }
}

correctSectionColors()