/// Copyright (c) 2005-2007. Tatter & Company / Needlworks
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
//<![CDATA[
function getObject(target) {
	try {
		switch(typeof(target)) {
			case"undefined":
				return null;
			case"object":
				return target;
			default:
				return document.getElementById(target);
		};
	} catch(e) {
		return null;
	};
};

Standardizer.prototype.namespace = "Eolin.Application.Framework";
Standardizer.prototype.name      = "Eolin Standardizer";
Standardizer.prototype.verion    = "1.0";
Standardizer.prototype.copyright = "Copyright (c) 2005,2008 Needlworks / Tatter & Company. All rights reserved.";

function Standardizer(){};

var ua = navigator.userAgent;
// Microsoft Explorer
Standardizer.prototype.isIE = (ua.indexOf("MSIE")>=0 && document.all);
if(Standardizer.prototype.isIE) {
	Standardizer.prototype.browserVersion  = parseFloat(ua.substr(Math.max(ua.indexOf("MSIE"),0)+4,4));
	Standardizer.prototype.engineVersion  = Standardizer.prototype.browserVersion;
}
// Mozilla Firefox
Standardizer.prototype.isFirefox = (ua.indexOf("Firefox")>=0 || ua.indexOf("IceWeasel")>=0 || ua.indexOf("Minefield")>0);
if(Standardizer.prototype.isFirefox) {
	Standardizer.prototype.browserVersion  = parseFloat(ua.substr(ua.indexOf("Firefox/")+8,10));
	Standardizer.prototype.engineVersion  = parseFloat(ua.substr(Math.max(ua.indexOf("rv:"),0)+3,7));
}
// Webkit / Safari
webkitIndex = Math.max(ua.indexOf("WebKit"), ua.indexOf("Safari"),0);
Standardizer.prototype.isSafari = (ua.indexOf("Safari")>=0);
Standardizer.prototype.isWebkit = (webkitIndex > 0);
if(Standardizer.prototype.isWebkit) {
	Standardizer.prototype.browserVersion  = parseFloat(ua.split("Version/")[1]) || ( ( parseFloat(ua.substr(webkitIndex+7)) >= 419.3 ) ? 3 : 2 ) || 2;
	Standardizer.prototype.engineVersion  = parseFloat(ua.substr(webkitIndex+7));
}
// Opera
Standardizer.prototype.isOpera = (!Standardizer.prototype.isIE&&(ua.indexOf("Opera")>=0));
// Mozilla-compatible
Standardizer.prototype.isMozilla = (!Standardizer.prototype.isIE && !Standardizer.prototype.isFirefox && !Standardizer.prototype.isSafari && !Standardizer.prototype.isOpera && (ua.indexOf("Mozilla")>=0));
Standardizer.prototype.addEventListener = function(object) {
	if(!object.addEventListener)
		object.addEventListener = function addEventListener(type,listener,useCapture) {
			this.attachEvent("on"+type,listener);
		};
	if(!object.removeEventListener)
		object.removeEventListener = function removeEventListener(type,listener,useCapture) {
			this.detachEvent("on"+type,listener);
		};
};

Standardizer.prototype.removeEventListener = function(object) {
	if(object.removeEventListener) return;
	object.removeEventListener = function removeEventListener(type,listener,useCapture) {
		this.detachEvent("on"+type,listener);
	};
};

Standardizer.prototype.event = function(event) {
	if(window.event) {
		event = window.event;
		if(event.target) return event;
		if(event.srcElement) event.target = event.srcElement;
		if(event.preventDefault == undefined)
			event.preventDefault = function() { this.returnValue=false;};
	};
	return event;
};

Standardizer.prototype.getScrollTop = function() {
	return(this.isSafari?document.body.scrollTop:document.documentElement.scrollTop);
};

Standardizer.prototype.getScrollLeft = function() {
	return(this.isSafari?document.body.scrollLeft:document.documentElement.scrollLeft);
};

Standardizer.prototype.addLoadEventListener = function(fn) {
	if (this.isIE) {
		var prevListener = document.onreadystatechange;
		document.onreadystatechange = function() {
			if (prevListener) prevListener();
			if (document.readyState == 'complete') {
				fn();
			}
		};
	} else {
		this.addEventListener(document);
		document.addEventListener('DOMContentLoaded', fn, false);
	}
};

Standardizer.prototype.addUnloadEventListener = function(fn) {
	var prevListener = window.onunload;
	window.onunload = function() {
		if (prevListener) prevListener();
		fn();
	};
};

