var bReady      = false;
window.onbeforeunload=CheckBasket;
var iCheckBasket = 1;
var strTheme    = '';
var strMainMenu = '';
var strSubMenu  = 'SubMenuPHOTOS';
var strContent  = '';
var iCurLang    = 0;
var iCurMenuPHOTO  = 0;
var iCurMenuINFO  = 2;
var strCurImgID = '';
var strLastImgID = '';
var strCurImgText = '';
var strLastImgText = '';
var strInfo     = 'Info' + iCurMenuINFO;
var nCatImages = new Array (12,20,20,28,16,16,20,16,16,16,16,12,12,16,0);
var CurCatImg = new Array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1);
CatID = new Array ('14','15','1','3','4','2','9','5','8','7','12','6','13','10');
CatNames = new Array ('Wildfires in Greece','A Childhood Behind Bars','Behind the rise of Russian Female tennis','Water Pollution in China','The poison Village','Ugandas lost Generation','The forgotten War in Northern Uganda','Roma life in Milan','The Weight of Loss','Surfers Paradise','In need of Help','Roskilde Festival through the Haze','Down the Hill','Above the Clouds');
CatText =  new MakeArray(14); 
CatText[0] = ' '; 
CatText[1] = ' '; 
CatText[2] = ' '; 
CatText[3] = ' '; 
CatText[4] = ' '; 
CatText[5] = ' '; 
CatText[6] = ' '; 
CatText[7] = ' '; 
CatText[8] = ' '; 
CatText[9] = ' '; 
CatText[10] = ' '; 
CatText[11] = ' '; 
CatText[12] = ' '; 
CatText[13] = ' '; 
InfoID = new Array ('1','2','profile');
InfoNames = new Array ('Water Pollution in China','The forgotten War in Northern Uganda','Profile');
var nImagesLoaded = 0; 
var nImagesTotal  = 236; 
ImageSource =  new MakeArray(14); 
ImageSource[0] = new Array('wildfires01.jpg','wildfires07.jpg','wildfires02.jpg','wildfires08.jpg','wildfires03.jpg','wildfires09.jpg','wildfires04.jpg','wildfires10.jpg','wildfires05.jpg','wildfires11.jpg','wildfires06.jpg','wildfires12.jpg','');
ImageSource[1] = new Array('behindbars001.jpg','behindbars011.jpg','behindbars002.jpg','behindbars012.jpg','behindbars003.jpg','behindbars013.jpg','behindbars004.jpg','behindbars014.jpg','behindbars005.jpg','behindbars015.jpg','behindbars006.jpg','behindbars016.jpg','behindbars007.jpg','behindbars017.jpg','behindbars008.jpg','behindbars018.jpg','behindbars009.jpg','behindbars019.jpg','behindbars010.jpg','behindbars020.jpg','');
ImageSource[2] = new Array('','','01.jpg','','02.jpg','','03.jpg','','04.jpg','','05.jpg','','06.jpg','','07.jpg','','08.jpg','','','','');
ImageSource[3] = new Array('','songhua013.jpg','songhua001.jpg','songhua014.jpg','songhua002.jpg','songhua015.jpg','songhua003.jpg','songhua016.jpg','songhua004.jpg','songhua017.jpg','songhua008.jpg','songhua018.jpg','songhua005.jpg','songhua019.jpg','songhua007.jpg','songhua020.jpg','songhua006.jpg','songhua021.jpg','songhua009.jpg','songhua022.jpg','songhua010.jpg','songhua023.jpg','songhua011.jpg','songhua024.jpg','songhua012.jpg','songhua025.jpg','','','');
ImageSource[4] = new Array('','leifeng008.jpg','leifeng001.jpg','leifeng009.jpg','leifeng002.jpg','leifeng011.jpg','leifeng003.jpg','leifeng010.jpg','leifeng004.jpg','leifeng012.jpg','leifeng005.jpg','','leifeng006.jpg','','leifeng007.jpg','','');
ImageSource[5] = new Array('','007.jpg','002.jpg','008.jpg','001.jpg','011.jpg','003.jpg','010.jpg','004.jpg','012.jpg','005.jpg','','009.jpg','','006.jpg','','');
ImageSource[6] = new Array('forgottenwar001.jpg','forgottenwar010.jpg','forgottenwar002.jpg','forgottenwar011.jpg','forgottenwar003.jpg','forgottenwar012.jpg','forgottenwar004.jpg','forgottenwar013.jpg','forgottenwar005.jpg','forgottenwar014.jpg','forgottenwar006.jpg','forgottenwar015.jpg','forgottenwar007.jpg','forgottenwar016.jpg','forgottenwar008.jpg','forgottenwar017.jpg','forgottenwar009.jpg','','','','');
ImageSource[7] = new Array('','roma008.jpg','roma001.jpg','roma009.jpg','roma002.jpg','roma010.jpg','roma003.jpg','roma011.jpg','roma004.jpg','roma012.jpg','roma005.jpg','','roma006.jpg','','roma007.jpg','','');
ImageSource[8] = new Array('','kurcenter007.jpg','kurcenter001.jpg','kurcenter008.jpg','kurcenter002.jpg','kurcenter009.jpg','kurcenter003.jpg','kurcenter010.jpg','kurcenter004.jpg','','kurcenter005.jpg','','kurcenter006.jpg','','','','');
ImageSource[9] = new Array('','windsurfing007.jpg','windsurfing001.jpg','windsurfing008.jpg','windsurfing002.jpg','','windsurfing003.jpg','','windsurfing004.jpg','','windsurfing005.jpg','','windsurfing006.jpg','','','','');
ImageSource[10] = new Array('','','homehelp001.jpg','','homehelp002.jpg','','homehelp003.jpg','','homehelp004.jpg','','homehelp005.jpg','','homehelp006.jpg','','homehelp007.jpg','','');
ImageSource[11] = new Array('','roskilde007.jpg','roskilde001.jpg','roskilde008.jpg','roskilde002.jpg','roskilde006.jpg','roskilde005.jpg','','roskilde004.jpg','','roskilde003.jpg','','');
ImageSource[12] = new Array('','','downhill001.jpg','','downhill002.jpg','','downhill003.jpg','','downhill004.jpg','','downhill005.jpg','','');
ImageSource[13] = new Array('','McKinley008.jpg','McKinley001.jpg','McKinley009.jpg','McKinley002.jpg','McKinley010.jpg','McKinley003.jpg','McKinley011.jpg','McKinley004.jpg','McKinley012.jpg','McKinley005.jpg','McKinley013.jpg','McKinley006.jpg','McKinley014.jpg','McKinley007.jpg','','');
ImageThumbSource =  new MakeArray(14); 
ImageThumbSource[0] = new Array('wildfires01T.jpg','wildfires07T.jpg','wildfires02T.jpg','wildfires08T.jpg','wildfires03T.jpg','wildfires09T.jpg','wildfires04T.jpg','wildfires10T.jpg','wildfires05T.jpg','wildfires11T.jpg','wildfires06T.jpg','wildfires12T.jpg','');
ImageThumbSource[1] = new Array('behindbars001T.jpg','behindbars011T.jpg','behindbars002T.jpg','behindbars012T.jpg','behindbars003T.jpg','behindbars013T.jpg','behindbars004T.jpg','behindbars014T.jpg','behindbars005T.jpg','behindbars015T.jpg','behindbars006T.jpg','behindbars016T.jpg','behindbars007T.jpg','behindbars017T.jpg','behindbars008T.jpg','behindbars018T.jpg','behindbars009T.jpg','behindbars019T.jpg','behindbars010T.jpg','behindbars020T.jpg','');
ImageThumbSource[2] = new Array('','','01T.jpg','','02T.jpg','','03T.jpg','','04T.jpg','','05T.jpg','','06T.jpg','','07T.jpg','','08T.jpg','','','','');
ImageThumbSource[3] = new Array('','songhua013T.jpg','songhua001T.jpg','songhua014T.jpg','songhua002T.jpg','songhua015T.jpg','songhua003T.jpg','songhua016T.jpg','songhua004T.jpg','songhua017T.jpg','songhua008T.jpg','songhua018T.jpg','songhua005T.jpg','songhua019T.jpg','songhua007T.jpg','songhua020T.jpg','songhua006T.jpg','songhua021T.jpg','songhua009T.jpg','songhua022T.jpg','songhua010T.jpg','songhua023T.jpg','songhua011T.jpg','songhua024T.jpg','songhua012T.jpg','songhua025T.jpg','','','');
ImageThumbSource[4] = new Array('','leifeng008T.jpg','leifeng001T.jpg','leifeng009T.jpg','leifeng002T.jpg','leifeng011T.jpg','leifeng003T.jpg','leifeng010T.jpg','leifeng004T.jpg','leifeng012T.jpg','leifeng005T.jpg','','leifeng006T.jpg','','leifeng007T.jpg','','');
ImageThumbSource[5] = new Array('','007T.jpg','002T.jpg','008T.jpg','001T.jpg','011T.jpg','003T.jpg','010T.jpg','004T.jpg','012T.jpg','005T.jpg','','009T.jpg','','006T.jpg','','');
ImageThumbSource[6] = new Array('forgottenwar001T.jpg','forgottenwar010T.jpg','forgottenwar002T.jpg','forgottenwar011T.jpg','forgottenwar003T.jpg','forgottenwar012T.jpg','forgottenwar004T.jpg','forgottenwar013T.jpg','forgottenwar005T.jpg','forgottenwar014T.jpg','forgottenwar006T.jpg','forgottenwar015T.jpg','forgottenwar007T.jpg','forgottenwar016T.jpg','forgottenwar008T.jpg','forgottenwar017T.jpg','forgottenwar009T.jpg','','','','');
ImageThumbSource[7] = new Array('','roma008T.jpg','roma001T.jpg','roma009T.jpg','roma002T.jpg','roma010T.jpg','roma003T.jpg','roma011T.jpg','roma004T.jpg','roma012T.jpg','roma005T.jpg','','roma006T.jpg','','roma007T.jpg','','');
ImageThumbSource[8] = new Array('','kurcenter007T.jpg','kurcenter001T.jpg','kurcenter008T.jpg','kurcenter002T.jpg','kurcenter009T.jpg','kurcenter003T.jpg','kurcenter010T.jpg','kurcenter004T.jpg','','kurcenter005T.jpg','','kurcenter006T.jpg','','','','');
ImageThumbSource[9] = new Array('','windsurfing007T.jpg','windsurfing001T.jpg','windsurfing008T.jpg','windsurfing002T.jpg','','windsurfing003T.jpg','','windsurfing004T.jpg','','windsurfing005T.jpg','','windsurfing006T.jpg','','','','');
ImageThumbSource[10] = new Array('','','homehelp001T.jpg','','homehelp002T.jpg','','homehelp003T.jpg','','homehelp004T.jpg','','homehelp005T.jpg','','homehelp006T.jpg','','homehelp007T.jpg','','');
ImageThumbSource[11] = new Array('','roskilde007T.jpg','roskilde001T.jpg','roskilde008T.jpg','roskilde002T.jpg','roskilde006T.jpg','roskilde005T.jpg','','roskilde004T.jpg','','roskilde003T.jpg','','');
ImageThumbSource[12] = new Array('','','downhill001T.jpg','','downhill002T.jpg','','downhill003T.jpg','','downhill004T.jpg','','downhill005T.jpg','','');
ImageThumbSource[13] = new Array('','McKinley008T.jpg','McKinley001T.jpg','McKinley009T.jpg','McKinley002T.jpg','McKinley010T.jpg','McKinley003T.jpg','McKinley011T.jpg','McKinley004T.jpg','McKinley012T.jpg','McKinley005T.jpg','McKinley013T.jpg','McKinley006T.jpg','McKinley014T.jpg','McKinley007T.jpg','','');
ImageRef =  new MakeArray(14); 
ImageRef[0] = new Array('wildfires01','wildfires07','wildfires02','wildfires08','wildfires03','wildfires09','wildfires04','wildfires10','wildfires05','wildfires11','wildfires06','wildfires12','');
ImageRef[1] = new Array('behindbars001','behindbars011','behindbars002','behindbars012','behindbars003','behindbars013','behindbars004','behindbars014','behindbars005','behindbars015','behindbars006','behindbars016','behindbars007','behindbars017','behindbars008','behindbars018','behindbars009','behindbars019','behindbars010','behindbars020','');
ImageRef[2] = new Array('','','01','','02','','03','','04','','05','','06','','07','','08','','','','');
ImageRef[3] = new Array('','songhua013','songhua001','songhua014','songhua002','songhua015','songhua003','songhua016','songhua004','songhua017','songhua008','songhua018','songhua005','songhua019','songhua007','songhua020','songhua006','songhua021','songhua009','songhua022','songhua010','songhua023','songhua011','songhua024','songhua012','songhua025','','','');
ImageRef[4] = new Array('','leifeng008','leifeng001','leifeng009','leifeng002','leifeng011','leifeng003','leifeng010','leifeng004','leifeng012','leifeng005','','leifeng006','','leifeng007','','');
ImageRef[5] = new Array('','007','002','008','001','011','003','010','004','012','005','','009','','006','','');
ImageRef[6] = new Array('forgottenwar001','forgottenwar010','forgottenwar002','forgottenwar011','forgottenwar003','forgottenwar012','forgottenwar004','forgottenwar013','forgottenwar005','forgottenwar014','forgottenwar006','forgottenwar015','forgottenwar007','forgottenwar016','forgottenwar008','forgottenwar017','forgottenwar009','','','','');
ImageRef[7] = new Array('','roma008','roma001','roma009','roma002','roma010','roma003','roma011','roma004','roma012','roma005','','roma006','','roma007','','');
ImageRef[8] = new Array('','kurcenter007','kurcenter001','kurcenter008','kurcenter002','kurcenter009','kurcenter003','kurcenter010','kurcenter004','','kurcenter005','','kurcenter006','','','','');
ImageRef[9] = new Array('','windsurfing007','windsurfing001','windsurfing008','windsurfing002','','windsurfing003','','windsurfing004','','windsurfing005','','windsurfing006','','','','');
ImageRef[10] = new Array('','','homehelp001','','homehelp002','','homehelp003','','homehelp004','','homehelp005','','homehelp006','','homehelp007','','');
ImageRef[11] = new Array('','roskilde007','roskilde001','roskilde008','roskilde002','roskilde006','roskilde005','','roskilde004','','roskilde003','','');
ImageRef[12] = new Array('','','downhill001','','downhill002','','downhill003','','downhill004','','downhill005','','');
ImageRef[13] = new Array('','McKinley008','McKinley001','McKinley009','McKinley002','McKinley010','McKinley003','McKinley011','McKinley004','McKinley012','McKinley005','McKinley013','McKinley006','McKinley014','McKinley007','','');
ImageText =  new MakeArray(14); 
ImageText[0] = new Array('','','','','','','','','','','','','');
ImageText[1] = new Array('','','','','','','','','','','','','','','','','','','','','');
ImageText[2] = new Array('','','Nine year old Lena Kuznnetsova is practising hard 6 days a week at the CSKA training facilities.','','Father Yuri is checking the equipment while Katya is watching old tennis classics.','','14 year old Katya firmly believes she will be able to play in the big international tournaments.','','Lena looses a test match at CSKAs course in Peschanaya Ploshad, where change of dress is outside.','','A nervous Katya and a few class mates are waiting their turn for the exam in Geography.','','Katya Pushkareva is warming up before a match in a local tournament outside Moscow.','','Katyas mother Ludmilla is preparing Katyas favorite racket before the big tournament.','','15 year old Olga Schetinina moved to Moscow from Chelyabinsk in the Ural Mountains to play tennis.','','','','');
ImageText[3] = new Array('','','Breakneck economic growth over the past two decades has increased pollution in Chinas rivers.','','Chemical factories disgorge wastewater into Songhua River which is black and clotted with debris.','A local fisherman sports the days catch in af plastic bag along the Songhua River.','','','','','Locals hope that the government will finally have to take the water pollution seriously.','','','','A member of Jilin Swimmers Club takes an early morning swim in the Songhua River.','A pipe funnels wastewater from a paper factory directly into the Songhua River.','','','','','','','','','','','','','');
ImageText[4] = new Array('','','Water tests show that five sites in the village contained fluoride concentrations at lethal levels.','','Nine year old Li suffers telltale signs of skeletal flourosis, a syndrome caused by polluted water.','','','','The water is laced with the same toxins that killed Zhangs mother and severely stunted his growth.','','Qing Ren Cao and his assistant takes a closer look at some x-rays from a villagers brittle bones.','','Jing Quan Alcohol agreed to provide free tap water to those living within 60 meters of the factory.','','Zhao can barely work in her restaurant and any touch but a massage from her husband is agonizing.','','');
ImageText[5] = new Array('','','A child is arriving early at the nightcommuter sleeping center RUFOU in Gulu, Northern Uganda.','','Frightened young nightcommuters are queeing up outside RUFOU sleeping center in Gulu.','','','','A child nightcommuter have found his spot at the sleeping center, where he is sleeping every night.','At 6 am thousands of children are starting the long walk back to their villages in the countryside.','Former child soldiers and sexslaves can stay up to 3 months at the Shelter GUSCO in Gulu.','','','','A child is playing in the school yard of a closed down school in Lira in Northern Uganda.','','');
ImageText[6] = new Array('','','','','','','','','','','','','','','','','','','','','');
ImageText[7] = new Array('','','','','','','','','','','','','','','','','');
ImageText[8] = new Array('','','','','','','','','','','','','','','','','');
ImageText[9] = new Array('','','','','','','','','','','','','','','','','');
ImageText[10] = new Array('','','','','','','','','','','','','','','','','');
ImageText[11] = new Array('','','','','','','','','','','','','');
ImageText[12] = new Array('','','','','','','','','','','','','');
ImageText[13] = new Array('','','','','','','','','','','','','','','','','');
var iOrderMethod = 1; 
 
