/* ******** 情報関連 ***** */ function PJ_OC_AGES_MJ_info(){ var app = "NONE"; if(navigator.userAgent.indexOf("Opera") != -1){ app = "OP"; }else if(navigator.userAgent.indexOf("MSIE") != -1){ app = "IE"; }else if(navigator.userAgent.indexOf("Firefox") != -1){ app = "FF"; }else if(navigator.userAgent.indexOf("Netscape") != -1){ app = "NS"; }else if(navigator.userAgent.indexOf("Safari") != -1){ app = "SF"; } return app; } /* ******** 情報関連 END ***** */ /* ******************* ファイル関連 *************************** */ /*** * 外部JSファイル追加読み込み */ var PJ_OC_AGES_MJ_INCLUDE_FILES_LIST = new Array(); var PJ_OC_AGES_MJ_GLOBAL_FIELD = this; function PJ_OC_AGES_MJ_include(in_filename){ try { if (!PJ_OC_AGES_MJ_INCLUDE_FILES_LIST[in_filename]) { var ap_info = PJ_OC_AGES_MJ_info(); if(ap_info != "FF"){ if (!PJ_OC_AGES_MJ_INCLUDE_FILES_LIST[in_filename]) { document.write(''); } }else{ var hto; if (window.XMLHttpRequest) { try { hto = new XMLHttpRequest(); }catch (e) { hto = null; } }else if(window.ActiveXObject){ try{ hto = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ hto = new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){ hto = null; } } } hto.open("GET", "./Generator/php/js.php?src="+in_filename, false); hto.send(null); if(hto.status == 200){ PJ_OC_AGES_MJ_GLOBAL_FIELD.eval(hto.responseText); } } PJ_OC_AGES_MJ_INCLUDE_FILES_LIST[in_filename] = true; } } catch (e) { alert("PJ_OC_AGES_MJ_include error:" + e); } } /* ******************* ファイル関連END *************************** */ /*************************************************************** * 定数管理リストクラス */ function PJ_OC_AGES_MJ_Const(){ var const_list = new Array(); /*** * 定数を設定する。一度登録してる場合、それ以降は登録できない * @param {Object} name 定数名 * @param {Object} value 値 */ this.set = function(name, value){ if(!const_list[name]){ const_list[name] = value; }else{ PJ_OC_AGES_MJ_alert("PJ_OC_AGES_MJ_Const.set already exist: "+name); } }; /*** * 定数を取得する * @param {Object} name 定数名 */ this.get = function(name){ if(const_list[name] || typeof(const_list[name]) == "number"){ /*if(typeof(const_list[name]) == "object"){ return PJ_OC_AGES_MJ_copyObject(const_list[name]); } return const_list[name];*/ return PJ_OC_AGES_MJ_copyObject(const_list[name]); } PJ_OC_AGES_MJ_alert("PJ_OC_AGES_MJ_Const.get don't exist:"+name); }; } /* ********************************************************* */ /* ***************** 初期化関連 ****************************** */ /*** * ダミーローディング関数 * * window.onloadとは別にローディングを行う為の構造 * 別の箇所でPJ_OC_AGES_MJ_initLoad()を宣言すると、自動的に1回だけ読んでくれる */ var PJ_OC_AGES_MJ_localloading_time = 1; var PJ_OC_AGES_MJ_localloading_function_array = new Array(); var PJ_OC_AGES_MJ_localloading_function_index = 0; function PJ_OC_AGES_MJ_setInit(in_func){ PJ_OC_AGES_MJ_localloading_function_array[PJ_OC_AGES_MJ_localloading_function_index] = new Array(in_func, true); PJ_OC_AGES_MJ_localloading_function_index++; } function PJ_OC_AGES_MJ_dummyLoad(){ try{ if(!document.body.innerHTML ){ throw "non body"; } for(mdl_index=0;mdl_index < PJ_OC_AGES_MJ_localloading_function_index;mdl_index++){ if (PJ_OC_AGES_MJ_localloading_function_array[mdl_index][1]) { if (typeof(PJ_OC_AGES_MJ_localloading_function_array[mdl_index][0]) == "function") { PJ_OC_AGES_MJ_localloading_function_array[mdl_index][0](); } else { eval(PJ_OC_AGES_MJ_localloading_function_array[mdl_index][0]); } PJ_OC_AGES_MJ_localloading_function_array[mdl_index][1] = false; } } }catch(e){ if (PJ_OC_AGES_MJ_localloading_time < 3600000) { PJ_OC_AGES_MJ_localloading_time *= 2; } setTimeout(PJ_OC_AGES_MJ_dummyLoad,PJ_OC_AGES_MJ_localloading_time); } } // ローディング setTimeout(PJ_OC_AGES_MJ_dummyLoad,0); /* ***************** 初期化関連 END ************************** */ PJ_OC_AGES_MJ_include("./Generator/src/main.js");