Standardizer.prototype.querySelector = function(selector) {
	if (document.querySelector) // Firefox 3.1+, IE8+, Webkit x.x+
		return document.querySelector(selector);
	// Here, we only retrieve one element that matches the selector,
	// but this may NOT be fully compatible with W3C specification for now.
	// (Example: ':hover' to get the currently hovered element.)
	// TODO
}

Standardizer.prototype.querySelectorAll = function(selector) {
	if (document.querySelectorAll) // Firefox 3.1+, IE8+, Webkit x.x+
		return document.querySelectorAll(selector);
	// TODO
}

var STD=new Standardizer();
STD.addEventListener(window);
var KeyCode = new function() {
	this.framework = "Eolin AJAX Framework";
	this.name = "Eolin LogViewer";
	this.verion = "1.0";
	this.copyright = "Copyright (c) 2005, Tatter & Company / Needlworks / Tatter Network Foundation. All rights reserved.";
	this.A=65;this.B=66;this.C=67;this.D=68;this.E=69;this.F=70;this.G=71;
	this.H=72;this.I=73;this.J=74;this.K=75;this.L=76;this.M=77;this.N=78;
	this.O=79;this.P=80;this.Q=81;this.R=82;this.S=83;this.T=84;this.U=85;
	this.V=86;this.W=87;this.X=88;this.Y=89;this.Z=90;
	this.Down=40;this.Up=38;this.Left=37;this.Right=39;
};

PageMaster.prototype.namespace = "Eolin.Application.Framework";
PageMaster.prototype.name      = "Eolin Page Master";
PageMaster.prototype.verion    = "1.0";
PageMaster.prototype.copyright = "Copyright (c) 2005, Tatter & Company / Needlworks / Tatter Network Foundation. All rights reserved.";
PageMaster.prototype.message   = "아직 처리중인 작업이 있습니다.";

function PageMaster() {
	this._status = null;
	this._messages = new Array();
	this._requests=new Array();
	this._holders=new Array();
	this._timer=null;
	window.addEventListener("load",PageMaster.prototype._onLoad,false);
	window.addEventListener("beforeunload",PageMaster.prototype._onBeforeUnload,false);
};

PageMaster.prototype._onLoad = function(event) {
	PM._status = document.createElement("div");
	PM._status.style.position = "absolute";
	PM._status.className = "ajaxMessage ajaxProcessingMessage";
	PM._status.style.color = "white";
	PM._status.style.backgroundColor = "navy";
	PM._status.style.margin = "0px";
	PM._status.style.paddingLeft = "10px";
	PM._status.style.paddingRight = "10px";
	STD.addEventListener(window);
	window.addEventListener("scroll",PageMaster.prototype._updateStatus,false);
	window.addEventListener("resize",PageMaster.prototype._updateStatus,false);
};

PageMaster.prototype._showStatus = function() {
	if(PM._status.parentNode == document.body) return;
	document.body.appendChild(this._status);
	this._updateStatus();
};

PageMaster.prototype._hideStatus = function(){
	if(PM._status.parentNode==document.body) document.body.removeChild(PM._status);
};

PageMaster.prototype._updateStatus=function() {
	if(PM._status.parentNode == document.body) {
		PM._status.style.top = (!STD.isSafari?document.documentElement.scrollTop:document.body.scrollTop)+"px";
		PM._status.style.left = ((!STD.isSafari?document.documentElement.scrollLeft:document.body.scrollLeft)+document.documentElement.clientWidth-PM._status.offsetWidth)+"px";
	};
	PM.updateMessages();
};

