function popupWin(link,attribs) { 
    var popupWin = null; 
    popupWin = window.open(link,'winPopup',attribs);  
}

function popupWindows() { 
    if(!document.getElementsByTagName) { 
         return; 
    } 
	winWidth=600;
	winHeight=400;
    var scrW = screen.availWidth; 
    var scrH = screen.availHeight; 
    var anchors = document.getElementsByTagName("a"); 
    for (var i = 0; i < anchors.length; i++) { 
         var anchor = anchors[i]; 
         var linkDest = anchor.getAttribute("href"); 
         var relIndex = anchor.getAttribute("rel"); 
         
		 if (relIndex!=null) {
		 
		 var relSplit = relIndex.split("|"); 
         var windowAttributes = ""; 
         if(relSplit[0] == "popup") { 
              if (winWidth > scrW) { 
                 pW = scrW - 10; 
              } 
              else { 
                 pW = winWidth; 
              } 
              if (winHeight > scrH) { 
                 pH = scrH - 40; 
              } 
              else { 
                 pH = winHeight; 
              } 
              scrX = (scrW - pW - 10) * .5; 
              scrY = (scrH - pH - 30) * .5; 
              var windowAttributes = "width=" + pW + ",height=" + pH + ",left=" + scrX + ",top=" + scrY + ",screenX=" + scrX + ",screenY=" + scrY; 
              windowAttributes += ",location=0,resizable=0,scrollbars=1"; 
              anchor.setAttribute("href", "javascript:popupWin('" + linkDest + "','" + windowAttributes + "')"); 
		 }
         } 
    } 
}