document.observe('dom:loaded', function() {  function openInPopup(el, title, options) {    var h = $H({className: "popuphome",                url: el,                title: title,                minimizable: false,                maximizable: false,                draggable: false,                resizable: false,                width: 600,                height: 400,                zIndex: 100});    h = h.merge(options);        var win = new Window(h.toObject());    win.showCenter(true);        return win;  }    /*   * Rounded boxes   */  if ($('boximg')) {    var MAX = 8;    var num = Math.floor(Math.random() * MAX);    $('boximg').select('div.boximg img').each(function(el) {      el.src = "/home_img/" + el.readAttribute('alt') + "-" + num + ".jpg";    });        $('boximg').select('div.boximg').each(function(el) {      var newEl = el.cloneNode(true);      newEl.makePositioned();      newEl.setStyle({top: (-el.getHeight()) + "px"});      newEl.down('img').src = "images/boximg.png";      el.parentNode.appendChild(newEl);    });  }    /*   * Popups   */  $$('.popup').each(function(el) {    var opts;        if (el.hasClassName('big')) {      opts = {width: 700, height: 550};    } else {      opts = {width: 450, height: 200};    }        el.onclick = function() {      openInPopup(el, el.readAttribute('title'), opts);      return false;    };  });    $$('.close a').each(function(el) {    el.onclick = function(e) {      parent.Windows.closeAll();      Event.stop(e);    }  });    /*   * Search boxes   */  $$('form.search').each(function (form) {    var validate_submit = function(form) {      return form.down('input').getValue() != '';    };        Event.observe(form, 'submit', function(e) {      if (!validate_submit(form)) { Event.stop(e); }    });        form.down('.searchbutton').observe('click', function(e) {      if (validate_submit(form)) { form.submit(); }      Event.stop(e);    });  });});