// JavaScript Document
// pop up a new unresizable window
function js_win_pop(theURL, theW, theH, canScroll) {
  intWidth = theW;
  intHeight = theH;
    
  intTop = (screen.width - intWidth) / 2;
  intLeft = (screen.height - intHeight) / 2;
  
  js_strWinProp = " toolbar=no"
                + ",location=no"
                + ",directories=no"
                + ",status=no"
                + ",menubar=no"
                + ",resizable=no"
                + ",scrollbars=" + (canScroll!=null? canScroll: "no")
                + ",titlebar=no"
                + ",width=" + intWidth
                + ",height=" + intHeight
                + ",top="  + intLeft
                + ",left=" + intTop
                + "";
                
  js_opener = window.open(theURL, "_blank" ,js_strWinProp);
  js_opener.resizeTo(intWidth, intHeight);
  js_opener.focus();
}


// pop up a unresizable window with title
function js_win_pop2(theURL, winName, theW, theH, canScroll) {
  intWidth = theW;
  intHeight = theH;
    
  intTop = (screen.width - intWidth) / 2;
  intLeft = (screen.height - intHeight) / 2;
  
  js_strWinProp = " toolbar=no"
                + ",location=no"
                + ",directories=no"
                + ",status=no"
                + ",menubar=no"
                + ",resizable=no"
                + ",scrollbars=" + (canScroll!=null? canScroll: "no")
                + ",titlebar=no"
                + ",width=" + intWidth
                + ",height=" + intHeight
                + ",top="  + intLeft
                + ",left=" + intTop
                + "";
                
  js_opener = window.open(theURL, winName ,js_strWinProp);
  js_opener.resizeTo(intWidth, intHeight);
  js_opener.focus();
  
}


// pop up a resizable window with title
function js_win_pop3(theURL, winName, theW, theH, canScroll, canResize) {
  intWidth = theW;
  intHeight = theH;
    
  intTop = (screen.width - intWidth) / 2;
  intLeft = (screen.height - intHeight) / 2;
  
  js_strWinProp = " toolbar=no"
                + ",location=no"
                + ",directories=no"
                + ",status=no"
                + ",menubar=no"
                + ",resizable=" + (canResize!=null? canResize: "no")
                + ",scrollbars=" + (canScroll!=null? canScroll: "no")
                + ",titlebar=no"
                + ",width=" + intWidth
                + ",height=" + intHeight
                + ",top="  + intLeft
                + ",left=" + intTop
                + "";
                
  js_opener = window.open(theURL, winName ,js_strWinProp);
  js_opener.resizeTo(intWidth, intHeight);
  js_opener.focus();
}


// pop up a resizable window with title & toolbar
function js_win_pop4(theURL, winName, theW, theH, canScroll, canResize, hasToolBar, hasLocation, isFullScreen, isPopUpCenter) {
  if(isFullScreen == "yes")
  {
    intWidth = screen.width;
    intHeight = screen.height;
  }
  else
  {
    intWidth = theW;
    intHeight = theH;
  }

  if(isPopUpCenter == "no")
  {
    intTop = 0;
    intLeft = 0;
  }
  else
  {
    intTop = (screen.width - intWidth) / 2;
    intLeft = (screen.height - intHeight) / 2;  
  }

  js_strWinProp = " toolbar=" + (hasToolBar!=null? hasToolBar: "no")
                + ",location=" + (hasLocation!=null? hasLocation: "no")
                + ",directories=no"
                + ",status=no"
                + ",menubar=no"
                + ",resizable=" + (canResize!=null? canResize: "no")
                + ",scrollbars=" + (canScroll!=null? canScroll: "no")
                + ",titlebar=no"
                + ",width=" + intWidth
                + ",height=" + intHeight
                + ",top="  + intLeft
                + ",left=" + intTop
                + "";
                
  js_opener = window.open(theURL, winName ,js_strWinProp);
  js_opener.resizeTo(intWidth, intHeight);
  js_opener.focus();
}

// pop up a resizable window with title & toolbar & scroll bar -- 20100620 MeteorY
function js_win_pop5(theURL, winName, theW, theH, canScroll, canResize, hasToolBar, hasLocation, isFullScreen, isPopUpCenter) {
  if(isFullScreen == "yes")
  {
    intWidth = screen.width;
    intHeight = screen.height;
  }
  else
  {
    intWidth = theW;
    intHeight = theH;
  }

  if(isPopUpCenter == "no")
  {
    intTop = 0;
    intLeft = 0;
  }
  else
  {
    intTop = (screen.width - intWidth) / 2;
    intLeft = (screen.height - intHeight) / 2;  
  }

  js_strWinProp = " toolbar=" + (hasToolBar!=null? hasToolBar: "no")
                + ",location=" + (hasLocation!=null? hasLocation: "no")
                + ",directories=no"
                + ",status=no"
                + ",menubar=no"
                + ",resizable=" + (canResize!=null? canResize: "no")
                + ",scrollbars=yes"
                + ",titlebar=no"
                + ",width=" + intWidth
                + ",height=" + intHeight
                + ",top="  + intLeft
                + ",left=" + intTop
                + "";
                
  js_opener = window.open(theURL, winName ,js_strWinProp);
  js_opener.resizeTo(intWidth, intHeight);
  js_opener.focus();
}