PageMaster.prototype.autoCompleteBox = function(message,dependElement,otherclassname,dashed,timeout) {
	if((typeof(message) != "string")||(message.length == 0)) return -1;
	if(dependElement==undefined) dependElement = document.body;
	otherclassname = (otherclassname==undefined) ? "" : " "+otherclassname;
	if(dashed==undefined) dashed=22;
	if(timeout==undefined) timeout=7000;
	makeMaskerInvisibile();
	var oMessage = document.createElement("div");
	var fx = new Fx.Tween(oMessage, {duration:1500,wait:false,transition:Fx.Transitions.Quad.easeOut});
	oMessage.innerHTML = message;
	oMessage.style.position="absolute";
	oMessage.className = "search-auto-complete-box"+otherclassname;
	oMessage.style.top = dependElement.offsetTop + dashed + "px";
	oMessage.style.left = dependElement.offsetLeft + "px";
	document.body.appendChild(oMessage);
	fx.start('opacity','0','1');
	var index=this._messages.push(oMessage)-1;

	if (timeout>0) window.setTimeout("PM._hideMessage("+index+")",timeout);
	return index;	
}
PageMaster.prototype.showMessage = function(message,align,valign,timeout) {
	if((typeof(message) != "string")||(message.length == 0)) return -1;
	if(align==undefined) align = "center";
	if(valign==undefined) valign="middle";
	if(timeout==undefined) timeout=5000;
	if(isIE && isMinIE6) makeMaskerInvisibile();
	var ScrollLeft = document.documentElement.scrollLeft;
	var ScrollTop = document.documentElement.scrollTop;
	var oMessage = document.createElement("div");
	var fx = new Fx.Tween(oMessage, {duration:1500,wait:false,transition:Fx.Transitions.Quad.easeOut});
	oMessage.innerHTML = message;
	oMessage.style.position="absolute";
	oMessage.className = "ajaxMessage";
	oMessage.style.margin = "0px";
	oMessage._align = align;
	oMessage._valign = valign;
	document.body.appendChild(oMessage);
	fx.start('opacity','0','1');
	var index=this._messages.push(oMessage)-1;
	this.updateMessages();
	if (timeout>0) window.setTimeout("PM._hideMessage("+index+")",timeout);
	return index;
};

PageMaster.prototype.showSuccessMessage = function(message,align,valign,timeout) {
	if((typeof(message) != "string")||(message.length == 0)) return -1;
	if(align==undefined) align = "center";
	if(valign==undefined) valign="middle";
	if(timeout==undefined) timeout=5000;
	if(isIE && isMinIE6) makeMaskerInvisibile();
	var ScrollLeft = document.documentElement.scrollLeft;
	var ScrollTop = document.documentElement.scrollTop;
	var oMessage = document.createElement("div");
	var fx = new Fx.Tween(oMessage, {duration:1500,wait:false,transition:Fx.Transitions.Quad.easeOut});
	oMessage.innerHTML = "<div align=\"center\"><img src=\""+globalpath+"images/icons/agt_action_success_ok.png\" border=\"0\" width=\"48\" height=\"48\" /></div><br class=\"clear\">"+message;
	oMessage.style.position="absolute";
	oMessage.className = "ajaxMessage ajaxSuccessMessage";
	oMessage.style.margin = "0px";
	oMessage._align = align;
	oMessage._valign = valign;
	document.body.appendChild(oMessage);
	fx.start('opacity','0','1');
	var index=this._messages.push(oMessage)-1;
	this.updateMessages();
	if (timeout>0) window.setTimeout("PM._hideMessage("+index+")",timeout);
	return index;
};

PageMaster.prototype.showErrorMessage = function(message,align,valign,timeout) {
	if((typeof(message) != "string")||(message.length == 0)) return-1;
	if(align==undefined) align = "center";
	if(valign==undefined) valign="middle";
	if(timeout==undefined) timeout=5000;
	if(isIE && isMinIE6) makeMaskerInvisibile();
	var oMessage = document.createElement("div");
	var fx = new Fx.Tween(oMessage, {duration:1500,wait:false,transition:Fx.Transitions.Quad.easeOut});
	oMessage.innerHTML = "<div align=\"center\"><img src=\""+globalpath+"images/icons/agt_action_fail_error.png\" border=\"0\" width=\"48\" height=\"48\" /></div><br class=\"clear\">"+message;
	oMessage.style.position="absolute";
	oMessage.className = "ajaxMessage ajaxErrorMessage";
	oMessage.style.margin = "0px";
	oMessage._align = align;
	oMessage._valign = valign;
	document.body.appendChild(oMessage);
	fx.start('opacity','0','1');
	var index=this._messages.push(oMessage)-1;
	this.updateMessages();
	if (timeout>0) window.setTimeout("PM._hideMessage("+index+")",timeout);
	return index;
};

PageMaster.prototype._hideMessage = function(index) {
	try {
		if(isIE && isMinIE6) makeMaskerInvisibile();
		document.body.removeChild(this._messages[index]);
		this._messages.splice(index,1,null);
		while((this._messages.length>0) && (this._messages[this._messages.length-1] == null)) {
			this._messages.pop();
		}
	} catch(e) { }
};

