// edu.rochester.hr.popup

if (!edu) var edu = {};
if (!edu.rochester) edu.rochester = {};
if (!edu.rochester.hr) edu.rochester.hr = {};

edu.rochester.hr.popup = {
	 
   dx:[],
   dy:[],
	 
   over: function (element) { 
     
	 var popup_node = document.getElementById(element.id + '_popup');
     if (popup_node) {
        return;
     }
	 
     iframe = document.createElement("iframe");
   
     var pos = edu.rochester.hr.popup.position(element);
     
     iframe.style.position = 'absolute';
     iframe.style.zIndex = '10';

     var popupId = element.id + '_popup';
	 
	 if (edu.rochester.hr.popup.dx[popupId]) {
		 
		 pos[0] = pos[0] + edu.rochester.hr.popup.dx[popupId];
	 }
 
	 if (edu.rochester.hr.popup.dy[popupId]) {
		 
		 pos[1] = pos[1] + edu.rochester.hr.popup.dy[popupId];
	 }
	 
     iframe.style.left = pos[0] + 'px';
     iframe.style.top = pos[1] + 'px';
	 
     iframe.setAttribute('id',  popupId);
     iframe.setAttribute('onmouseout', "edu.rochester.hr.popup.remove(this);");
	 iframe.setAttribute('src', popupId + '.html');
     
     var body = document.getElementsByTagName("body").item(0);
     
	 var popup_node = document.getElementById(popupId);

     body.appendChild(iframe);
	 
	 if (iframe.attachEvent) {
		 
		 iframe.attachEvent("onmouseout", edu.rochester.hr.popup.removeIE);
	 }
	 
	 return false;
   },
   
   position: function (obj) {
      
     var curleft = curtop = 0;
     
     if (obj.offsetParent) {
        
         curleft = obj.offsetLeft ;
         curtop = obj.offsetTop;
       
         while (obj = obj.offsetParent) {
          
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
         }
      }
   
      return [curleft,curtop];
   },
   
   remove: function(popup) {
      
     if (!popup) {
        return;
     }
     var body = document.getElementsByTagName("body").item(0);
     body.removeChild(popup);
	 return false;
   },
   
   removeIE: function() {
      
     var popup = event.srcElement;
	 
     var body = document.getElementsByTagName("body").item(0);
     body.removeChild(popup);
	 return false;
   }
};

