var MenuButtons = new Array ("entrance", "candle", "guestbook", "photo", "multimedia", "newspapers", "events", "mailinglist", "language", "lifestory");

var PButton = new Array(MenuButtons.length);
for (count = 0 ; count < PButton.length ; count++)
{
  PButton[count] = new Image(150,35);
  PButton[count].src = PButtonPath + "/menu/pressed/" + MenuButtons[count] + ".png";
}

function ButtonPress (img,num)
{
  OldSrc = img.src;
  img.src = PButton[num].src;
}

function ButtonRelease (img)
{
  img.src = OldSrc;
}

function DetectLanguage (object)
// Language detection script written by Tsahi Chitin for http://www.eranzoldan.org
// Copyright (C) 2004 by Tsahi Chitin, All rights reserved
// Please leave this copyright notice if used elsewhere
{
  var engchars, hebchars, count, chr;
  
  engchars = 0;
  hebchars = 0;
  
  for (count = 0 ; count <= object.value.length ; count++)
  {
    chr = object.value.charCodeAt (count);
    
    if (chr >= 1488 && chr <= 1514)
      hebchars++;
    else if (chr >= 65 && chr <= 90 || chr >= 97 && chr <= 122)
      engchars++;
  }

  if (hebchars > engchars)
    object.dir = "rtl";
  else if (engchars > hebchars)
    object.dir = "ltr";
  
  return true;
}

function ExternalSiteDisclaimer(lang)
{
  if (lang == "eng")
    return confirm ('You are about to visit an external web-site, which will open in a new browser window.\nPlease understand that we cannot be responsible for their content, security and privacy policy.\n\nDo you wish to proceed?');
  else
    return confirm ('.אתם עומדים לבקר באתר חיצוני, אשר ייפתח בחלון חדש\n.איננו יכולים להיות אחראיים לתוכנו, בטיחותו ומדיניות הפרטיות שלו\n\n?האם ברצונכם להמשיך');
}

function LifeStoryPopup(lang)
{
  if (lang == "eng")
    return confirm ('The presentation will open in a new window. To return to the memorial site, close the presentation window. The presentation is currently available in Hebrew only.\n\nAttention: The initial loading might take a few minutes.');
  else
    return confirm ('.המצגת תיפתח בחלון חדש. לצורך חזרה לאתר, יש לסגור את חלון המצגת\n\n.שים לב: הטעינה הראשונית תיערך מספר דקות');
}

var userAgent = navigator.userAgent.toLowerCase ();
var CanScroll = userAgent.indexOf ("msie") != -1 && userAgent.indexOf ("opera") == -1 || navigator.product == "Gecko";

if (self.location != top.location)
  top.location = self.location;
