function callpop(text,text1,text2,text3)
   {
     setDateField(text,text1,text2,text3);
     top.newWin = window.open('calendarmain.html','cal','dependent=yes,width=200,height=200,resizable=no,screenX=400,screenY=200,titlebar=yes');
     return false;
   }

function blockEvents()
 {
        window.onclick = deadend
        window.onfocus = checkModal
 }

// As dialog closes, restore the main window's original event mechanisms.

function unblockEvents()
 {
      window.onclick = null
      window.onfocus = null
 }


function deadend() 
{
  if (top.newWin && !top.newWin.closed)
  {
      top.newWin.focus()
      return false
  }
}

function checkModal()
 {
   if (top.newWin && !top.newWin.closed) 
   {
      //top.newWin.focus()
   }
}

function callCalendar()
{
        if (document.frmPeriod.select1.selectedIndex == 5)
        {
             document.layer1.visibility = 'show';
        }
        else
        {
                document.layer1.visibility = 'hide';
        }
}



