// $Id: drupal.js,v 1.22.2.1 2006/05/29 14:23:32 killes Exp $

/**
 * Only enable Javascript functionality if all required features are supported.
 */
function isJsEnabled() {
  if (typeof document.jsEnabled == 'undefined') {
    // Note: ! casts to boolean implicitly.
    document.jsEnabled = !(
     !document.getElementsByTagName ||
     !document.createElement        ||
     !document.createTextNode       ||
     !document.documentElement      ||
     !document.getElementById);
  }
  return document.jsEnabled;
}

// Global Killswitch on the <html> element
if (isJsEnabled()) {
  document.documentElement.className = 'js';
}

/**
 * Make IE's XMLHTTP object accessible through XMLHttpRequest()
 */
if (typeof XMLHttpRequest == 'undefined') {
  XMLHttpRequest = function () {
    var msxmls = ['MSXML3', 'MSXML2', 'Microsoft']
    for (var i=0; i < msxmls.length; i++) {
      try {
        return new ActiveXObject(msxmls[i]+'.XMLHTTP')
      }
      catch (e) { }
    }
    throw new Error("No XML component installed!");
  }
}

/**
 * Creates an HTTP GET request and sends the response to the callback function.
 *
 * Note that dynamic arguments in the URI should be escaped with encodeURIComponent().
 */
function HTTPGet(uri, callbackFunction, callbackParameter) {
  var xmlHttp = new XMLHttpRequest();
  var bAsync = true;
  if (!callbackFunction) {
    bAsync = false;
  }
  xmlHttp.open('GET', uri, bAsync);
  xmlHttp.send(null);

  if (bAsync) {
    if (callbackFunction) {
      xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
          callbackFunction(xmlHttp.responseText, xmlHttp, callbackParameter);
        }
      }
    }
    return xmlHttp;
  }
  else {
    return xmlHttp.responseText;
  }
}

/**
 * Creates an HTTP POST request and sends the response to the callback function
 *
 * Note: passing null or undefined for 'object' makes the request fail in Opera 8.
 *       Pass an empty string instead.
 */
function HTTPPost(uri, callbackFunction, callbackParameter, object) {
  var xmlHttp = new XMLHttpRequest();
  var bAsync = true;
  if (!callbackFunction) {
    bAsync = false;
  }
  xmlHttp.open('POST', uri, bAsync);

  var toSend = '';
  if (typeof object == 'object') {
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    for (var i in object) {
      toSend += (toSend ? '&' : '') + i + '=' + encodeURIComponent(object[i]);
    }
  }
  else {
    toSend = object;
  }
  xmlHttp.send(toSend);

  if (bAsync) {
    if (callbackFunction) {
      xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4) {
          callbackFunction(xmlHttp.responseText, xmlHttp, callbackParameter);
        }
      }
    }
    return xmlHttp;
  }
  else {
    return xmlHttp.responseText;
  }
}

/**
 * Redirects a button's form submission to a hidden iframe and displays the result
 * in a given wrapper. The iframe should contain a call to
 * window.parent.iframeHandler() after submission.
 */
function redirectFormButton(uri, button, handler) {
  // (Re)create an iframe to target.
  createIframe();

  // Trap the button
  button.onmouseover = button.onfocus = function() {
    button.onclick = function() {
      // Prepare variables for use in anonymous function.
      var button = this;
      var action = button.form.action;
      var target = button.form.target;

      // Redirect form submission
      this.form.action = uri;
      this.form.target = 'redirect-target';

      handler.onsubmit();

      // Set iframe handler for later
      window.iframeHandler = function () {
        var iframe = $('redirect-target');
        // Restore form submission
        button.form.action = action;
        button.form.target = target;

        // Get response from iframe body
        try {
          response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;
          // Firefox 1.0.x hack: Remove (corrupted) control characters
          response = response.replace(/[\f\n\r\t]/g, ' ');
          if (window.opera) {
            // Opera-hack: it returns innerHTML sanitized.
            response = response.replace(/&quot;/g, '"');
          }
        }
        catch (e) {
          response = null;
        }

        $('redirect-target').onload = null;
        $('redirect-target').src = 'about:blank';

        response = parseJson(response);
        // Check response code
        if (response.status == 0) {
          handler.onerror(response.data);
          return;
        }
        handler.oncomplete(response.data);
      }

      return true;
    }
  }
  button.onmouseout = button.onblur = function() {
    button.onclick = null;
  }
}

