//ライセンス情報はAgeOnフォルダのLISENCEフォルダを参照してください

 /*JavaScriptを参考にさせていただいたサイト
 * http://www.tagindex.com/javascript/window/scroll.html
 */
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;
using System.Drawing;
using System.Threading;
using System.Net;
using System.IO;
using nispi.AgeOnDebuger;
using nispi.OptionControl;

namespace nispi
{
    static partial class Const
    {
        public static Mutex mutex = new Mutex(false, "Const");

        public static Mutex threadInfoMutex = new Mutex(false, "ThreadInfo");
        public const string Default_Style_Sheet =
            "div.res_title {\r\n" +
            "  white-spece: nowrap;\r\n" +
            "  padding-bottom: 0.2em;\r\n" +
            "}\r\n" +
            "div.res_body {\r\n" +
            "  margin-left: 3em;\r\n" +
            "}\r\n";


        public const string ScrollJavaScript =
            "<script type=\"text/javascript\">\r\n" +
            "<!--\r\n" +
            "function scroll(){{\r\n" +
            "window.scrollTo({0},{1});\r\n" +
            "}}\r\n" +
            "window.setTimeout( scroll, 0 );" +
            "// -->\r\n" +
            "</script>\r\n";

        public static MainForm form;

        public static MapMainForm mapForm;

        public static OptionMainForm opt;

        public static AddFavoriteForm addFavoriteForm;

        //public static DebugMainForm debugForm;

        public const string Version = "1.0.0";

        public static string UPDATE_CHECK_URL = "http://maedanaoki.jp/software/ageon/update.txt";
        public static string USER_AGENT = "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0";//"Monazilla/1.00 (AgeOn/1.1)";

        public static string BOARD_INDEX_ADDRESS = "http://menu.2ch.net/bbsmenu.html";
        public static string SC_BOARD_INDEX_ADDRESS = "http://menu.2ch.sc/bbsmenu.html";
        public static string OPEN2CH_BOARD_INDEX_ADDRESS = "http://open2ch.net/menu/pc_menu.html";
        public static string NEXT2CH_BOARD_INDEX_ADDRESS = "http://next2ch.net/bbsmenu2";
        public static string BLOGBAN_BOARD_INDEX_ADDRESS = "http://blogban.net/bbsmenu.html";
        public static string JIKKYO_BOARD_INDEX_ADDRESS = "http://jikkyo.org/menu.html";
        public static string SHIZU_BOARD_INDEX_ADDRESS = "http://shizu.0000.jp/bbsmenu.html";

        public static string VIP2CH_BOARD_INDEX_ADDRESS = "http://ex14.vip2ch.com/bbsmenu.html";
        public static string MACHIBBS_BOARD_INDEX_ADDRESS = "http://www.machi.to/i.html";

        //public static string MainDir;
        public static string CurrentDir;
        public static string DataDir;
        public static string DataDirNonAgeon;

        public static string LOG_FOLDER_NAME = ".ageon";

        public static int DisplayX;
        public static int DisplayY;

        public static string session_id = "";
        
        public static string hiddenValue = "";
        public static string hiddenName = "";
        
        public static List<string> _2chHiddenValue = new List<string>();
        public static List<string> _2chHiddenName = new List<string>();

        public static List<string> _2chscHiddenValue = new List<string>();
        public static List<string> _2chscHiddenName = new List<string>();

        public static List<string> open2chHiddenValue = new List<string>();
        public static List<string> open2chHiddenName = new List<string>();

        public static List<string> next2chHiddenValue = new List<string>();
        public static List<string> next2chHiddenName = new List<string>();

        public static List<string> jikkyoHiddenValue = new List<string>();
        public static List<string> jikkyoHiddenName = new List<string>();

        public static List<string> vip2chHiddenValue = new List<string>();
        public static List<string> vip2chHiddenName = new List<string>();

        public static List<string> shizuHiddenValue = new List<string>();
        public static List<string> shizuHiddenName = new List<string>();

        public static List<string> blogbanHiddenValue = new List<string>();
        public static List<string> blogbanHiddenName = new List<string>();

        public static List<string> machiHiddenValue = new List<string>();
        public static List<string> machiHiddenName = new List<string>();

        public static List<string> jbbsHiddenValue = new List<string>();
        public static List<string> jbbsHiddenName = new List<string>();

        public static string roninSessionID = "";
        public static bool roninState = false;

        public static bool beState = false;
        public static bool beSCState = false;

        public static CookieCollection cookieCollection = new CookieCollection();

        public static CookieCollection beCookieCollection = new CookieCollection();

        public static string ScreeningPath = Path.DirectorySeparatorChar +
                ".ageon" + Path.DirectorySeparatorChar +
                "cache" + Path.DirectorySeparatorChar +
                "screening" + Path.DirectorySeparatorChar;

        public static Size InnerMainFormType1Size;

        public static bool onLine = true;

        public static void GetMainDir()
        {
            string dir = System.Reflection.Assembly.GetEntryAssembly().Location;
            string process = Process.GetCurrentProcess().ProcessName.Split('.')[0];
            int num = dir.LastIndexOf(process);//,0);
            CurrentDir = dir.Remove(num - 1);//, dir.Length);

            //データ格納、保存用のディレクトリ
            //DataDir = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "AgeOn";
            //DataDirNonAgeon = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            DataDir = CurrentDir;// +Path.DirectorySeparatorChar + ".ageon";
            DataDirNonAgeon = CurrentDir;// +Path.DirectorySeparatorChar;
        }

        public static void GetDisplaySize()
        {
            Size size = Const.form.mainForm.GetDisplaySize();
            //ディスプレイの高さ
            DisplayY = size.Height;
            //ディスプレイの幅
            DisplayX = size.Width;
        }
    }
}
