var Jang={};

Jang.Delegate  ={};

Jang.Delegate.createDelegate  = function(delegateInstance, pointingMethod)
{

			return  function() {

						return  pointingMethod.apply(delegateInstance, arguments);

			}

}


Jang.PageLifecycle = {};

Jang.PageLifecycle.OnLoadHandler  = function(){

			if(window.Page_Load) window.Page_Load();

}


Jang.PageLifecycle.OnUnLoadHandler = function() {

			if(window.Page_UnLoad) window.Page_UnLoad();

}

Jang.DTOFactory = {};

Jang.DTOFactory.CreateDTO = function() {

		return {

							AddProperty   : function(pName){

								this[pName] =null;

							},

							
							DeleteProperty :function(pName) {

									if(typeof(this[pName]) != "function" ) delete this[pName];

							},

							DeleteAllProperty :function() {

									for(var pName in this)
										if(typeof(this[pName]) != "function" ) delete this[pName];

							},

							GetPropertyCount  :function() {

									var Count = 0;

									for(var pName in this )
									  if(typeof(this[pName]) != "function") Count++;

									return Count;
							}
			}

}


Jang.DomPicker  = {};

Jang.DomPicker.$  =function(ElementId)
{

			return document.getElementById(ElementId);
}

Jang.DomPicker.$s  =function(ElementName)
{

			return document.getElementsByName(ElementName);
}



Jang.init  = function() {

		window.onload  = OnLoadCallBack;
		window.onunload = OnUnLoadCallBack;

};




OnLoadCallBack  = Jang.Delegate.createDelegate( this,Jang.PageLifecycle.OnLoadHandler );
OnUnLoadCallBack  = Jang.Delegate.createDelegate( this,Jang.PageLifecycle.OnUnLoadHandler );


$ = Jang.Delegate.createDelegate(this, Jang.DomPicker.$);

$s = Jang.Delegate.createDelegate(this, Jang.DomPicker.$s);

Jang.init();

