/* =========================== */
/* popup windows */
function popup(a,w,h) {
  var sw=screen.availWidth-10;
  var sh=screen.availHeight-28;
  var p="top="+Math.floor(sh/2-h/2)+",left="+Math.floor(sw/2-w/2)+",width="+w+",height="+h+",dependent=yes,menubar=no,toolbar=no,statusbar=no";
  window.open(a.href,a.target,p);
}

/* =========================== */
/* auto image preloading for rollovers */
function autoPreload() {
  var d=document;
  if(d.images){
    d.MM_p=new Array();
    var j=0;
    var i,len=d.images.length;
    var src,slen,match;
    for (i=0;i<len;i++) {
      src=d.images[i].src;
      slen=src.length;
      match=src.substr(slen-4);
      if ('1p.gif'==match) {
        d.MM_p[j]=new Image;
        d.MM_p[j++].src=src.substring(0,slen-4)+'_on.gif';
      }
    }
  }
}

/* =========================== */
/* image swapping for gifs */
function gifOn(name) {
if (document.images){
  var img=document[name];
  var src=img.src;
  img.src=src.substring(0,src.length-6)+"_2.gif";
}}

function gifOff(name) {
if (document.images){
  var img=document[name];
  var src=img.src;
  img.src=src.substring(0,src.length-6)+"_1.gif";
}}


/* =========================== */
/* new navigation */
function nav(sect,href) {

  /* ignore if not inside a frameset */
  if (window==top) {
    return true;
  }

  /* set the section in top and menu frames */
  setFrame(0,'/top/'+sect+'.html');
  setFrame(1,'/menu/'+sect+'.html');

  /* set the main frame to the specified ref */
  top.frames[2].location=href;

  return false;
}

/* =========================== */
/* new navigation (with link parameter) */
function hnav(sect,href) {

  /* ignore if not inside a frameset */
  if (window==top) {
    return true;
  }

  /* set the section in top and menu frames */
  setFrame(0,'/top/'+sect+'.html');
  setFrame(1,'/menu/'+sect+'.html');

  /* set the main frame to the specified ref */
  top.frames[2].location=href;

  return false;
}

/* =========================== */
/* sets a frame location */
function setFrame(ind, ref) {
  var f = top.frames[ind];
  if (f.location.pathname != ref) {
    f.location = ref;
  }
}

