var __COMMON_LOAD__ = true;
var __isDebugging = false;
var __debugEl = null;
var __bnComList = new bnMap();
function log_debug(msg) {
if (!__isDebugging) return;
if (__debugEl == null) {
__debugEl = document.getElementById("__debugEl");
if (__debugEl == null) {
document.write('
');
document.getElementById("__debugEl").value="";
__debugEl = document.getElementById("__debugEl");
}
}
__debugEl.value += msg + "\n";
}
function bnWindowOnload(func) {
var _me = this;
this.window_onload_old = window.onload;
window.onload = function() {
if (_me.window_onload_old) _me.window_onload_old();
func();
}
}
// Á¶°ÇÀÌ ¸ÂÀ»¶§±îÁö ¹Ýº¹À» °è¼ÓÇÏ´Ù°¡ Á¶°ÇÀÌ ¸¸Á·µÇ¸é runFuncÀ» ¼öÇàÈÄ Á¾·áÇÑ´Ù.
function bnWaitOnload(condiFunc, runFunc) {
if (condiFunc()) {
runFunc();
} else {
setTimeout("bnWaitOnload(" + condiFunc + "," + runFunc + ")", 100);
}
}
Object.extend = __Object_extend;
Object.prototype.isArray = false;
Object.prototype.infoString = function(option) { return ObjectInfoToString(this, option); };
Object.prototype.attr = __Object_attr;
Array.prototype.isArray = true;
Array.prototype.findValueIndex = __Array_findValueIndex;
String.prototype.repeat = __String_repeat;
String.prototype.toBnString = function() { return new bnString(this.toString()); }
/* from Prototype.js
* Prototype JavaScript framework, version 1.5.1
* (c) 2005-2007 Sam Stephenson
*/
// [ -------------------------------------------------------------------------------
var Try = {
these: function() {
var returnValue;
for (var i = 0, length = arguments.length; i < length; i++) {
var lambda = arguments[i];
try {
returnValue = lambda();
break;
} catch (e) {}
}
return returnValue;
}
}
function __Object_extend(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
return destination;
}
// ] -------------------------------------------------------------------------------
function __bnObjectBase(id1) {
this.Version = "0.0.1";
this.id = id1;
this.objName = "";
this.toString = function() { return "[bnObject." + this.objName + "] " + this.id; }
}
/*
function bnMap() {
var ret = [];
ret["tmp"] = __bnObjectBase; ret.tmp(""); delete ret.tmp; ret.objName = "bnMap";
ret.add = function(key, obj) {
if (arguments.length>1) {
if (!!this[key] || !isNaN(key)) return;
this[key] = obj;
}
this[this.length] = obj;
};
ret.remove = function __remove(key) {
if (!(!!this[key])) return;
delete this[key];
};
return ret;
}
*/
function bnString(str1) {
var str=str1;
this.toString = function() { return str; }
}
function ArrayEx(x,y) {
var ret = new Array();
ret.length = x;
for (var i=0; i=0 ? true : false;
var isShowFunction = option.search(/F/i)>=0 ? true : false;
if (obj.isArray) {
ret[ret.length] = "<[Array]>";
} else {
ret[ret.length] = "<[" + obj + "]>";
}
for (var prop in obj) {
if (typeof obj[prop] == "function") {
if (prop=="toString") {
ret[ret.length] = "function " + prop + "() = \"" + obj.toString() + "\"";
} else {
if (isShowFunction) ret[ret.length] = "function " + prop + "()";
}
} else {
try {
var tmp = "property " + prop;
if (obj[prop].isArray) tmp += "[" + obj[prop].length + "]";
tmp += "=[";
if (typeof obj[prop] == "object" && !!obj.tagName==false && obj[prop]!=null && isExpand==true) {
tmp += "\n\t" + obj[prop].infoString(option).replace(/\n/g,"\n\t") + "\n";
} else {
tmp += eval("obj[\"" + prop + "\"]");
}
ret[ret.length] = tmp + "]";
} catch(e) {
ret[ret.length] = prop + "=[ERROR : " + e.desc + "]";
}
}
}
return ret.join("\n");
}
/*
=============================================================
HTTP Status Code
=============================================================
100: // Section 10.1.1: Continue
101: // Section 10.1.2: Switching Protocols
200: // Section 10.2.1: OK
201: // Section 10.2.2: Created
202: // Section 10.2.3: Accepted
203: // Section 10.2.4: Non-Authoritative Information
204: // Section 10.2.5: No Content
205: // Section 10.2.6: Reset Content
206: // Section 10.2.7: Partial Content
300: // Section 10.3.1: Multiple Choices
301: // Section 10.3.2: Moved Permanently
302: // Section 10.3.3: Found
303: // Section 10.3.4: See Other
304: // Section 10.3.5: Not Modified
305: // Section 10.3.6: Use Proxy
307: // Section 10.3.8: Temporary Redirect
400: // Section 10.4.1: Bad Request
401: // Section 10.4.2: Unauthorized
402: // Section 10.4.3: Payment Required
403: // Section 10.4.4: Forbidden
404: // Section 10.4.5: Not Found
405: // Section 10.4.6: Method Not Allowed
406: // Section 10.4.7: Not Acceptable
407: // Section 10.4.8: Proxy Authentication Required
408: // Section 10.4.9: Request Time-out
409: // Section 10.4.10: Conflict
410: // Section 10.4.11: Gone
411: // Section 10.4.12: Length Required
412: // Section 10.4.13: Precondition Failed
413: // Section 10.4.14: Request Entity Too Large
414: // Section 10.4.15: Request-URI Too Large
415: // Section 10.4.16: Unsupported Media Type
416: // Section 10.4.17: Requested range not satisfiable
417: // Section 10.4.18: Expectation Failed
500: // Section 10.5.1: Internal Server Error
501: // Section 10.5.2: Not Implemented
502: // Section 10.5.3: Bad Gateway
503: // Section 10.5.4: Service Unavailable
504: // Section 10.5.5: Gateway Time-out
505: // Section 10.5.6: HTTP Version not supported
=============================================================
*/
/*
=============================================================
XMLHttpRequest readyState Code
=============================================================
0 : // uninitialized
1 : // loading
2 : // loaded
3 : // interactive
4 : // complete
=============================================================
*/
function bnXHR(url1, param, callbackFunc) {
var xmlHttp;
var me = this;
var url=url1;
this.stateChange = __stateChange;
this.onError = !!callbackFunc.err ? callbackFunc.err : function() {};
this.onComplete = !!callbackFunc.done ? callbackFunc.done : function() {};
this.response2Object = function() {
var ret = null;
try {
ret = eval("(" + xmlHttp.responseText + ")");
} catch(e) { ret = null; }
return ret;
}
_init();
function _init() {
xmlHttp = Try.these(
function() {return new XMLHttpRequest()},
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
function() {return new ActiveXObject('Microsoft.XMLHTTP')}
) || false;
if (!xmlHttp) { log_debug("bnXHR initialize failure !!"); return; }
log_debug("bnXHR request : " + url + " [" + param + "]");
xmlHttp.onreadystatechange = me.stateChange;
// xmlHttp.open("GET", url, true);
// xmlHttp.send(null);
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", param.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(param);
}
function __stateChange() {
switch(xmlHttp.readyState) {
case 1:
log_debug("xmlHttp State 1 : loading");
break;
case 2:
log_debug("xmlHttp State 2 : load");
break;
case 3:
log_debug("xmlHttp State 3 : interactive");
break;
case 4:
log_debug("xmlHttp State 4 : complete - " + "[xmlHttp status] : " + xmlHttp.status + " - " + xmlHttp.statusText);
if (xmlHttp.status<400) {
if (xmlHttp.status==200) {
me.onComplete(me, xmlHttp);
}
} else {
alert("???");
}
break;
}
}
}
// from prototype.js
function $() {
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
function bnArrayMap() {
var items = new Array();
items._member = new Object();
this.add = __add;
this.isExist = function(key) { return !!items._member[key]; }
this.items = function(key) { return !isNaN(key) ? items._member[items[key]] : items._member[key]; }
this.remove = __remove;
this.clear = function() { items = new Array(); items._member = new Object(); }
this.join = __join;
this.count = 0;
this.realCount = function() { return items.length; }
this.keys = function() {
var ret = [];
for (var i=0; i=items.length) return;
dkey = items._member[items[key]];
} else {
if (!this.isExist(key)) return;
for (var i=0; i0 ? ret.join(dl1) : "";
}
}
/* ¹Ý¿Ã¸² */
function round(a, b) {
var tmp = 1;
for (var i=0; i