    //var args = parseQueryString();
	var result;
	var boxStyle;
	var boxStyle2;
	var arr_Month = new Array(X.Jan,X.Feb,X.Mar,X.Apr,X.May,X.Jun,X.Jul,X.Aug,X.Sep,X.Oct,X.Nov,X.Dec);
	var dayNum = <!--ICAL.ToDayMonthName-->;
	var newday = parseFloat("<!--ICAL.TodayDay-->");
		
	//(args['side'] == 1)?result=1:result=0;

    //if(result==1)
	//{
	//  boxStyle2='block'; 
	//  boxStyle='none';
	//}
	//else
	//{
	//  boxStyle2='none';
	//  boxStyle='block';
	//}


  if (document.layers)
  {
    document.captureEvents(Event.DBLCLICK);
  }

  document.ondblclick = function (evt)
  {
	var tarX;
	var tarY;
	var showIt;
    var target;
	var moveableMenu;
	var theScreenWidth;
	var theScreenHeight;
	var divWidth;
	var divHeight;
	var myHeight;

    if(document.all)
	{
	  tarX = event.clientX;
	  tarY = event.clientY;
	  showIt = 'visible';
	  hideIt = 'hidden';
	  target = event.srcElement;
	  moveableMenu = boxMe.style;
	  theScreenWidth = document.body.clientWidth;
	  theScreenHeight = document.body.clientHeight
	  divWidth = boxMe.clientWidth;
	  divHeight = boxMe.clientHeight;
	}
	
	if (document.layers)
	{
	  tarX = evt.pageX;
	  tarY = evt.pageY;
	  showIt = 'show';
	  hideIt = 'hide';
	  target = evt.target;
	  moveableMenu = document.boxMe;
	  theScreenWidth = self.innerWidth;
	  theScreenHeight = self.innerHeight;
	  divWidth = moveableMenu.clip.width;
	  divHeight = moveableMenu.clip.height;
	}

    if(document.all)
	{
	  var el = invisibleBox
	  var ot = el.offsetTop;
	  while((el = el.offsetParent) != null)
	  {
	    ot += el.offsetTop;
	  }
	  myHeight = ot;
	  if(myHeight>tarY)
	  {
	    tarY = myHeight;
	  }
	}
	if(document.layers)
	{
	  myHeight = document.invisibleBox.pageY;
	  if(myHeight>tarY)
	  {
	    tarY = myHeight;
	  }
	}
	
	//alert("The height is: " + myHeight + ", mouse clicked at: " + tarY);
	
	//alert("X = " + event.clientX + ", Y = " + event.clientY);
	//alert("height="+ divHeight + ", width=" + divWidth);
	//alert("The mouse clicked at:\n height: " + tarY + "\n width: " + tarX + "\n\n Screen height="+ theScreenHeight + "\n Screen width=" + theScreenWidth);


	if (moveableMenu.display=="block")
	{
	  moveableMenu.visibility = hideIt;
	  moveableMenu.display='none';
	}
	else
	{
	  moveableMenu.visibility = showIt;
	  moveableMenu.display = 'block';
	}


	if(((tarX + divWidth) < theScreenWidth)|| ((tarX - divWidth)<0))
	{
	  moveableMenu.left=tarX;
	}
	else
	{
	  moveableMenu.left=tarX - divWidth;
	}
	
	if(((tarY + divHeight) < theScreenHeight)|| ((tarY - divHeight)<=myHeight))
	{
	  moveableMenu.top=tarY;
	}
	else
	{
      moveableMenu.top=tarY - divHeight;
	}

    return true;
  };

  function openMenu()
  {
	var showIt;
	var moveableMenu;
	var myHeight;

	if(document.all)
	{
	  var el = invisibleBox
	  var ot = el.offsetTop;
	  while((el = el.offsetParent) != null)
	  {
	    ot += el.offsetTop;
	  }
	  myHeight = ot;
	}
	if(document.layers)
	{
	  myHeight = document.invisibleBox.pageY;
	}

    if(document.all)
	{
	  showIt = 'visible';
	  hideIt = 'hidden';
	  moveableMenu = boxMe.style;
	}
	
	if (document.layers)
	{
	  showIt = 'show';
	  hideIt = 'hide';
	  moveableMenu = document.boxMe;
	}

	if (moveableMenu.display=="block")
	{
	  moveableMenu.visibility = hideIt;
	  moveableMenu.display='none';
	}
	else
	{
	  moveableMenu.visibility = showIt;
	  moveableMenu.display = 'block';
	  moveableMenu.left = 8;
	  moveableMenu.top = myHeight;
	}

    return;
  }



  function closeMenu()
  {
	var showIt;
	var moveableMenu;

    if(document.all)
	{
	  showIt = 'visible';
	  hideIt = 'hidden';
	  moveableMenu = boxMe.style;
	}
	
	if (document.layers)
	{
	  showIt = 'show';
	  hideIt = 'hide';
	  moveableMenu = document.boxMe;
	}

	if (moveableMenu.display=="block")
	{
	  moveableMenu.visibility = hideIt;
	  moveableMenu.display='none';
	}
	else
	{
	  moveableMenu.visibility = hideIt;
	  moveableMenu.display = 'none';
	}

    return;
  }

  <!-- Function to Go To the selected date -->
  function sendDate()
  {
    var iDay,iMonth,iYear;
	iDay = document.forms[0].GoToDay.selectedIndex;
	iMonth = document.forms[0].GoToMonth.selectedIndex;
	iYear = document.forms[0].GoToYear.selectedIndex;
	
	document.forms[0].UI_Date.value= document.forms[0].GoToYear.options[iYear].value+document.forms[0].GoToMonth.options[iMonth].value+document.forms[0].GoToDay.options[iDay].value;
	document.forms[0].UI_CurrentView.value = "DAILY";
	document.forms[0].action = "DAILYVIEW.<!--ICAL.Number-->.cgi";
	document.forms[0].submit();
  }

  <!--Function For Search -->
  function searchString()
  {
	var iDay,iMonth,iYear;
	
	iDay = document.forms[0].GoToDay.selectedIndex;
	iMonth = document.forms[0].GoToMonth.selectedIndex;
	iYear = document.forms[0].GoToYear.selectedIndex;
				
	document.forms[0].UI_Date.value= document.forms[0].GoToYear.options[iYear].value+document.forms[0].GoToMonth.options[iMonth].value+document.forms[0].GoToDay.options[iDay].value;
	document.forms[0].UI_CurrentView.value = "<!--ICAL.CurrentView-->";//"SEARCHRESULT";	

	document.forms[0].action = "SEARCHRESULT.<!--ICAL.Number-->.cgi"
	document.forms[0].submit();
  }
	
  <!-- Function to set the current date -->
  function setDate()
  {
    //if(boxStyle=='none')
	//{
	//  return;
	//}


    var tDay,lenDay,tMonth,lenMonth,tYear,lenYear,toDay;
    tDay = parseFloat("<!--ICAL.UserDay-->")-1;
	tMonth = parseFloat("<!--ICAL.UserMonth-->") - 1;
	tYear = parseFloat("<!--ICAL.UserYear-->");
	lenDay = document.forms[0].GoToDay.length;
	lenMonth = document.forms[0].GoToMonth.length;
	lenYear = document.forms[0].GoToYear.length;


	document.forms[0].GoToDay.options[tDay].selected = true;
	document.forms[0].GoToMonth.options[tMonth].selected = true;
	for(i=0; i < lenYear; i++)
	{
	  if(document.forms[0].GoToYear.options[i].value == tYear)
	  {
	    document.forms[0].GoToYear.options[i].selected = true;
	  }
	}
  }


  <!-- Function to validate the search string -->
  function chkSearchString()
  {
    var tmp_string = document.forms[0].UI_Search.value;
	if(tmp_string == "" || tmp_string.length == 0)
	{
	  alert(X.EntTitleToSrch);
	  document.forms[0].UI_Search.focus();
	}
	else if(tmp_string.length > 80)
	{
	  alert(X.TitleMax80);
	  document.forms[0].UI_Search.focus();
	}
	else
	{
	  searchString();
	}
  }
			
  <!-- Function to validate the search string for Enter Pressed -->
  function chkSearchStringEnter()
  {
    
	var tmp_string = document.forms[0].UI_Search.value;
	if(tmp_string == "" || tmp_string.length == 0)
	{
	  alert(X.EntTitleToSrch);
	  document.forms[0].UI_Search.focus();
	  return; 
	}
	else if(tmp_string.length > 80)
	{
	  alert(X.TitleMax80);
	  document.forms[0].UI_Search.focus();
	  return;
	}
	else
	{
	  searchString();
	}
  }

  function OpenIcal()
  { 
	var link;
	<!--ICAL.BeginSSL-->
		<!--ICAL.BeginIfCurrentDomainIsAVirtualDomain-->
			link = "https://<!--ICAL.PrimaryDomain-->:<!--ICAL.ImailSSLServerPort-->/ical.cgi?&App=IWebMsg&<!--ICAL.UserParameters-->";
			open(link,"iwebmsg", "toolbar=yes,location=1,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=1,copyhistory=0,width=512,height=512");
		<!--ICAL.ElseBeginIfCurrentDomainIsAVirtualDomain-->
			link = "https://<!--ICAL.CurrentDomain-->:<!--ICAL.ImailSSLServerPort-->/ical.cgi?&App=IWebMsg&<!--ICAL.UserParameters-->";
			open(link,"iwebmsg", "toolbar=yes,location=1,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=1,copyhistory=0,width=512,height=512");
		<!--ICAL.EndBeginIfCurrentDomainIsAVirtualDomain-->
	<!--ICAL.ElseBeginSSL-->
		<!--ICAL.BeginIfCurrentDomainIsAVirtualDomain-->
			link = "http://<!--ICAL.PrimaryDomain-->:<!--ICAL.ImailServerPort-->/ical.cgi?&App=IWebMsg&<!--ICAL.UserParameters-->";
			open(link,"iwebmsg", "toolbar=yes,location=1,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=1,copyhistory=0,width=512,height=512");
		<!--ICAL.ElseBeginIfCurrentDomainIsAVirtualDomain-->
			link = "http://<!--ICAL.CurrentDomain-->:<!--ICAL.ImailServerPort-->/ical.cgi?&App=IWebMsg&<!--ICAL.UserParameters-->";
			open(link,"iwebmsg", "toolbar=yes,location=1,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=1,copyhistory=0,width=512,height=512");
		<!--ICAL.EndBeginIfCurrentDomainIsAVirtualDomain-->
	<!--ICAL.EndBeginSSL-->
  }


  //function parseQueryString (str) 
  //{  
  //  str = str ? str : location.search;
  //  var query = str.charAt(0) == '?' ? str.substring(1) : str;
  //  var args = new Object();  
  //  if (query)
  //  {
  //    var fields = query.split('&');
  //    for (var f = 0; f < fields.length; f++)
  //  {
  //      var field = fields[f].split('=');
  //      args[unescape(field[0].replace(/\+/g, ' '))] = unescape(field[1].replace(/\+/g, ' '));
  //  }
  //  }
  //  return args;
  //}