var nMaxBasketItems = 9; 
var nBasketItems    = 0; 
var iBasketIndex    = -1; 
BasketImgID  = new MakeArray(nMaxBasketItems); 
BasketImgSrc  = new MakeArray(nMaxBasketItems); 
BasketImgRef  = new MakeArray(nMaxBasketItems); 
BasketImgIdx  = new MakeArray(nMaxBasketItems); 
var strBuyImgDir = 'user_ChAl'; 
var strBuyPhotographer = 'Christian Als';  
var strBuyCustomName = ''; 
var strBuyCustomAddr = ''; 
var strBuyCustomMail = ''; 
var strBuyCustomTele = ''; 
var strBuyCustomNote = ''; 
var strBuyOrderDir = 'user_ChAl'; 
var strBuyOrderMail = 'info@christianals.com';     
var strBuyOrderLink = '';     
var strBuyOrderLine = ''; 

function SetReady () {
  bReady = true; 
  HideSection ('ProgressBarArea'); 
  HideSection ('IntroImageArea'); 
  ShowSection ('ThumbScrollArea'); 
  ShowSection ('ThumbArea'); 
  ShowSection ('Cat0'); 
  ShowSection ('SubMenuArea'); 
  ShowSection ('SubMenuPHOTOS'); 
  ShowSection ('MenuScrollArea'); 
  ShowSection ('ImageArea'); 
  ShowSection ('ImageTextArea'); 
  ShowSection ('ImageText'); 
  ShowSection ('ImageTextScrollArea'); 
  ShowSection ('InfoArea'); 
  ShowSection ('InfoTextArea'); 
  ShowSection (strInfo); 
  ShowSection ('InfoTextScrollArea'); 
  var wndo = new dw_scrollObj ('ThumbArea', 'Cat0'); 
  wndo.setUpScrollbar ('ThumbScrollDragbar', 'ThumbScrollTrack', 'h', 1, 1); 
  wndo = new dw_scrollObj ('SubMenuArea', 'SubMenuPHOTOS'); 
  wndo.setUpScrollbar ('MenuScrollDragbar', 'MenuScrollTrack', 'v', 1, 1); 
  wndo = new dw_scrollObj ('ImageTextArea', 'ImageText'); 
  wndo.setUpScrollbar ('ImageTextScrollDragbar', 'ImageTextScrollTrack', 'v', 1, 1); 
  wndo = new dw_scrollObj ('InfoTextArea', 'Info0'); 
  wndo.setUpScrollbar ('InfoTextScrollDragbar', 'InfoTextScrollTrack', 'v', 1, 1); 
  PerformMenu ('START'); 
  var strUrl = document.URL; 
  var iArticle = -1; 
  var iTheme   = -1; 
  var ipos = strUrl.indexOf('?'); 
  var nc   = strUrl.length; 
  while (ipos > 0 && ipos < nc) { 
    var jpos = strUrl.indexOf('=', ipos); 
    if (jpos > 0) { 
      var kpos = strUrl.indexOf('&', jpos); 
      if (kpos <= 0) kpos = nc; 
      var strID  = strUrl.substring (ipos+1, jpos); 
      var strVal = strUrl.substring (jpos+1, kpos); 
      strID  = strID.toLowerCase(); 
      strVal = strVal.toLowerCase(); 
      if (strID == 'article') { 
        for (i = 0; i < InfoID.length; i++) { 
          if (strVal == InfoID[i]) iArticle = i; 
        } 
      } 
      if (strID == 'theme') { 
        for (i = 0; i < CatID.length; i++) { 
          if (strVal == CatID[i]) iTheme = i; 
        } 
      } 
      ipos = kpos; 
    } 
    else ipos = -1; 
  } 
  if (iTheme >= 0) { 
    iCurMenuPHOTO = iTheme; 
     PerformMenu ('PHOTOS'); 
  } 
  else if (iArticle >= 0) { 
    iCurMenuINFO = iArticle; 
     PerformMenu ('INFO'); 
  } 
  else {
    PerformMenu ('PHOTOS'); 
  } 
} 

