﻿//--------------------------------------------------------------------------------------------
// Open ImageAlbum Window
function OpenImageAlbum(serialId)
{
  left = (screen.width - 980) / 2;
  window.open("ImageAlbum.aspx?SerialId=" + serialId, "圖庫展示", "fullscreen=yes, width=980, height=768, left=" + left + ", top=0, toolbar=no, scrollbars=yes, resizable=yes");
  void(0);
}

function OpenImageAlbumTab(serialId) {
  left = (screen.width - 980) / 2;
  window.open("ImageAlbumTab.aspx?SerialId=" + serialId, "圖庫展示", "fullscreen=yes, width=980, height=768, left=" + left + ", top=0, toolbar=no, scrollbars=yes, resizable=yes");
  void (0);
}
//--------------------------------------------------------------------------------------------
// Open ImageAlbum Window
function OpenImageAlbumUrl(url) {
    left = (screen.width - 980) / 2;
    window.open(url, "圖庫展示", "fullscreen=yes, width=980, height=768, left=" + left + ", top=0, toolbar=no, scrollbars=yes, resizable=yes");
    void(0);
}   
//--------------------------------------------------------------------------------------------
// Open MemberImage Window
function OpenMemberImage()
{
  left = (screen.width - 980) / 2;
  window.open("MemberImage.aspx", "個人圖庫", "fullscreen=no, width=980, height=768, left=" + left + ", top=0, toolbar=no, scrollbars=yes, resizable=yes");
  void(0);
}
//--------------------------------------------------------------------------------------------
// Open MemberImage Window
function OpenMemberCredit(url) {
    left = (screen.width - 600) / 2;
    window.open(url, '會員點數交易明細', "fullscreen=no, width=600, height=600, left=" + left + ", top=50, toolbar=no, scrollbars=yes, resizable=yes");
    void(0);
}   
//--------------------------------------------------------------------------------------------
// 圖片預覽
function PreviewImageItem(control, controlId)
{
  //alert(controlId);
  var filePath = control.src.replace("/S/", "/M/");
  var image = document.getElementById(controlId);
  image.src = filePath;
}
//--------------------------------------------------------------------------------------------  
// 圖片選取
function ShowImageWindow(control, imageNumber)
{
  alert("You choose this image: " + imageNumber);
}
//--------------------------------------------------------------------------------------------    
function OpenSlideShowWindow(url, width, height)
{
  window.open(url,'','width='+width+',height='+height+',left=250,top=10, scrollbars=no,resizable=yes');
  void(0);
}
//--------------------------------------------------------------------------------------------
function TriggerRightContextMenu(enabled) 
{
  if (enabled)
      document.body.setAttribute("oncontextmenu", "");
  else
      document.body.setAttribute("oncontextmenu", "return false;");
}
//--------------------------------------------------------------------------------------------   