//---------------- Function to create the list of year -------------------
function getYearList()
{
	var s_year, e_year;
	s_year = 1970;  // <!--ICAL.StartYear-->;
	e_year = 2037;  // <!--ICAL.EndYear-->;
	for (;s_year <= e_year; s_year++) 
	{
		document.write("<OPTION VALUE="+s_year+">"+s_year+"</OPTION>");
	}
}

//---------------- Function to create the list of month ------------------
var arrMonth = new Array(X.jan,X.feb,X.mar,X.apr,X.may,X.jun,X.jul,X.aug,X.sep,X.oct,X.nov,X.dec);
function getMonthList()
{
	for(i=0; i<arrMonth.length; i++)
	{
		var j = i + 1;
		if(j<10)
			document.write("<OPTION VALUE= 0"+j+">"+arrMonth[i]+"</OPTION>");
		else
			document.write("<OPTION VALUE="+j+">"+arrMonth[i]+"</OPTION>");
	}
}

//---------------- Function to create the list of days -------------------
function getDaysList()
{
	for (i=0; i<31; i++)
	{
		var j = i + 1;
		if(j<10)
			document.write("<OPTION VALUE= 0"+j+">"+j+"</OPTION>");
		else
			document.write("<OPTION VALUE="+j+">"+j+"</OPTION>");
	}
}