// --- for artSpace window ----
function openGalleryWindow(theURL,winName) {
  var gWin, centerH, centerW, winW, scrFlag="yes";
  winW = screen.availWidth;
  if(winW >= 1024) {
    winW = 1024
    scrFlag="no"
  }
  centerH = (screen.height / 2) - (550 / 2);
  centerW = (screen.availWidth / 2) - ( winW / 2 );
  // OS Hantei
  var osname = navigator.userAgent.toUpperCase();
  if(osname.indexOf("WIN") >= 0){
    // forWindows
    if(screen.availWidth == 1024) {
      winW = 1014
    };
    gWin = window.open(theURL,winName,"width="+ winW +",height=550, top="+ centerH +", left="+ centerW +", location=no, menubar=no, resizable=no, scrollbars=" + scrFlag + ", status=yes, titlebar=no, toolbar=no");
  } else {
    // forSafari
    if (navigator.appVersion.indexOf("Safari") > -1) {
      winW = winW - 2;
      gWin = window.open(theURL,winName,"width="+winW+",height=565, top="+ centerH +", left="+ centerW +", location=no, menubar=no, resizable=no, scrollbars=" + scrFlag + ", status=yes, titlebar=no, toolbar=no");
    } else {
    // forOtherOS
    gWin = window.open(theURL,winName,"width="+winW+",height=550, top="+ centerH +", left="+ centerW +", location=no, menubar=no, resizable=no, scrollbars=" + scrFlag + ", status=yes, titlebar=no, toolbar=no");
    }
  };
  gWin.focus();
}

// --- View or NotView  default Hide ---
function expandcollapse (postid) {
   whichpost = document.getElementById(postid);
   if (whichpost.className=="postshown") {
      whichpost.className="posthidden";
   }
   else {
      whichpost.className="postshown";
   }
}
// --- View or NotView  default View ---
function expandcollapseBtn (postid) {
   whichpost = document.getElementById(postid);
   if (whichpost.className=="posthidden") {
      whichpost.className="postshown";
   }
   else {
      whichpost.className="posthidden";
   }
}