  function show(theName) {
    obj = document.getElementById(theName);
    cl = obj.className.replace('hide','show');
    obj.className = cl;
  }

  function hide(theName) {
    obj = document.getElementById(theName);
    cl = obj.className.replace('show','hide');
    obj.className = cl;
  }

  function swapSub(theId) {
    sub = document.getElementById('sub_' + theId);
    mai = document.getElementById('plus_' + theId);
    if (sub.className == 'show') {
      sub.className = 'hide';
      mai.src = 'images/shop/menu_open.gif';
    } else {
      sub.className = 'show';
      mai.src = 'images/shop/menu_close.gif';
    }
  }

  function changePhoto(theId,theNum) {
    for (i = 1; i <= 3 ; i++) {
      img = document.getElementById('img_' + i);
      if (img) img.className = 'photo';
    }
    pho = document.getElementById('photo');
    img = document.getElementById('img_' + theNum);
    mor = document.getElementById('more_photos');
    pho.style.backgroundImage = 'url(images/product/' + theId + '_' + theNum + '.jpg)';
    img.className = 'photo_act';
    mor.className = 'hide';
  }
  
  function swapSize(theId) {
    siz = document.getElementById('size');
    if (siz.value != '' + theId) {
      si = document.getElementById('size_' + theId);
      if (si.className == 'size') si.className = 'size_act';
      else si.className = 'size';
    }
  }

  function selectSize(theId) {
    siz = document.getElementById('size');
    old = siz.value;
    siz.value = theId;
    si = document.getElementById('size_' + old);
    si.className = 'size';
    document.theForm.submit();
  }
  function write_title_swf(title) {
    obj = document.getElementById('title');
    obj.SetVariable('t',title);
    obj = document.getElementById('title_container');
    pos = obj.style.top;
    obj.style.top = pos.replace('-','');
  }
  
  function getScreenWidth() {
    isNetscape = (navigator.appName == "Netscape");
    available = (isNetscape) ? window.innerWidth : document.body.clientWidth;
    return available;
  }
  
  function setHeights(corr) {
    con = document.getElementById('content');
    men = document.getElementById('submenu');
    tex = document.getElementById('text');
    foo = document.getElementById('footer');
    rig = document.getElementById('right');
    default_top = 607;
    if (tex && men) {
      h = Math.max(tex.offsetHeight,men.offsetHeight + 40);
      if (!corr) corr = 0;
      default_height = 300 + corr;
      if (h > 280 - corr) {
        con.style.height = (h - 10) + 'px';
        foo.style.top = (h + 296 - corr) + 'px';
      } else {
        con.style.height = (default_height) + 'px';
        foo.style.top = (default_top) + 'px';
      }
    } else foo.style.top = (default_top - corr) + 'px';
    w = getScreenWidth();
    rig.style.height = Math.round(foo.style.top.replace('px','') - 8) + 'px';
    rig.style.width = Math.round(w - 1000) + 'px';

  }


