var beIE = false;
var beNS = false;

if (navigator.appVersion.indexOf("MSIE") != -1) {
  beIE = true;
} else if (navigator.appName == "Netscape") {
  beNS = true;
}

function tcbyOpenWindow(urlID,urlPop,urlTitle,windowW,windowH,windowX,windowY) {
  if (windowW == null || windowW == "") windowW = screen.width/4;
  if (windowH == null || windowH == "") windowH = screen.height/4;
  if (windowX == null || windowX == "") windowX = 10;
  if (windowY == null || windowY == "") windowY = 10;
//  s = "width="+windowW+",height="+windowH+",status=1,resizable=1";
  s = "width="+(windowW*1+10)+",height="+(windowH*1+40);
  if (beIE) {
    tcbyPopup = window.open("",urlID,s);
    tcbyPopup.blur();
    window.focus();
    tcbyPopup.resizeTo(windowW*1+10,windowH*1+40);
    tcbyPopup.moveTo(10,10);
    var frameString = ""+
                      "<html>"+
                      "<head>"+
                      "<title>"+urlTitle+"</title>"+
                      "</head>"+
                      "<frameset rows='*,0' framespacing='0' border='0' frameborder='0'>"+
                      "<frame name='popupTop' src='"+urlPop+"'>"+
                      "<frame name='popupBottom' src='about:blank' scrolling='no'>"+
                      "</frameset>"+
                      "</html>";
    tcbyPopup.document.open();
    tcbyPopup.document.write(frameString);
    tcbyPopup.document.close();
  } else {
    tcbyPopup = window.open(urlPop,urlID,s);
    tcbyPopup.blur();
    window.focus();
    tcbyPopup.resizeTo(windowW,windowH);
    tcbyPopup.moveTo(windowX,windowY);
  }
  window.onunload = function(){tcbyPopup.close()}
  tcbyPopup.focus();
}

function img_swap(id, imgName) {
  var obj
  obj = document.getElementById(id)
  obj.src = imgName;
}