function CheckBasket() { 
  if (iCheckBasket > 0 && nBasketItems > 0) { 
    var strMess = 'You have ' + nBasketItems + ' photos in your basket'; 
    return strMess; 
  } 
  iCheckBasket = 1; 
} 

function UnCheckBasket() { 
  iCheckBasket = 0; 
} 

function SelectedText() { 
  document.selection.empty();
} 

function PerformMenu (id) {
  if (!bReady) return; 
  if (id == 'START') {  
    strMainMenu = id; 
    HideSection ('IntroImageArea'); 
    HideSection ('IDArea'); 
    ShowSection ('FuncArea'); 
    ShowSection ('MenuArea'); 
    ShowSection ('SubMenuArea'); 
    ShowSection ('ImageArea'); 
    ShowSection ('ImageTextArea'); 
    ShowSection ('ThumbArea'); 
    for (var i = 0; i < nMaxBasketItems; i++) { 
      strName = 'BasketImage' + i; 
      BasketImgIdx[i] = FindImage (strName); 
    } 
    ShowImage (0,0,0); 
    strCurImgID = '0_0'; 
  } 
  else if (id == 'PHOTOS') { 
    strMainMenu = id; 
    ShowSection ('SubMenuArea'); 
    ShowSubMenu ('PHOTOS'); 
    HideSection ('InfoBannerArea'); 
    MarkMenu   ('PHOTOS'); 
    UnmarkMenu ('INFO'  ); 
    HideSection ('InfoArea'); 
    ShowSection ('ThumbArea'); 
    ShowSection ('ImageArea'); 
    ShowSection ('ImageTextArea'); 
    ShowSubMenuPHOTO (iCurMenuPHOTO); 
    UnmarkFunc ('FULLSIZE'); 
    ShowOrder(); 
  } 
  else if (id == 'INFO') {  
    strMainMenu = id; 
    ShowSection ('SubMenuArea'); 
    ShowSubMenu ('INFO'); 
    ShowSection ('InfoBannerArea'); 
    MarkMenu   ('INFO'  ); 
    UnmarkMenu ('PHOTOS'); 
    HideSection ('BasketStrip'); 
    HideSection ('ThumbArea'); 
    HideSection ('ImageArea'); 
    HideSection ('ImageTextArea'); 
    ShowSection ('InfoArea'); 
    ShowSubMenuINFO (iCurMenuINFO); 
    DimMenu('FULLSIZE'); 
    ShowOrder(); 
  } 
  else if (id == 'FULLSIZE') { 
    urchinTracker('/Gallery/Fullsize');
    NewImageWindow(); 
  } 
  else if (id == 'PORTAL') { 
    document.location = '../Index.html'; 
  } 
  else if (id == 'CATALOG') { 
    urchinTracker('/Gallery/GalleryCatalog');
    win = window.open ("Catalog_ChAl_English.pdf", "", "menubar=1,toolbar=0,resizable=1,scrollbars=1"); 
  } 
  else if (id == 'PRINT') { 
    PrintPage ();
  } 
  else if (id == 'ADDORDER') { 
    if (strMainMenu == 'PHOTOS') { 
      AddCurImageToBasket(); 
      ShowOrder(); 
    } 
  } 
  else if (id == 'REMORDER') { 
    if (strMainMenu == 'PHOTOS') { 
      RemoveFromBasket(); 
      ShowOrder(); 
    } 
  } 
  else if (id == 'CLRORDER') { 
    if (strMainMenu == 'PHOTOS') { 
      ClearBasket(); 
      ShowOrder(); 
    } 
  } 
  else if (id == 'DOORDER') { 
    urchinTracker('/Gallery/Order');
    if (nBasketItems > 0) {
      BuyBasketPopup(); 
    } 
  } 
} 

