
   var current_window_id="";
//function to display pop-up window(show abstract info of event) right to event row

function showAbstractInfoWindow(trObjId, abstractInfo_window_Id)
{
    //if mouse move over the same row 
    if(current_window_id==abstractInfo_window_Id)
      return false;
	//hide current pop-up window  
	hideAbstractInfoWindow(current_window_id); 
	
	//set current pop-up window id
	current_window_id=abstractInfo_window_Id;
	
	//calculate current row's position which is mouse over
	var abstractInfo_window=document.getElementById(abstractInfo_window_Id);
	var trObj=document.getElementById(trObjId);
	var pos=getElementPos(trObjId);
	
	//set pop-up window' position
	//set pop-up right to event row

            // change the positioning for everyCircle header:
            if (current_window_id=="abstractInfo_window_everyCircleSettings")
                {
                       	abstractInfo_window.style.left=pos.x+trObj.clientWidth-245;
                        abstractInfo_window.style.top=pos.y+16;
                }
             else
                {
                        abstractInfo_window.style.left=pos.x+trObj.clientWidth-77;
                        abstractInfo_window.style.top=pos.y+10;
                }

	//show pop-up window
	abstractInfo_window.style.display = "";
    				 				
}
//close pop-up window by window id			
function hideAbstractInfoWindow(abstractInfo_window_Id){
 //if window id is not null
 if(abstractInfo_window_Id!=""){
    var abstractInfo_window=document.getElementById(abstractInfo_window_Id);
    abstractInfo_window.style.display='none';
    current_window_id="";
 }	 
}
			
// get elments' position ,return a structure with filed x, y
function getElementPos(elementId) {
 var ua = navigator.userAgent.toLowerCase();
 var isOpera = (ua.indexOf('opera') != -1);
 var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof
 var el = document.getElementById(elementId);
 if(el.parentNode === null || el.style.display == 'none') {
  return false;
 }      
 var parent = null;
 var pos = [];     
 var box;     
 if(el.getBoundingClientRect)    //IE
 {         
  box = el.getBoundingClientRect();
  var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
  var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
  return {x:box.left + scrollLeft, y:box.top + scrollTop};
 }else if(document.getBoxObjectFor)    // gecko    
 {
  box = document.getBoxObjectFor(el); 
  var borderLeft = (el.style.borderLeftWidth)?parseInt(el.style.borderLeftWidth):0; 
  var borderTop = (el.style.borderTopWidth)?parseInt(el.style.borderTopWidth):0; 
  pos = [box.x - borderLeft, box.y - borderTop];
 } else    // safari & opera    
 {
  pos = [el.offsetLeft, el.offsetTop];  
  parent = el.offsetParent;     
  if (parent != el) { 
   while (parent) {  
    pos[0] += parent.offsetLeft; 
    pos[1] += parent.offsetTop; 
    parent = parent.offsetParent;
   }  
  }   
  if (ua.indexOf('opera') != -1 || ( ua.indexOf('safari') != -1 && el.style.position == 'absolute' )) { 
   pos[0] -= document.body.offsetLeft;
   pos[1] -= document.body.offsetTop;         
  }    
 }              
 if (el.parentNode) { 
    parent = el.parentNode;
   } else {
    parent = null;
   }
 while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') { // account for any scrolled ancestors
  pos[0] -= parent.scrollLeft;
  pos[1] -= parent.scrollTop;
  if (parent.parentNode) {
   parent = parent.parentNode;
  } else {
   parent = null;
  }
 }
 return {x:pos[0], y:pos[1]};
}

