/**
 * 共通javascript
 *
 * @package JKX
 * @author MOCHIZUKI M.
 * @copyright All Rights Reserved Copyright(c) FUJITSU LIMITED 2008
 * 
 * 2011/8/31 tanaka nFlashWinの例外の戻り値をfalseからnullに変更
 */
var CommonUtils =
{
    nWin: function(url,windowname,width,height)
    {
         var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
         if (width) {
             if (window.screen.width > width)
                 features+=", left="+(window.screen.width-width)/2;
             else width=window.screen.width;
             features+=", width="+width;
         }
         if (height) {
             if (window.screen.height > height)
                 features+=", top="+(window.screen.height-height)/2;
             else height=window.screen.height;
             features+=", height="+height;
         }
         return window.open(url,windowname,features);
    },

   /**
    * Flashビューア用のウィンドウを開設する。
   **/
    nFlashWin: function(url,windowname,width,height)
    {
         var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
         if (width) {
             if (window.screen.width > width)
                 features+=", left="+(window.screen.width-width)/2;
             else width=window.screen.width;
             features+=", width="+width;
         }
         if (height) {
             if (window.screen.height > height)
                 features+=", top="+(window.screen.height-height)/2;
             else height=window.screen.height;
             features+=", height="+height;
         }
         try {
             return window.open(url,windowname,features);
         } catch (e) {
             return null;
         }
    }
}