/**
 * Adds a function to the window onload event
 */
function addLoadEvent(func) {
  var oldOnload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  }
  else {
    window.onload = function() {
      oldOnload();
      func();
    }
  }
}

/**
 * Adds a function to a given form's submit event
 */
function addSubmitEvent(form, func) {
  var oldSubmit = form.onsubmit;
  if (typeof oldSubmit != 'function') {
    form.onsubmit = func;
  }
  else {
    form.onsubmit = function() {
      return oldSubmit() && func();
    }
  }
}

/**
 * Retrieves the absolute position of an element on the screen
 */
function absolutePosition(el) {
  var sLeft = 0, sTop = 0;
  var isDiv = /^div$/i.test(el.tagName);
  if (isDiv && el.scrollLeft) {
    sLeft = el.scrollLeft;
  }
  if (isDiv && el.scrollTop) {
    sTop = el.scrollTop;
  }
  var r = { x: el.offsetLeft - sLeft, y: el.offsetTop - sTop };
  if (el.offsetParent) {
    var tmp = absolutePosition(el.offsetParent);
    r.x += tmp.x;
    r.y += tmp.y;
  }
  return r;
};

function dimensions(el) {
  return { width: el.offsetWidth, height: el.offsetHeight };
}

/**
 * Returns true if an element has a specified class name
 */
function hasClass(node, className) {
  if (node.className == className) {
    return true;
  }
  var reg = new RegExp('(^| )'+ className +'($| )')
  if (reg.test(node.className)) {
    return true;
  }
  return false;
}

/**
 * Adds a class name to an element
 */
function addClass(node, className) {
  if (hasClass(node, className)) {
    return false;
  }
  node.className += ' '+ className;
  return true;
}

/**
 * Removes a class name from an element
 */
function removeClass(node, className) {
  if (!hasClass(node, className)) {
    return false;
  }
  // Replaces words surrounded with whitespace or at a string border with a space. Prevents multiple class names from being glued together.
  node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className);
  return true;
}

/**
 * Toggles a class name on or off for an element
 */
function toggleClass(node, className) {
  if (!removeClass(node, className) && !addClass(node, className)) {
    return false;
  }
  return true;
}

/**
 * Emulate PHP's ereg_replace function in javascript
 */
function eregReplace(search, replace, subject) {
  return subject.replace(new RegExp(search,'g'), replace);
}

/**
 * Removes an element from the page
 */
function removeNode(node) {
  if (typeof node == 'string') {
    node = $(node);
  }
  if (node && node.parentNode) {
    return node.parentNode.removeChild(node);
  }
  else {
    return false;
  }
}

/**
 * Prevents an event from propagating.
 */
function stopEvent(event) {
  if (event.preventDefault) {
    event.preventDefault();
    event.stopPropagation();
  }
  else {
    event.returnValue = false;
    event.cancelBubble = true;
  }
}

/**
 * Parse a JSON response.
 *
 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
 */
function parseJson(data) {
  if (data.substring(0,1) != '{') {
    return { status: 0, data: data.length ? data : 'Unspecified error' };
  }
  return eval('(' + data + ');');
}

/**
 * Create an invisible iframe for form submissions.
 */
function createIframe() {
  // Delete any previous iframe
  deleteIframe();
  // Note: some browsers require the literal name/id attributes on the tag,
  // some want them set through JS. We do both.
  window.iframeHandler = function () {};
  var div = document.createElement('div');
  div.id = 'redirect-holder';
  div.innerHTML = '<iframe name="redirect-target" id="redirect-target" class="redirect" onload="window.iframeHandler();"></iframe>';
  var iframe = div.firstChild;
  with (iframe) {
    name = 'redirect-target';
    setAttribute('name', 'redirect-target');
    id = 'redirect-target';
  }
  with (iframe.style) {
    position = 'absolute';
    height = '1px';
    width = '1px';
    visibility = 'hidden';
  }
  document.body.appendChild(div);
}

