function getRandom(intMin, intMax)
{
   return (Math.round(Math.random()*(intMax-intMin)))+intMin;
}

function popupWindow(strUrl, strName, intWidth, intHeight){
 var features = 'width='+ intWidth + ',height='+ intHeight + ',directories=' + 0 + ',location=' + 0 + ',menubar=' + 0 + ',status=' + 0 + ',toolbar=' + 0 + ',resizable=' + 1;
 var popupwin = window.open("about:blank", getRandom(1,999999999), features); //one in a billion chance of the windows having the same name
 popupwin.document.open("text/html");
 popupwin.document.write("<html><head><title>" + strName + "</title><script>function closePopup(){window.close}</script></head><FRAMESET FRAMEBORDER=1 FRAMESPACING=1><FRAME SRC=" + strUrl + "></frameset></html>")
 popupwin.AFF = self.parent;
 popupwin.myPopup = popupwin;
 popupwin.document.close()
}

function searchPopup(strSearchstring, intBoardID)
{
 popupWindow('search.asp?subjects=on&authors=on&bodys=on&active=on&searchstring=' + escape(strSearchstring) + '&searchEntireBoard=yes&b=' + intBoardID, 'Search', 600, 290)
}

