/*function CalendarPopupOpen(path){
  var PopupWidth=900;
  var PopupHeight=500;
   
  var CalendarPopupWindow = window.open(path+'/CalendarPopup.ugss','CalendarPopup','left='+Math.round((screen.width-PopupWidth)/2)+',top='+Math.round((screen.height-PopupHeight)/2)+',width='+PopupWidth+',height='+PopupHeight+',toolbar=0,location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1');
  CalendarPopupWindow.focus()
}*/
function CalendarPopupOpen(path, AxIDs) {
    var PopupWidth = 680;
    var PopupHeight = 250;

    var CalendarPopupWindow = window.open(path + '/CalendarPopup.ugss?events=' + AxIDs, 'CalendarPopup', 'left=' + Math.round((screen.width - PopupWidth) / 2) + ',top=' + Math.round((screen.height - PopupHeight) / 2) + ',width=' + PopupWidth + ',height=' + PopupHeight + ',toolbar=0,location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1');
    CalendarPopupWindow.focus()
}

function OpenLinkInParentWindow(link){
    if(window.opener != null){
        window.opener.location.href = link;
    }else{
        location.href = link;
    }
    void(0);
}

var DateTips=new Array();
var ShowTips=new Array();
var DateEvents=new Array();
var EventsItemID=new Array();
var ItemTimer=new Array();

var toOpenEvents=new Array();
var toCloseEvents=new Array();
var doEventPrefix;
var browserDY;
var browserRowY;



function ExpandDate(e, shortDate) {
    
 var TipContent="";
 var CalendarTipEl=document.getElementById("CalendarTip");
 var CalendarTipPlaceEl=document.getElementById("CalendarTipPlace"+shortDate);
 
 CalendarTipEl.style.visibility="hidden";
 CalendarTipEl.style.position="absolute";
 eventsAxID = DateEvents[shortDate];

 var n=0;
 for (eventAxID in eventsAxID) {
     
  n++;
  if (n>1)TipContent+=" <br>";
  TipContent += "<b>" + DateTips[eventsAxID[eventAxID]][0] + "</b><br>";
  if (DateTips[eventsAxID[eventAxID]][1] != '')
      TipContent += DateTips[eventsAxID[eventAxID]][1] + "<br>";
 }
 if (n>0){
    CalendarTipEl.innerHTML="<div class=tip_bg><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" height=\"100\" class=tip><tr><td width=\"10\">&nbsp;</td><td valign=\"middle\" background=red>"+TipContent+"</td><td width=\"10\">&nbsp;</td></tr></table></div>";  

	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
    posx+=13;
    posy-=50;
    setTimeout("ShowTip("+shortDate+","+posx+","+posy+");",250);
    ShowTips[shortDate]=1;

    }
}



function CollapsDate(shortDate) {
 var CalendarTipEl=document.getElementById("CalendarTip");

 if (ShowTips[shortDate]==2){
  CalendarTipEl.style.visibility="hidden";
 }
 ShowTips[shortDate]=0;
 
}


function ShowTip(shortDate, X, Y) {
    var CalendarTipEl = document.getElementById("CalendarTip");
 if (ShowTips[shortDate]==1){
  ShowTips[shortDate]=2;
  CalendarTipEl.style.left=X+"px";
  CalendarTipEl.style.top=Y+"px";
  CalendarTipEl.style.visibility="visible";
 }
}