PageMaster.prototype.updateMessages = function() {
	for(var i=0;i<this._messages.length;i++) {
		if(this._messages[i]==null) continue;
		var ScrollLeft = document.documentElement.scrollLeft;
		var ScrollTop = document.documentElement.scrollTop;
		switch(this._messages[i]._align) {
			case"left":
				this._messages[i].style.left = ScrollLeft+"px";
				break;
			case"center":
				this._messages[i].style.left = (ScrollLeft+(document.documentElement.clientWidth-this._messages[i].offsetWidth)/2)+"px";
				break;
			case"right":
				this._messages[i].style.left = (ScrollLeft+document.documentElement.clientWidth-this._messages[i].offsetWidth)+"px";
				break;
		};
		
		switch(this._messages[i]._valign) {
			case"top":
				this._messages[i].style.top = ScrollTop+"px";
				break;
			case"middle":
				this._messages[i].style.top = (ScrollTop+(document.documentElement.clientHeight-this._messages[i].offsetHeight)/2)+"px";
				break;
			case"bottom":
				this._messages[i].style.top = (ScrollTop+document.documentElement.clientHeight-this._messages[i].offsetHeight)+"px";
				break;
		};
	};
};

PageMaster.prototype.addRequest = function(request,message) {
	this._requests.push(new Array(request,message));
	if(this._status) {
		if(message!=undefined) {
			this._status.innerHTML+=message;this._showStatus();
		}
	}
};

PageMaster.prototype.removeRequest = function(request) {
	for(var i=0;i<this._requests.length;i++) {
		if(this._requests[i][0]==request) {
			this._requests.splice(i,1);
			break;
		};
	};

	var message="";

	for(var i=0;i<this._requests.length;i++) {
		if(this._requests[i][1]!=undefined) message+=this._requests[i][1];
	};
	if(this._status) {
		this._status.innerHTML=message;
		if(message.length==0) this._hideStatus();
		else this._updateStatus();
	};
};

PageMaster.prototype.addHolder = function(holder) {
	this._holders.push(holder);
};

PageMaster.prototype.removeHolder = function(holder) {
	for(var i=0;i<this._holders.length;i++) {
		if(this._holders[i]==holder) {
			this._holders.splice(i,1);
			return;
		};
	};
};

PageMaster.prototype.showPanel = function(panel,halign,valign) {
	try {
		if(typeof(panel)=="string") panel=document.getElementById(panel);
		if(typeof(panel)!="object") return;
		panel.style.position="absolute";
		panel.style.display="block";
		switch(halign) {
			case"left":
				panel.style.left = STD.getScrollLeft()+"px";
				break;
			default:
			case"center":
				panel.style.left = (STD.getScrollLeft()+(document.documentElement.clientWidth-panel.offsetWidth)/2)+"px";
				break;
			case"right":
				panel.style.left = (STD.getScrollLeft()+document.documentElement.clientWidth-panel.offsetWidth)+"px";
				break;
		};

		switch(valign) {
			case"top":
				panel.style.top = STD.getScrollTop()+"px";
				break;
			default:
			case"middle":
				panel.style.top = (STD.getScrollTop()+(document.documentElement.clientHeight-panel.offsetHeight)/2)+"px";
				break;
			case"bottom":
				panel.style.top=(STD.getScrollTop()+document.documentElement.clientHeight-panel.offsetHeight)+"px";
				break;
		};
	} catch(e){};
};

PageMaster.prototype._onBeforeUnload = function(event) {
	event = STD.event(event);
	if(PM._requests.length>0) {
		event.returnValue=PM.message;
		return;
	};
	for(var i=0;i<PM._holders.length;i++) {
		if(PM._holders[i].isHolding()) {
			event.returnValue=PM._holders[i].message;return;
		};
	};
};

var PM=new PageMaster();

PageHolder.prototype.namespace  = "Eolin.Application.Framework";
PageHolder.prototype.name       = "Eolin Page Holder";
PageHolder.prototype.verion     = "1.0";
PageHolder.prototype.copyright  = "Copyright (c) 2005, Tatter & Company. All rights reserved.";
PageHolder.prototype.message    = "Wait..";
PageHolder.prototype.autoDelete = false;

function PageHolder(hold,message){
	PM.addHolder(this);
	switch(arguments.length) {
		default:
		case 2:
			this.message=message;
		case 1:
			this._holding=hold;
			break;
		case 0:
			this._holding=true;
			break;
	};
};

