function window_open (url,window_target) {
  var window_popup = window.open(url,window_target,"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,favorites=yes");
  window_popup.focus();
}

  function getScreenAvailWidth() {
    if (!!window.screen)
    return screen.availWidth
    else
    return null
  }
  function getScreenAvailHeight() {
    if (!!window.screen)
    return screen.availHeight
    else
    return null
  }
  function openWin(fileURL,winName){
    w = 400;
    h = 430;
    if (!getScreenAvailWidth() || !getScreenAvailWidth()) return
    var x = parseInt(( getScreenAvailWidth()  - w )/2,10)
    var y = parseInt(( getScreenAvailHeight() - h )/2,10)
    var para =""
    +"left="+x +",top="+y+",screenX="+x +",screenY="+y+",innerWidth="+w+",innerHeight="+h+",width="+w+",height="+h+",scrollbars=yes"
    openWin[fileURL]=window.open(fileURL,winName,para);
    openWin[fileURL].document.close()
  }

//number
function window_open_num (url,window_target,w,h) {
  if ((navigator.appVersion.indexOf('Mac',0) != -1) && (navigator.appName.charAt(0)=="M")) {
    if (!!window && url) {
      var window_popup = window.open(url,window_target,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,favorites=no");
      window_popup.focus();
      var this_width = w;
      var this_height = h;
      var this_x = parseInt((getScreenAvailWidth()  - this_width )/2,10);
      var this_y = parseInt((getScreenAvailHeight() - this_height )/2,10);
      window_popup.moveTo(this_x,this_y);
      window_popup.resizeTo(this_width,this_height);
    }
  } else {
    if (!!window && url) {
      var this_width = w;
      var this_height = h;
      var this_x = parseInt((getScreenAvailWidth()  - this_width )/2,10);
      var this_y = parseInt((getScreenAvailHeight() - this_height )/2,10);
      var window_popup = window.open(url,window_target,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,favorites=no,width=" + this_width + ",height=" + this_height + ",left=0,top=0,screenX=" + this_x + ",screenY=" + this_y + "");
      window_popup.focus();
    }
  }
}