var imgAmount = imageLinesPerPage * imagesPerLine;    
var currentMenuId;
var bubleObj;

function infoPanelUp(obj)   
{   
  currentMenuId=getPopupIndex(obj.id);   
  bubleObj=eltId("imageParamPopup_"+currentMenuId);           
  bubleObj.style.visibility="visible";
  document.onmousemove = mouseMove; 
}

function infoPanelDawn(obj)
{ 
  currentMenuId=getPopupIndex(obj.id); 
  bubleObj=eltId("imageParamPopup_"+currentMenuId);  
  bubleObj.style.visibility="hidden";
  bubleObj.style.top="-1000px";
  document.onmousemove = "";          
}

function mouseMove(evt) {
  evt = (evt) ? evt : (window.event) ? window.event : "";        
  if (evt.pageX) {
    x=evt.pageX;
    y=evt.pageY;
  }else {
    x=evt.clientX;
    y=evt.clientY+getBodyScrollTop();    
  }                                        
  bubleObj.style.left=x+15+"px";
  bubleObj.style.top=y+15+"px";
}

function getPopupIndex(id) { 
  id=id.substring(id.lastIndexOf("_")+1, id.length);
  return id;
}

function infoPanelsInit() {
  for(i=1; i<=imgAmount; i++)
  {                         
    if (eltId("imgHandler_"+i)){
      eltId("imgHandler_"+i).onmouseover=function() { infoPanelUp(this)};
      eltId("imgHandler_"+i).onmouseout=function() { infoPanelDawn(this);};      
    }           
  }
}

function getBodyScrollTop() {
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