function ShowOrderLink () { 
  var win = window.open ("../BuyLink.html", "", "left=100,top=100,directories=0,location=0,menubar=1,resizable=1,scrollbars=1,status=0,toolbar=0,width=500,height=500");
} 

function ShowOrder () {
  if (strMainMenu == 'PHOTOS') { 
    if (nBasketItems < nMaxBasketItems) UnmarkFunc ('ADDORDER'); 
    else                                DimMenu    ('ADDORDER'); 
    if (nBasketItems > 0) UnmarkFunc ('CLRORDER'); 
    else                  DimMenu    ('CLRORDER'); 
    if (nBasketItems > 0) UnmarkFunc ('DOORDER'); 
    else                  DimMenu    ('DOORDER'); 
    if (nBasketItems > 0 && iBasketIndex >= 0) UnmarkFunc ('REMORDER'); 
    else                                       DimMenu    ('REMORDER'); 
    if (nBasketItems > 0) ShowSection ('ImageBasketArea'); 
    else                  HideSection ('ImageBasketArea'); 
  } 
  if (strMainMenu == 'INFO') { 
    DimMenu ('ADDORDER'); 
    DimMenu ('REMORDER'); 
    DimMenu ('CLRORDER'); 
    if (nBasketItems > 0) UnmarkFunc ('DOORDER'); 
    else                  DimMenu    ('DOORDER'); 
    HideSection ('ImageBasketArea'); 
  } 
} 

