var newWin = null;
function popUp(strURL, strType, strHeight, strWidth) {
 var strOptions="";
 if (strType=="console")
 strOptions="resizable,height="+
 strHeight+",width="+strWidth;
 if (strType=="fixed")
 strOptions="status,height="+
 strHeight+",width="+strWidth;
 if (strType=="fixedscroll")
 strOptions="status,scrollbars,height="+
 strHeight+",width="+strWidth;
if (strType=="fixedpos")
 strOptions="status,height,screenX=300,left=300,screenY=300,top=300,height="+
 strHeight+",width="+strWidth;
 if (strType=="elastic")
 strOptions="scrollbars,"+
 "resizable,height="+
 strHeight+",width="+strWidth;
 if (strType=="elasticmenu")
 strOptions="menubar,scrollbars,"+
 "resizable,height="+
 strHeight+",width="+strWidth;
 newWin = window.open(strURL, 'newWin', strOptions);
 newWin.focus();
}

var hst_toggle;
function toggleDiv( id ){
 var o = document.getElementById( id );
 if( o ){
  if( hst_toggle && o != hst_toggle ){
   hst_toggle.style.display = 'none';
  }
  o.style.display = ( o.style.display == 'block' ) ? 'none' : 'block';
  hst_toggle = o;
 }
}

function addEvent(obj,type,fn){
  if(obj.addEventListener){
      obj.addEventListener(type,fn,false);
  }else if(obj.attachEvent){
      obj["e"+type+fn] = fn;
      obj[type+fn] = function(){
        obj["e"+type+fn](window.event);
      }
      obj.attachEvent("on"+type,obj[type+fn]);
  }
}