Mys = 
{
	dd : {}, 
	tree : {},
	App : {},
	data : {},
	grid : {},
	Dialog : {},
	menu : {},
	form :{},
	rollOver : function(src)
	{
		this.oldSrc = this.src;
		this.src = src;
	},
	rollOut : function()
	{
		if(this.oldSrc)
			this.src = this.oldSrc;
	}
};

Mys.getSafeArray = function (root)
{
	if(!root)
		return [];
	
	return root.length ? root : [root];
};
Mys.getSafeNumber = function(number)
{
	return parseInt(number, 10) || 0;
};

Mys.getSafeString = function(str)
{
	return str || "";
};

// parentEl에서 id를 찾아서 reture한다. 단 없으면 tag와 class를 이용해서 만들어서 return한다.

Mys.getSafeChildElement = function(parentEl, cls, tag, value, createParentEl)
{
	var el = null;
	
	el = parentEl.child("." + cls);
	if(!el)
	{		
		if (tag && cls)
		{
			if (!createParentEl)
				createParentEl = parentEl;
			
			el = createParentEl.createChild({tag : tag, cls : cls});
		}
	}
	
	if (el && value)
		el.update(value);
	
	return el;
};

//override
Ext.override(Ext.Template, {
	applyTemplate:function(B){if(this.compiled){return this.compiled(B)}var A=this.disableFormats!==true;var E=Ext.util.Format,C=this;var D=function(G,I,L,H){if(L&&A){if(L.substr(0,5)=="this."){return C.call(L.substr(5),B[I],B)}else{if(H){var K=/^\s*['"](.*)["']\s*$/;H=H.split(",");for(var J=0,F=H.length;J<F;J++){H[J]=H[J].replace(K,"$1")}H=[B[I]].concat(H)}else{H=[B[I]]}return E[L].apply(E,H)}}else{return B[I]!==undefined?B[I]:"&nbsp;"}};return this.html.replace(this.re,D)},
	compile:function(){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,name,format,args){if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format="this.call(\""+format.substr(5)+"\", ";args=", values"}}else{args="";format="(values['"+name+"'] == undefined ? '&nbsp;' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"};var body;if(Ext.isGecko){body="this.compiled = function(values){ return '"+this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+"';};"}else{body=["this.compiled = function(values){ return ['"];body.push(this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return this}
});
Date.parseDate = function (A, C) { if(!A) return false; if (Date.parseFunctions[C] == null) { Date.createParser(C); } var B = Date.parseFunctions[C]; return Date[B](A); }
//전역변수들
Global = {};