function ImageIsLoaded () { 
  if(bReady) return; 
  nImagesLoaded++; 
  UpdateImageProgress(); 
  if (nImagesLoaded == nImagesTotal - 3) SetReady();
} 

function UpdateImageProgress () {
  if (nImagesTotal == 0) return; 
  var progress = parseFloat(nImagesLoaded) / parseFloat(nImagesTotal); 
  m = document.getElementById('ProgressBarArea'); 
  progress *= 471; 
  progress += 5; 
  var src = '<div style="position:absolute;left:0px;width:' + parseInt(progress) + 'px;height:100%;background-color:#C6C6C6;">'; 
  src += '</div>' 
  if (m) m.innerHTML = src; 
} 

function NoAction () {
} 

function InitThumbScroll(dir) { 
  dw_scrollObj.initScroll('ThumbArea', dir); 
} 

function StopThumbScroll() { 
  dw_scrollObj.stopScroll('ThumbArea'); 
} 

function InitMenuScroll(dir) { 
  dw_scrollObj.initScroll('SubMenuArea', dir); 
} 

function StopMenuScroll() { 
  dw_scrollObj.stopScroll('SubMenuArea'); 
} 

function InitImageTextScroll(dir) { 
  dw_scrollObj.initScroll('ImageTextArea', dir); 
} 

function StopImageTextScroll() { 
  dw_scrollObj.stopScroll('ImageTextArea'); 
} 

function InitInfoTextScroll(dir) { 
  dw_scrollObj.initScroll('InfoTextArea', dir); 
} 

function StopInfoTextScroll() { 
  dw_scrollObj.stopScroll('InfoTextArea'); 
} 
 

function MakeArray(n) { 
 this.length = n; 
 for (var i = 0; i < n; i++) this[i] = 0; 
 return this; 
} 
 

function MarkMenu (id) {
  MoveFocus();
  if (id == '') return; 
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) document.images[index].className='MenuSquareSelected'; 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuTextSelected'; 
} 

function MouseoverMenu (id) {
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) { 
    if (document.images[index].className == 'MenuSquareSelected') return; 
    if (document.images[index].className == 'MenuSquareDimmed'  ) return; 
    document.images[index].className='MenuSquareMouseover'; 
  } 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuTextMouseover'; 
} 

function MouseoutMenu (id) {
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) { 
    if (document.images[index].className != 'MenuSquareMouseover') return; 
    document.images[index].className='MenuSquare'; 
  } 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuText'; 
} 

function MouseoverFunc (id) {
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) { 
    if (document.images[index].className == 'MenuSquareSelected') return; 
    if (document.images[index].className == 'MenuSquareDimmed'  ) return; 
    document.images[index].className='MenuSquareMouseover'; 
  } 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuTextMouseover'; 
} 

function MouseoutFunc (id) {
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) { 
    if (document.images[index].className != 'MenuSquareMouseover') return; 
    document.images[index].className='FuncSquare'; 
  } 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuText'; 
} 

function UnmarkMenu (id) {
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) document.images[index].className='MenuSquare'; 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuText'; 
} 

function UnmarkFunc (id) {
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) document.images[index].className='FuncSquare'; 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuText'; 
} 

function DimMenu (id) {
  strName = 'MI' + id; 
  index = FindImage (strName); 
  if (index >= 0) document.images[index].className='MenuSquareDimmed'; 
  strName = 'MT' + id; 
  index = FindAnchor (strName); 
  if (index >= 0) document.anchors[index].className='MenuTextDimmed'; 
} 

function ShowSubMenuPHOTO (icat) {
  if (!bReady) return; 
  UnmarkMenu ('SP' + iCurMenuPHOTO); 
  MarkMenu   ('SP' + icat); 
  iCurMenuPHOTO = icat; 
  ShowTheme (icat); 
} 

