
var sUserAgent = navigator.userAgent.toLowerCase();
var isOp = (sUserAgent.indexOf('opera')!=-1)?true:false;
var popwindow = null;

function popup (url, wid, width, hei) {
  var  WinOpts='scrollbars=yes,resizable=yes,status=yes,toolbar=yes,directories=0,copyhistory=0';
  var FullWinOpts=WinOpts + ",width=" + width + ",height=" + hei;

  if (popwindow && popwindow.open && !popwindow.closed) 
    popwindow.close();

  popwindow=window.open(url, wid, FullWinOpts);
  // give it focus
  if (popwindow && !isOp) popwindow.focus();

  return (popwindow)? false : true;
}
// Usage: 
// Styles:  .show { display: block; visibility: visible;}
//          .hide { display: none;  visibility: hidden;}
//<div id="id2" class="show">
//<a href="javascript:toggleVisible('id2')">more...</a>
//</div>
//<div id="id2h" class="hide">
//<a href="javascript:toggleVisible('id2')">Hide..</div>.</a>
//<p>
//This is hidden for a while...
//</div>

function toggleVisible(nameID) {
  var ele1 = document.getElementById(nameID);
  var ele2 = document.getElementById(nameID + 'h');
  var cn;
  if (document.all && !isOp) {
    cn = "className";
  } else {
    cn = "class";
  }
  // if 'show' is within the class name
  if (ele1.getAttribute(cn).indexOf('show') != -1) {
   ele1.setAttribute(cn, "hide");
   ele2.setAttribute(cn, "show");
   ele2.setAttribute("className", "show");
  } else {
   ele2.setAttribute(cn, "hide");
   ele1.setAttribute(cn, "show");
  }
return;
} 