PageHolder.prototype.isHolding = function() {
	return this._holding;
};

PageHolder.prototype.hold = function() {
	this._holding=true;
};

PageHolder.prototype.release=function() {
	this._holding=false;
};

var sUserAgent = navigator.userAgent;
var fAppVersion = parseFloat(navigator.appVersion);

function compareVersions(sVersion1, sVersion2) {

    var aVersion1 = sVersion1.split(".");
    var aVersion2 = sVersion2.split(".");

    if (aVersion1.length > aVersion2.length) {
        for (var i=0; i < aVersion1.length - aVersion2.length; i++) {
            aVersion2.push("0");
        }
    } else if (aVersion1.length < aVersion2.length) {
        for (var i=0; i < aVersion2.length - aVersion1.length; i++) {
            aVersion1.push("0");
        }
    }
    for (var i=0; i < aVersion1.length; i++) {

        if (aVersion1[i] < aVersion2[i]) {
            return -1;
        } else if (aVersion1[i] > aVersion2[i]) {
            return 1;
        }
    }
    return 0;

}

var isOpera = sUserAgent.indexOf("Opera") > -1;
var isMinOpera4 = isMinOpera5 = isMinOpera6 = isMinOpera7 = isMinOpera7_5 = false;

if (isOpera) {
    var fOperaVersion;
    if(navigator.appName == "Opera") {
        fOperaVersion = fAppVersion;
    } else {
        var reOperaVersion = new RegExp("Opera (\\d+\\.\\d+)");
        reOperaVersion.test(sUserAgent);
        fOperaVersion = parseFloat(RegExp["$1"]);
    }

    isMinOpera4 = fOperaVersion >= 4;
    isMinOpera5 = fOperaVersion >= 5;
    isMinOpera6 = fOperaVersion >= 6;
    isMinOpera7 = fOperaVersion >= 7;
    isMinOpera7_5 = fOperaVersion >= 7.5;
}

var isKHTML = sUserAgent.indexOf("KHTML") > -1
              || sUserAgent.indexOf("Konqueror") > -1
              || sUserAgent.indexOf("AppleWebKit") > -1;

var isMinSafari1 = isMinSafari1_2 = false;
var isMinKonq2_2 = isMinKonq3 = isMinKonq3_1 = isMinKonq3_2 = false;
var isSafari = false;
if (isKHTML) {
    isSafari = sUserAgent.indexOf("AppleWebKit") > -1;
    isKonq = sUserAgent.indexOf("Konqueror") > -1;

    if (isSafari) {
        var reAppleWebKit = new RegExp("AppleWebKit\\/(\\d+(?:\\.\\d*)?)");
        reAppleWebKit.test(sUserAgent);
        var fAppleWebKitVersion = parseFloat(RegExp["$1"]);
        isMinSafari1 = fAppleWebKitVersion >= 85;
        isMinSafari1_2 = fAppleWebKitVersion >= 124;
        isMinSafari3 = fAppleWebKitVersion >= 510;
    } else if (isKonq) {

        var reKonq = new RegExp("Konqueror\\/(\\d+(?:\\.\\d+(?:\\.\\d)?)?)");
        reKonq.test(sUserAgent);
        isMinKonq2_2 = compareVersions(RegExp["$1"], "2.2") >= 0;
        isMinKonq3 = compareVersions(RegExp["$1"], "3.0") >= 0;
        isMinKonq3_1 = compareVersions(RegExp["$1"], "3.1") >= 0;
        isMinKonq3_2 = compareVersions(RegExp["$1"], "3.2") >= 0;
    }

}

var isIE = sUserAgent.indexOf("compatible") > -1
           && sUserAgent.indexOf("MSIE") > -1
           && !isOpera;

var isMinIE4 = isMinIE5 = isMinIE5_5 = isMinIE6 = false;

if (isIE) {
    var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
    reIE.test(sUserAgent);
    var fIEVersion = parseFloat(RegExp["$1"]);

    isMinIE4 = fIEVersion >= 4;
    isMinIE5 = fIEVersion >= 5;
    isMinIE5_5 = fIEVersion >= 5.5;
    isMinIE6 = fIEVersion >= 6.0;
}

var isMoz = sUserAgent.indexOf("Gecko") > -1
            && !isKHTML;

var isMinMoz1 = sMinMoz1_4 = isMinMoz1_5 = false;

