var fieldName;
var showTime;
function openCalender(event, form, object, pShowTime){   
  showTime = pShowTime;
  fieldName = form + "." + object;

  if(!event){    
    calender = window.open("calender_ver1/calender.html", "calender",  "scrollbars=no, location=no, menubar=no, resizable=no, personalbar=no, status=no, toolbar=no, dependent=yes, height=320, Width=290, top=" + (screen.height/2-138) + ",left=" + (screen.width-330) + ",screenY=" + (screen.height/2-138) + ",screenX=" + (screen.width/2-145));
    return;
  } 

  tempX = event.clientX;
  tempY = event.clientY;

  windowW = 290;   
  windowH = 320; 
  if((screen.width - tempX) < windowW)
    tempX = screen.width - windowW - 10;
  else
    tempX = tempX + 10;
      
  if((screen.height - tempY) < windowH)
    tempY = screen.height - windowH - 80;
  else      
    tempY = tempY - 80;     

  var currObject = eval('document.' + form + '.' + object);  
  //alert(currObject.offsetWidth);
  var leftPos = currObject.offsetWidth + 370;
  var topPos = (screen.height/2-138);  
  calender = window.open("calender_ver1/calender.html", "calender",  "scrollbars=no, location=no, menubar=no, resizable=no, personalbar=no, status=no, toolbar=no, dependent=yes, height=" + windowH + ", Width=" + windowW + ", top=" + tempY + ",left="  + tempX);
}
