
ns4 = document.layers;
ie4 = document.all;
nn6 = document.getElementById && !document.all; 


// ----------------------------------------------------------------------
function showObject(txt,e) {


  calPopupObj = document.getElementById('calPopup');
  calPopupMsgObj = document.getElementById('calPopupMsg');


  arrayOffset = new Array(0,0);
  arrayOffset = getScrollXY();

  var left = e.clientX + arrayOffset[0];
  var top  = e.clientY + arrayOffset[1];


  if ((left + 250) > 930) {
    left = left - 250;
  }


  calPopupObj.style.visibility = "visible";
  calPopupObj.style.left = left + 'px';
  calPopupObj.style.top  = top  + 'px';


  // txt = '<div style="float: right; padding: 0 0 15px 20px;"><a href="javascript:hideObject();"><img src="/images/close.gif" width="16" height="16" border="0" /></a></div>' + txt;

  calPopupMsgObj.innerHTML = txt;

}



// ---------------------------------------------------------------------- //
function hideObject () {

  // alert("Hiding");
  calPopupObj = document.getElementById('calPopup');

  calPopupObj.style.visibility = "hidden";

}



// ---------------------------------------------------------------------- //
function getScrollXY() { 

    var x = 0, y = 0; 

    if( typeof( window.pageYOffset ) == 'number' ) { 
        // Netscape 
        x = window.pageXOffset; 
        y = window.pageYOffset; 
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { 
        // DOM 
        x = document.body.scrollLeft; 
        y = document.body.scrollTop; 
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { 
        // IE6 standards compliant mode 
        x = document.documentElement.scrollLeft; 
        y = document.documentElement.scrollTop; 
    } 

    return new Array(x,y); 

} 



// ---------------------------------------------------------------------- //
function findPosX(obj) {

  var curleft = 0;
  if (obj.offsetParent) {
    while (1) {
      curleft+=obj.offsetLeft;
      if (!obj.offsetParent) {
        break;
      }
      obj=obj.offsetParent;
    }
  } else if (obj.x) {
    curleft+=obj.x;
  }

  return curleft;

}



// ---------------------------------------------------------------------- //
function findPosY(obj) {

  var curtop = 0;
  if (obj.offsetParent) {
    while (1) {
      curtop+=obj.offsetTop;
      if (!obj.offsetParent) {
        break;
      }
      obj=obj.offsetParent;
    }
  } else if (obj.y) {
    curtop+=obj.y;
  }

  return curtop;

}



// ---------------------------------------------------------------------- //
function showObject2(cellID,txt) {


  cellObj = document.getElementById(cellID);
  xPos = findPosX(cellObj);
  yPos = findPosY(cellObj);

  // alert("X: " + xPos + "  Y: " + yPos);
  calPopupObj = document.getElementById('calPopup');
  calPopupMsgObj = document.getElementById('calPopupMsg');


  // dayObj = document.getElementById(day);
  // displayDate(submenu,date);


  calPopupMsgObj.innerHTML = txt;
  // calPopupMsgObj.innerHTML = '<p>Here is some text<br/><br/><br/>Here is some more text</p>';

  calPopupObj.style.visibility = "visible";
  calPopupObj.style.left = xPos + 'px';
  calPopupObj.style.top  = yPos  + 'px';

}



// ---------------------------------------------------------------------- //
function hideObject2() {

  // alert("HERE");
  calPopupObj = document.getElementById('calPopup');
  calPopupObj.style.visibility = "hidden";

}


// ---------------------------------------------------------------------- //
function unSelectRadio(rName) {

  var radioObj = document.getElementsByName(rName);

  for (i=0; i < radioObj.length; i++) {
    radioObj[i].checked = false; 
  }

}


// ---------------------------------------------------------------------- //
 function toggleRadio(radioID,radioValue) {

   var radioObj = document.getElementById(radioID);

   // alert(radioValue);
   if ( radioValue == true ) {
    radioObj.checked = false;
  }

}