function ShowSubMenuINFO (icat) {
  if (!bReady) return; 
  UnmarkMenu ('SI' + iCurMenuINFO); 
  MarkMenu   ('SI' + icat); 
  iCurMenuINFO = icat; 
  ShowInfo (icat); 
} 

function ShowSubMenu (id) {
  if (!bReady) return; 
  HideSection (strSubMenu); 
  strSubMenu = 'SubMenu' + id; 
  ShowSection (strSubMenu); 
  var layer = document.getElementById(strSubMenu); 
  var ylayer = layer ? layer.offsetHeight : 0;
  var yarea  = 132; 
  ShowSection ('MenuScrollArea'); 
  dw_scrollObj.loadLayer ('SubMenuArea', strSubMenu); 
  if (ylayer <= yarea) HideSection ('MenuScrollArea'); 
} 

function ShowTheme (icat) {
  if (!bReady) return; 
  HideSection (strTheme); 
  strTheme = 'Cat' + icat; 
  ShowSection (strTheme); 
  ShowInfoTitle (CatNames[icat]); 
  if (icat >= 0) { 
    nImages = nCatImages[icat]; 
    if (nImages > 16) ShowSection('ThumbScrollArea'); 
    else              HideSection('ThumbScrollArea'); 
    dw_scrollObj.loadLayer ('ThumbArea', strTheme); 
    strCurImgID = '' + icat + '_' + CurCatImg[icat];
    strLastImgID = strCurImgID;
    ShowImage (icat, CurCatImg[icat], 1);
  } 
  else { 
    HideSection('ThumbScrollArea'); 
    ShowImage (icat, 0, 1);
    strCurImgID = '';
    strLastImgID = strCurImgID;
  } 
} 

function ShowInfo (info) {
  HideSection('ThumbScrollArea'); 
  HideSection (strInfo); 
  ShowInfoTitle (InfoNames[info]); 
  strInfo = 'Info' + info; 
  ShowSection (strInfo); 
  var area = document.getElementById('InfoTextArea'); 
  if (area) area.style.width = '634px'; 
  var layer = document.getElementById(strInfo); 
  if (layer) layer.style.width = '634px'; 
  var yarea  = 471; 
  var ylayer = layer ? layer.offsetHeight : 0;
  ShowSection ('InfoTextScrollArea'); 
  dw_scrollObj.loadLayer ('InfoTextArea', strInfo); 
  if (ylayer > yarea) { 
    area.style.width = '612px'; 
    layer.style.width = '612px'; 
  } 
  else { 
    HideSection ('InfoTextScrollArea'); 
  } 
} 

function GetThumbSource(id) { 
  var img  = -1; 
  var index = id.indexOf('_'); 
  if (index > 0) { 
    var str = id.substring(0,index); 
    var icat = parseInt (str); 
    str = id.substring(index+1,id.length); 
    var img = parseInt (str); 
    if (img >= 0) return ImageThumbSource[icat][img]; 
  } 
  return ''; 
} 
 

function GetImageSource(id) { 
  var img  = -1; 
  var index = id.indexOf('_'); 
  if (index > 0) { 
    var str = id.substring(0,index); 
    var icat = parseInt (str); 
    str = id.substring(index+1,id.length); 
    var img = parseInt (str); 
    if (img >= 0) return ImageSource[icat][img]; 
  } 
  return ''; 
} 
 

function GetImageRef(id) { 
  var img  = -1; 
  var index = id.indexOf('_'); 
  if (index > 0) { 
    var str = id.substring(0,index); 
    var icat = parseInt (str); 
    str = id.substring(index+1,id.length); 
    var img = parseInt (str); 
    if (img >= 0) return ImageRef[icat][img]; 
  } 
  return GetImageSource(id); 
} 
 

function FindAnchor (name) {
  if (document.anchors) { 
    for (i = 0; i < document.anchors.length; i++) { 
      if (document.anchors[i].name == name) return i; 
      }; 
  } 
  return -1; 
} 

function FindImage (name) {
  if (document.images) { 
    for (i = 0; i < document.images.length; i++) { 
      if (document.images[i].name == name) return i; 
      }; 
  } 
  return -1; 
} 

function SelectThumbImage (id) {
  strName = 'T' + strCurImgID; 
  index = FindImage (strName); 
  if (index >= 0) document.images[index].className='ThumbImage'; 
  strName = 'T' + id; 
  index = FindImage (strName); 
  if (index >= 0) document.images[index].className='ThumbImageSelect'; 
  strCurImgID = id; 
} 

function Replace (strText, strFrom, strTo) {
  var strNow = strText; 
  var ipos = strText.indexOf(strFrom); 
  if (ipos >= 0) { 
    strNow = strText.substring(0, ipos); 
    strNow += strTo; 
    strNow += strText.substring(ipos + strFrom.length, strText.length); 
  } 
  return strNow; 
} 

function PlaceSection (id, pos) {
  if (document.getElementById && document.createTextNode) { 
    var m = document.getElementById(id); 
    if (m) m.style.top = pos; 
  } 
} 

function ShowSection (id) {
  if (document.getElementById && document.createTextNode) { 
    var m = document.getElementById(id); 
    if (m) m.style.display="block"; 
  } 
} 

function HideSection (id) {
  if (document.getElementById && document.createTextNode) { 
    var m = document.getElementById(id); 
    if (m) m.style.display="none"; 
  } 
} 

function  ShowContent (id) {
  if (!bReady) return; 
  HideSection (strContent); 
  strContent = id; 
  ShowSection (strContent); 
} 

