var winModalWindow;


function openImage(aPath,aWdt,aHgt) {
  var ms = new Date().getTime();

  if ((aWdt==undefined) || (aWdt=='')) aWdt='600';
  if ((aHgt==undefined) || (aHgt=='')) aHgt='400';
 
  //if (window.showModalDialog) {
  //  window.showModalDialog(aPath + '?ms=' + ms,'','status:no;help:no;dialogHeight:' + aHgt + 'px;dialogWidth:' + aWdt + 'px');
  //} else {
  //  window.top.captureEvents(Event.CLICK|Event.FOCUS)
  //  window.top.onclick = IgnoreEvents
  //  window.top.onfocus = HandleFocus
  //  winModalWindow = window.open(aPath + '?ms=' + ms,'','dependent=yes,width=' + aWdt + 'px,height=' + aHgt + 'px')
  //  winModalWindow.focus()
  //}

  window.open(aPath + '?ms=' + ms,'Image','dependent=yes,width=' + aWdt + 'px,height=' + aHgt + 'px');
}

function openFixed(aFile,aWidth,aHeight,aTarget) {
  var ms = new Date().getTime();
  var theFeatures;
  
  if ((aWidth == undefined) || (aWidth == '')) aWidth='750px';
  if ((aHeight == undefined) || (aHeight == '')) aHeight='550px';
  if ((aTarget == undefined) || (aTarget == '')) aTarget='_blank';
  
  theFeatures = 'fullscreen=no,height=' + aHeight + ',width=' + aWidth + ',status=no,toolbar=no,menubar=no,location=no';
  //alert(theFeatures);
  window.open(aFile,aTarget,theFeatures);
}


function highlight(aObj, aHand) {
  if ((aHand == undefined) || (aHand == '')) aHand = 'pointer';

  aObj.style.cursor = aHand;
}


function unhighlight(aObj) {
  aObj.style.cursor = 'default'; 
}


function IgnoreEvents(e) {
  return false
}


function HandleFocus() {
  if (winModalWindow) {
    if (!winModalWindow.closed) {
      winModalWindow.focus();
    } else {
      window.top.releaseEvents (Event.CLICK|Event.FOCUS);
      window.top.onclick = '';
    }
  }

  return false;
}

function changeClass(aObj, aClassName) {
  if (aObj.type == undefined) aObj.className=aClassName;
  if ((aObj.readOnly==false) && (aObj.disabled==false)) aObj.className=aClassName;
}
