/* script modified from scripts found at DynamicDrive.com - by Master Slin */

var scrH = null;
var pW = null;
var pH = null;

function popupWin(link,attribs,pWidth,pHeight) { 
    var popupWin = null; 
if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
popupWin = window.open("","",attribs);

for (sizewidth = 1; sizewidth < pWidth; sizewidth += 10)
popupWin.resizeTo(sizewidth, "1");
for (sizeheight = 1; sizeheight < pHeight; sizeheight += 10) 
popupWin.resizeTo(pWidth, sizeheight);
popupWin.location = link;
}
else
popupWin = window.open(link,"",attribs);  
}

function popupWindows() {
    if(!document.getElementsByTagName) { 
         return; 
    } 
    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");
	if (anchor.getAttribute("rel") != null) {
	 var relIndex = anchor.getAttribute("rel");  
	 var relSplit = relIndex.split("|"); 
         var windowAttributes = ""; 
         if(relSplit[0] == "popup") { 
              if (relSplit[1] > scrW) { 
                 pW = scrW - 10; 
              } 
              else { 
                 pW = relSplit[1]; 
              } 
              if (relSplit[2] > scrH) { 
                 pH = scrH - 40; 
              } 
              else { 
                 pH = relSplit[2]; 
              }

              scrX = (15); 
              scrY = (scrH - pH - 10) * .5; 
              var windowAttributes = "width=" + pW + ",height=" + pH + ",left=" + scrX + ",top=" + scrY + ",screenX=" + scrX + ",screenY=" + scrY; 
              windowAttributes += ",resizable=" + relSplit[3] + ",toolbar=" + relSplit[4] + ",status=" + relSplit[5] + ",location=" + relSplit[6] + ",scrollbars=" + relSplit[7] + ",menubar=" + relSplit[8]; 
              anchor.setAttribute("href", "javascript:popupWin('" + linkDest + "','" + windowAttributes + "','" + pW + "','" + pH +"')"); 
         } 
}
    } 
} 