function NewImageWindow() {
  var strImage = GetImageSource(strCurImgID); 
  if (strImage.length <= 0) return; 
  win = window.open ("", "", "fullscreen=yes");
  win.document.open ();
  win.document.write ('<html>');
  win.document.write ('<head>');
  win.document.write ('<title>Image: ' + strImage + '</title>');
  win.document.write ('<link rel="stylesheet" type="text/css" href="../PhotoSite.css" />');
  win.document.write ('<script type="text/Javascript">');
  win.document.write ('var color = 6; ');
  win.document.write ('function ChangeColor(idir) { '); 
  win.document.write ('  color += idir; '); 
  win.document.write ('  if (color  > 8) color = 8; ');
  win.document.write ('  if (color  < 0) color = 0; ');
  win.document.write ('  if (color == 0) document.body.style.backgroundColor="#000000"; '); 
  win.document.write ('  if (color == 1) document.body.style.backgroundColor="#202020"; '); 
  win.document.write ('  if (color == 2) document.body.style.backgroundColor="#404040"; '); 
  win.document.write ('  if (color == 3) document.body.style.backgroundColor="#606060"; '); 
  win.document.write ('  if (color == 4) document.body.style.backgroundColor="#808080"; '); 
  win.document.write ('  if (color == 5) document.body.style.backgroundColor="#A0A0A0"; '); 
  win.document.write ('  if (color == 6) document.body.style.backgroundColor="#C0C0C0"; '); 
  win.document.write ('  if (color == 7) document.body.style.backgroundColor="#E0E0E0"; '); 
  win.document.write ('  if (color == 8) document.body.style.backgroundColor="#FFFFFF"; '); 
  win.document.write ('} '); 
  win.document.write ('function ChangeColorX() { '); 
  win.document.write ('  color++; '); 
  win.document.write ('  if (color  > 8) color = 0; ');
  win.document.write ('  if (color == 0) document.body.style.backgroundColor="#000000"; '); 
  win.document.write ('  if (color == 1) document.body.style.backgroundColor="#202020"; '); 
  win.document.write ('  if (color == 2) document.body.style.backgroundColor="#404040"; '); 
  win.document.write ('  if (color == 3) document.body.style.backgroundColor="#606060"; '); 
  win.document.write ('  if (color == 4) document.body.style.backgroundColor="#808080"; '); 
  win.document.write ('  if (color == 5) document.body.style.backgroundColor="#A0A0A0"; '); 
  win.document.write ('  if (color == 6) document.body.style.backgroundColor="#C0C0C0"; '); 
  win.document.write ('  if (color == 7) document.body.style.backgroundColor="#E0E0E0"; '); 
  win.document.write ('  if (color == 8) document.body.style.backgroundColor="#FFFFFF"; '); 
  win.document.write ('} '); 
  win.document.write ('</sc' + 'ript>'); 
  win.document.write ('</head>');
  win.document.write ('<body onLoad="ChangeColor(0)">'); 
  win.document.write ('<table width="100%" height="100%" style="text-align:center"><tr><td valign="middle">'); 
  win.document.write ('<img src="' + strImage + '" border="0" />');
  win.document.write ('</td></tr></table>'); 
  win.document.write ('<div style="position:absolute; bottom:20px; left:30px; text-align:left;">'); 
  win.document.write ('<div class="MenuLine" onmousedown="ChangeColorX()">'); 
  win.document.write ('<img src="../blank.gif" class="MenuSquare" />');
  win.document.write ('<span class="MenuText">Background tone</span>'); 
  win.document.write ('</div>'); 
  win.document.write ('<div class="MenuLine" onmousedown="window.close()">'); 
  win.document.write ('<img src="../blank.gif" class="MenuSquare" />');
  win.document.write ('<span class="MenuText">Close window</span>'); 
  win.document.write ('</div>'); 
  win.document.write ('</div>'); 
  win.document.write ('</body>'); 
  win.document.write ('</html>'); 
  win.document.close ();
} 

function PrintPage() {
  var strID = ''; 
  if (strMainMenu == 'PHOTOS') strID = strCurImgID; 
  if (strMainMenu == 'INFO'  ) strID = InfoID[iCurMenuINFO]; 
  if (strID == '') return; 
  var strFile  = '';
  var strTitle = '';
  var strText  = '';
  if (strMainMenu == 'PHOTOS') {; 
    strTitle = CatNames[iCurMenuPHOTO]; 
    strFile = GetImageSource(strID);
    if (strFile == '') return; 
    if (document.getElementById && document.createTextNode) { 
      var mt= document.getElementById('ImageText'); 
      if (mt) strText = mt.innerHTML;
    } 
  } 
  if (strMainMenu == 'INFO') {; 
    if (document.getElementById && document.createTextNode) { 
      var mt= document.getElementById(strInfo); 
      if (mt) strText = mt.innerHTML;
      strTitle = InfoNames[iCurMenuINFO];
    } 
  } 
  win = window.open ("", "", "left=100,top=100,toolbar=1,menubar=1,scrollbars=1,resizeable=1,width=700,height=600");
  win.document.open ();
  win.document.write ('<html>\n');
  win.document.write ('<head>\n');
  win.document.write ('<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />\n');
  win.document.write ('<link rel="stylesheet" type="text/css" href="../PhotoSitePopupPrint.css" />\n');
  win.document.write ('</head>\n');
  win.document.write ('<body onload="window.print()" >\n'); 
  win.document.write ('<div id="mainpage">\n');
  win.document.write ('<div id="LogoArea">\n');
  win.document.write ('<img src="../Logo_gallery.gif" width="100%" />\n'); 
  win.document.write ('</div>\n');
  win.document.write ('<div id="IdentArea">\n');
  win.document.write ('<b>PHOTOMONDO - PHOTOGRAPHY</b><br/><br/>\n'); 
  win.document.write ('<b>Photographer Christian Als</b><br/><br/>\n'); 
  win.document.write ('www.photomondo.dk/ChristianAls <br/>\n'); 
  win.document.write ('info@christianals.com \n'); 
  win.document.write ('</div>\n');
  win.document.write ('<div id="InfoTitleArea">\n');
  win.document.write (strTitle); 
  win.document.write ('</div>\n');
  win.document.write ('<div id="InfoArea">\n');
  if (strMainMenu == 'PHOTOS') {; 
    win.document.write ('<img src="' + strFile + '" />\n'); 
    win.document.write ('<br/>\n');
    win.document.write ('Filename: <i>' + strFile + '</i><br/><br/>\n');
  } 
  win.document.write (strText); 
  win.document.write ('\n</div>\n');
  win.document.write ('\n</div>\n');
  win.document.write ('</body>\n'); 
  win.document.write ('</html>\n'); 
  win.document.close ();
} 