/**
 * Delete the invisible iframe for form submissions.
 */
function deleteIframe() {
  var holder = $('redirect-holder');
  if (holder != null) {
    removeNode(holder);
  }
}

/**
 * Wrapper around document.getElementById().
 */
function $(id) {
  return document.getElementById(id);
}


/**
 * Kids.co.il javascript - main page links.
 */
var windowprops = "width=300,height=260,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no";

function opencolor(item) {
        var w=(screen.width)-10;
        var h=(screen.height)-60;
        var name=navigator.appName;
        if (item=="0")
        {
                if (name=="Netscape")
                {
                        window.open("files/train.swf" , "Paint" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }
                else
                {
                        window.open("files/train.swf" , "Paint" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
        else
        {
                if (name=="Netscape")
                {
                        window.open("files/elephant.swf" , "Paint" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }
                else
                {
                        window.open("files/elephant.swf" , "Paint" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
}

function openmath() {
        var w=(screen.width)-10;
       var h=(screen.height)-60;
        var name=navigator.appName;
        if (name=="Netscape")
        {
                window.open("files/mathmain02.swf" , "Math" , "width=800 heigth=800 location=yes menubar=no              toolbar=no directories=no status=no scrollbars=auto resizable=no")
        }
        else
        {
                window.open("files/mathmain02.swf" , "Math" , "width="+w+" height="+h+" top=0 left=0 location=no                                 menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no                               fullscreen=no")
        }
}

function openanim(control){
        var w=(screen.width)-10;
        var h=(screen.height)-60;
        var name=navigator.appName;
        if (control=='0'){
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/chicken.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/chicken.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
        else if (control=='1')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/seasons.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/seasons.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
        else if (control=='2')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/cat.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/cat.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
        else if (control=='3')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/oranges.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/oranges.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
        else if (control=='4')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/balloon.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/balloon.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
        else if (control=='5')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/fish.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/fish.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='6')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/zoo.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/zoo.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='7')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/trip.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/trip.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='8')
        {
                if (name=="Netscape")
                {
                        window.open("files/games/dress/dress.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/games/dress/dress.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='9')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/shopping.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/shopping.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='10')
        {
                if (name=="Netscape")
                {
                        window.open("files/games/puzzles/puzzle1.htm" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/games/puzzles/puzzle1.htm" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }

else if (control=='11')
        {
                if (name=="Netscape")
                {
                        window.open("files/games/catchme/catchme.htm" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/games/catchme/catchme.htm" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='12')
        {
                if (name=="Netscape")
                {
                        window.open("files/games/memory/memory.htm" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/games/memory/memory.htm" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='13')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/stick.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/stick.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='14')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/sea.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/sea.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }

else if (control=='15')
        {
                if (name=="Netscape")
                {
                        window.open("files/games/kidipong/pong.htm" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/games/kidipong/pong.htm" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='16')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/school.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/school.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='17')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstorys/hanuka.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstorys/hanuka.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='18')
        {
                if (name=="Netscape")
                {
                        window.open("files/holidays/purim.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/holidays/purim.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='19')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstory/pesach.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstory/pesach.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='20')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstory/independence.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstory/independence.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='21')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstory/lagbaomer.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstory/lagbaomer.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='22')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstory/shavuot.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstory/shavuot.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='23')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstory/roshashana.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstory/roshashana.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='24')
        {
                if (name=="Netscape")
                {
                        window.open("files/animatedstory/sukkot.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/animatedstory/sukkot.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='25')
        {
                if (name=="Netscape")
                {
                        window.open("files/games/maze.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/games/maze.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='26')
        {
                if (name=="Netscape")
                {
                        window.open("files/games/ball/bouncing_ball.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/games/ball/bouncing_ball.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
		else if (control=='27')
        {
                if (name=="Netscape")
                {
                        window.open("files/holidays/hanuka.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/holidays/hanuka.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
else if (control=='28')
        {
                if (name=="Netscape")
                {
                        window.open("files/holidays/shavuot.swf" , "Animation" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/holidays/shavuot.swf" , "Animation" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
}

function openladder(){
        var w=(screen.width)-10;
        var h=(screen.height)-60;
        var name=navigator.appName;
        if (name=="Netscape")
        {
                window.open("files/games/ladders/ladders.htm" , "Ladders" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
        }
        else
        {
                window.open("files/games/ladders/ladders.htm" , "Ladders" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
        }
}

function openmusic(control) {
        var w=(screen.width)-10;
        var h=(screen.height)-60;
        var name=navigator.appName;
        if (control=='0')
        {
                if (name=="Netscape")
                {
                        window.open("files/organ.swf" , "Organ" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }       
                else
                {
                        window.open("files/organ.swf" , "Organ" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
        else
        {
                if (name=="Netscape")
                {
                        window.open("files/synth.swf" , "Transistor" , "width=800 heigth=800 location=yes menubar=no toolbar=no directories=no status=no scrollbars=auto resizable=no")
                }
                else
                {
                        window.open("files/synth.swf" , "Transistor" , "width="+w+" height="+h+" top=0 left=0 location=no menubar=no toolbar=no directories=no status=no scrollbars=no resizable=no fullscreen=no")
                }
        }
}


/**
 * Kids.co.il - set as homepage.
 **/


function setHomePage(obj){

      var isIE = document.all ? true:false;

      var isNS6 = (document.getElementById && !isIE) ? true:false;

      var isOther = (!isIE && !isNS6);

      var link = document.getElementById('setas');

      var stylesh = '<style type=text/css>'

            +'BODY{ background: #ffffff;'

            +'FONT-FAMILY: Arial, Helvetica, Geneva, sans-serif;'

            +'FONT-SIZE: 12px;'

            +'color: #oooooo;}'

            +'A:link, A:visited, A:active {color:#0000ff;}'

            +'.purplebuttontext{'

            +'COLOR: #000000;'

            +'FONT-WEIGHT: bold;'

            +'FONT-SIZE: 12px;'

            +'LINE-HEIGHT: 12px;'

            +'FONT-FAMILY: Arial, Helvetica, Geneva, sans-serif;'

            +'TEXT-DECORATION: none}'

            +'a.purplebutton{'

            +'padding: 1px 6px 1px 6px;'

            +'border: 2px outset #cccccc;'

            +'background: #eeeeee;'

            +'COLOR: #000000;'

            +'text-decoration: none;'

            +'height: 19px;'

            +'vertical-align: middle;'

            +'}'

            +'a.purplebutton:focus, a.purplebutton:hover{'

            +'border: 2px inset #cccccc;'

            +'vertical-align: middle;'

            +'background: #eeeeee; '

            +'color: #000000;'

            +'text-decoration: none;}'

            +'</style>'; 

var closewin = '<table width="100%"><tr><td class="purplebuttontext" align="left"><a href="#" class="purplebutton" onClick="window.close();">Close window</a></td></tr></table>';

      if(isIE){

            eval("link.style.behavior=\'url(#default#homepage)\';");

            eval("link.setHomePage(\'http://blue.live4all.co.il/~john/drupal/');");

      } 

      // If its Netscape 6, tell user to drag link onto Home button

      else if(isNS6) {

            var win = window.open('','HomePage','width=180,height=80');

            win.document.write(stylesh+'Drag this link <A ondrag="window.close();" HREF="http://blue.live4all.co.il/~john/drupal/">blue.live4all.co.il/~john/drupal<A><br>to a Homepage button <br>to set a homepage'+closewin);

      }

      else {

            var win = window.open('','HomePage','width=180,height=80');

            win.document.write(stylesh+'<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.<p>'+closewin);

      }

}