if (isMoz) {
    var reMoz = new RegExp("rv:(\\d+\\.\\d+(?:\\.\\d+)?)");
    reMoz.test(sUserAgent);
    isMinMoz1 = compareVersions(RegExp["$1"], "1.0") >= 0;
    isMinMoz1_4 = compareVersions(RegExp["$1"], "1.4") >= 0;
    isMinMoz1_5 = compareVersions(RegExp["$1"], "1.5") >= 0;
}

var isNS4 = !isIE && !isOpera && !isMoz && !isKHTML
            && (sUserAgent.indexOf("Mozilla") == 0)
            && (navigator.appName == "Netscape")
            && (fAppVersion >= 4.0 && fAppVersion < 5.0);

var isMinNS4 = isMinNS4_5 = isMinNS4_7 = isMinNS4_8 = false;

if (isNS4) {
    isMinNS4 = true;
    isMinNS4_5 = fAppVersion >= 4.5;
    isMinNS4_7 = fAppVersion >= 4.7;
    isMinNS4_8 = fAppVersion >= 4.8;
}

var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC")
            || (navigator.platform == "Macintosh");

var isUnix = (navigator.platform == "X11") && !isWin && !isMac;

var isWin95 = isWin98 = isWinNT4 = isWin2K = isWinME = isWinXP = false;
var isMac68K = isMacPPC = false;
var isSunOS = isMinSunOS4 = isMinSunOS5 = isMinSunOS5_5 = false;

if (isWin) {
    isWin95 = sUserAgent.indexOf("Win95") > -1
              || sUserAgent.indexOf("Windows 95") > -1;
    isWin98 = sUserAgent.indexOf("Win98") > -1
              || sUserAgent.indexOf("Windows 98") > -1;
    isWinME = sUserAgent.indexOf("Win 9x 4.90") > -1
              || sUserAgent.indexOf("Windows ME") > -1;
    isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1
              || sUserAgent.indexOf("Windows 2000") > -1;
    isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1
              || sUserAgent.indexOf("Windows XP") > -1;
    isWinNT4 = sUserAgent.indexOf("WinNT") > -1
              || sUserAgent.indexOf("Windows NT") > -1
              || sUserAgent.indexOf("WinNT4.0") > -1
              || sUserAgent.indexOf("Windows NT 4.0") > -1
              && (!isWinME && !isWin2K && !isWinXP);
}

if (isMac) {
    isMac68K = sUserAgent.indexOf("Mac_68000") > -1
               || sUserAgent.indexOf("68K") > -1;
    isMacPPC = sUserAgent.indexOf("Mac_PowerPC") > -1
               || sUserAgent.indexOf("PPC") > -1;
}

if (isUnix) {
    isSunOS = sUserAgent.indexOf("SunOS") > -1;

    if (isSunOS) {
        var reSunOS = new RegExp("SunOS (\\d+\\.\\d+(?:\\.\\d+)?)");
        reSunOS.test(sUserAgent);
        isMinSunOS4 = compareVersions(RegExp["$1"], "4.0") >= 0;
        isMinSunOS5 = compareVersions(RegExp["$1"], "5.0") >= 0;
        isMinSunOS5_5 = compareVersions(RegExp["$1"], "5.5") >= 0;
    }
}

/**
*
*  Base64 encode / decode
*  http://www.webtoolkit.info/
*
**/

var Base64 = {

	// private property
	_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

	// public method for encoding
	encode : function (input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;

		input = Base64._utf8_encode(input);

		while (i < input.length) {

			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);

			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;

			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}

			output = output +
			this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
			this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);

		}

		return output;
	},

	// public method for decoding
	decode : function (input) {
		var output = "";
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;

		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

		while (i < input.length) {

			enc1 = this._keyStr.indexOf(input.charAt(i++));
			enc2 = this._keyStr.indexOf(input.charAt(i++));
			enc3 = this._keyStr.indexOf(input.charAt(i++));
			enc4 = this._keyStr.indexOf(input.charAt(i++));

			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;

			output = output + String.fromCharCode(chr1);

			if (enc3 != 64) {
				output = output + String.fromCharCode(chr2);
			}
			if (enc4 != 64) {
				output = output + String.fromCharCode(chr3);
			}

		}

		output = Base64._utf8_decode(output);

		return output;

	},

	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	},

	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;

		while ( i < utftext.length ) {

			c = utftext.charCodeAt(i);

			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}

		}

		return string;
	}

};
//]]!>