function ShowImage (icat, img, sel) {
  var strText = '';
  var strID = '';
  if (icat >= 0 && img >= 0) { 
    strText += ImageText[icat][img];
    if (strText.length > 0) strText += '<br/><br/>';
    strText += CatText[icat];
    strID = '' + icat + '_' + img; 
    if (sel > 0) { 
      SelectThumbImage (strID); 
      CurCatImg[icat] = img; 
      strCurImgID = strID; 
      strCurImgText = strText; 
    } 
  } 
  strLastImgID = strID; 
  strLastImgText = strText; 
  strNow = 'Img' + strID; 
  ShowContent (strNow); 
  ShowImageText (strLastImgText); 
} 

function ShowInfoTitle (str, color) {
  var area = document.getElementById('InfoTitleArea'); 
  if (area) { 
    area.innerHTML = str; 
    if (color) area.style.color = color; 
    else       area.style.color = 'black'; 
  } 
} 

function ShowImageText (str) {
  var area = document.getElementById('ImageTextArea'); 
  if (area) area.style.width = '145px'; 
  var layer = document.getElementById('ImageText'); 
  if (layer) layer.innerHTML = str; 
  var ylayer = layer ? layer.offsetHeight : 0;
  var yarea  = 310;
  HideSection ('ImageTextScrollArea'); 
  if (ylayer > yarea) { 
    area.style.width = '124px'; 
    ShowSection ('ImageTextScrollArea'); 
    dw_scrollObj.loadLayer ('ImageTextArea', 'ImageText'); 
  }; 
} 

function SetMenuText (id, text, color) { 
  index = FindAnchor ('MT' + id); 
  if (index >= 0) { 
    document.anchors[index].innerHTML = text; 
    if (color) document.anchors[index].style.color = color; 
  } 
} 

function UpdateBasketIcons () { 
} 

function DisplayBasket () { 
  for (var i = 0; i < nMaxBasketItems; i++) { 
    DisplayBasketUnit (i); 
  } 
} 

function DisplayBasketUnit (i) { 
  strName = 'BasketImage' + i; 
  ShowSection (strName); 
  strImgSrc  = GetThumbSource(BasketImgID[i]); 
  if (strImgSrc == '') strImgSrc = '../blank.gif'; 
  var index = FindImage (strName); 
  if (index >= 0) document.images[index].src = strImgSrc; 
} 

function AddCurImageToBasket () { 
  if (strCurImgID.length > 0 && nBasketItems < nMaxBasketItems) { 
    var index = -1; 
    for (var i = nMaxBasketItems - 1; i >= 0; i = i-1) { 
      if (BasketImgID [i] == '') index = i; 
    } 
    if (index >= 0) { 
      BasketImgID [index] = strCurImgID; 
      BasketImgSrc[index] = GetThumbSource(strCurImgID); 
      BasketImgRef[index] = GetImageRef(strCurImgID); 
      nBasketItems++; 
      SelectBasketImage (index); 
      DisplayBasketUnit(index); 
      UpdateBasketIcons(); 
    } 
  } 
} 

function BuyCurBasket () { 
} 

function RemoveFromBasket () { 
  if (iBasketIndex >= 0) { 
    for (var i = iBasketIndex; i < nBasketItems - 1; i++) { 
      BasketImgID [i] = BasketImgID[i+1]; 
      BasketImgSrc[i] = BasketImgSrc[i+1]; 
      BasketImgRef[i] = BasketImgRef[i+1]; 
      DisplayBasketUnit(i); 
    } 
    BasketImgID [nBasketItems-1] = ''; 
    DisplayBasketUnit(nBasketItems-1); 
    nBasketItems = nBasketItems - 1; 
    if (nBasketItems > 0) SelectBasketImage(nBasketItems-1); 
    UpdateBasketIcons(); 
  } 
} 

function ClearBasket () { 
  if (iBasketIndex >= 0) { 
    UnselectBasketImage(); 
  } 
  for (var i = 0; i < nMaxBasketItems; i++) { 
    BasketImgID [i] = ''; 
    DisplayBasketUnit(i); 
  } 
  iBasketIndex = -1; 
  nBasketItems = 0; 
  UpdateBasketIcons(); 
} 

function BuyBasketPopup() {
  if (nBasketItems > 0) { 
    strBuyOrderLine = ''; 
    for (var i = 0; i < nBasketItems; i++) { 
      if (strBuyOrderLine != '') strBuyOrderLine += ', '; 
      strBuyOrderLine += BasketImgRef[i]; 
    } 
    window.open ("../BuyForm.html", "", "left=100,top=100,directories=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,width=530,height=570");
  }
}

function ShowBasketImage (index, sel) {
  if (sel == 0) return; 
  strID = BasketImgID[index]; 
  if (strID == '') return; 
  if (sel > 0) { 
    SelectThumbImage (strID); 
    SelectBasketImage (index); 
  } 
  strNow = 'Img' + strID; 
  ShowContent (strNow); 
  if (sel > 0) UpdateBasketIcons(); 
} 

function SelectBasketImage (i) {
  UnselectBasketImage(); 
  index = BasketImgIdx[i]; 
  if (index >= 0) { 
    document.images[index].className='BasketImageSelect'; 
    iBasketIndex = i; 
  } 
} 

function UnselectBasketImage () {
  for (var i = 0; i < nMaxBasketItems; i++) {
    index = BasketImgIdx[i]; 
    if (index >= 0) document.images[index].className='BasketImage'; 
  } 
  iBasketIndex = -1; 
} 

function ShowSelectedImage () {
  if (strCurImgID == '') return; 
  strNow = 'Img' + strCurImgID; 
  ShowContent (strNow); 
  ShowImageText (strCurImgText); 
  strLastImgID   = strCurImgID; 
  strLastImgText = strCurImgText; 
} 

function ShowLastImage () {
  strNow = 'Img' + strLastImgID; 
  ShowContent (strNow); 
  ShowImageText (strLastImgText); 
} 

function MoveFocus() {
  var move = false; 
  var agent = navigator.userAgent.toLowerCase();
  var is_ie     = (agent.indexOf('msie')  != -1);
  var is_opera  = (agent.indexOf('opera') != -1);
  var is_mac	  = (agent.indexOf('mac')   != -1);
  var is_mac_ie = (is_ie && is_mac);
  var is_win_ie = (is_ie && !is_mac);
  var is_gecko  = (navigator.product == 'Gecko');
  if (is_gecko) move = true; 
  if (move) { 
    var index = FindAnchor ('DummyLink'); 
    if (index >= 0) document.anchors[index].focus(); 
  } 
} 

