  function NewWindow(u,n,w,h,f,p,x,y) {
    var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='scrollbars,width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;

    if(x) {
      window.location=x;
    }

    win=window.open(u,n,s);

    if(win.focus) {
      win.focus();
    }

  }

  function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=/" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  }

  function setCookie2(name, value) {
    document.cookie= name + "=" + escape(value) + "; path=/";
  }

  function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
  }


  function openMenu(a, w) {
    var b = parent.document.getElementById(a+"_sub");
    c = b.style.height.replace('px', '');
    c++;
    c++;
    b.style.height = c+"px";
    if (c >= w) {
      clearInterval ( openMenuId );
      b.style.height = w+"px";
    }
  }

  function closeMenu(a) {
    var b = parent.document.getElementById(a+"_sub");
    c = b.style.height.replace('px', '');
    c = c - 2;
    b.style.height = c+"px";
    if (c <= 2) {
      b.style.height = "1px";
      clearInterval ( closeMenuId );
    }
  }

  function toggle_sub(a, w) {
    var b = parent.document.getElementById(a+"_sub");
    if (b.style.height.replace('px', '') <= 2) {
      openMenuId = setInterval ("openMenu('"+a+"', '"+w+"')", 1);
    } else {
      closeMenuId = setInterval ("closeMenu('"+a+"')", 1);
    }
  }
