

var RBaseElementObject = Class.create({

	initialize :

		function(rhForm,key)
		{
			this.rhForm			= rhForm ;
			this.orgForm		= this.rhForm.getOrg() ;
			this.orgElements	= WPUtil.safeArray(this.orgForm[key]) ;
			this.evOrgElement	= undefined ;
			this.length			= this.orgElements.length	;

			this.rhForm.oBody.wrapElements(this.orgElements) ;

		},

	//V1.0 iterator ¹Ýº¹Ã³¸®ÀÚ
	// iterFn ÀÌ false ¸¦ ¸®ÅÏÇÏ¸é Áß´Ü
	iter :

		function(iterFn)
		{
			for(var i = 0 ; i < this.orgElements.length ; i++ )
			{
				rv = iterFn(this.orgElements[i],i) ;

				if(rv != undefined && !rv ) 
					break ;
			}
		},

	// ¼ø¼ö DOM °´Ã¼¸¦ ¹è¿­ ÇüÅÂ·Î ¸®ÅÏÇÑ´Ù.
	// indes : Ã¹ ¹øÂ° ÀÎÀÚ°¡ ÀÖÀ¸¸é , index Element ¸¦ ¸®ÅÏ
	getOrg : 

		function()
		{
			return this.orgElements ;

		},

	// ¼ø¼ö DOM °´Ã¼¸¦ ¹è¿­ÀÇ Ã¹¹øÂ° ¿ä¼Ò¸¦ ¸®ÅÏÇÑ´Ù.
	getaOrg :

		function()
		{
			return this.getOrg()[0] ;

		},

	// ÀÌº¥Æ® ¹ß»ýµÇ¾úÀ» ´ç½ÃÀÇ ¿À¸®Áö³Î ¿¤·¹¸ÕÆ®(DOM) °´Ã¼
	getOrgEv :

		function()
		{
			return this.evOrgElement ;			
		},

	// ¼Ó¼º °ª °¡Á®¿À±â
	getA :
		function (name,index)
		{
			var array = [] ;
			var obj = null ;

			this.iter(
				function(item,cur) {

					if( index == undefined ) 
						array.push(item.getA(name)) ;
					else if( index == cur )	{
						obj = item.getA(name) ;
						return false ;
					}
				}
			) ;

			if( index == undefined )
				return array		;
			else
				return obj	;
		},

	// ½ºÅ¸ÀÏ °ª °¡Á®¿À±â
	getS :

		function(name,index)
		{
			var array = [] ;
			var obj = null ;

			this.iter(
				function(item,cur) {

					if( index == undefined ) 
						array.push(item.getS(name)) ;
					else if( index == cur )	{
						obj = item.getS(name) ;
						return false ;
					}
				}
			) ;

			if( index == undefined )
				return array		;
			else
				return obj	;

		},

	// ÅØ½ºÆ® °ª °¡Á®¿À±â
	getT :

		function(index)
		{
			var array = [] ;
			var obj = null ;

			this.iter(
				function(item,cur) {

					if( index == undefined ) 
						array.push(item.getT()) ;
					else if( index == cur )	{
						obj = item.getT() ;
						return false ;
					}
				}
			) ;

			if( index == undefined )
				return array		;
			else
				return obj	;

		},

	// value °ª °¡Á®¿À±â
	getV :

		function(index)
		{
			var array = [] ;
			var obj = null ;

			this.iter(
				function(item,cur) {

					if( index == undefined ) 
						array.push(item.getV()) ;
					else if( index == cur )	{
						obj = item.getV() ;
						return false ;
					}
				}
			) ;

			if( index == undefined )
				return array		;
			else
				return obj	;

		},


	// ¼Ó¼º °ª ¼¼ÆÃÇÏ±â
	setA :

		function(name,value,index)
		{
			this.iter(
				function(item,cur) {
					if( index == undefined )
						item.setA(name,value) ;
					else if( cur == index )
						item.setA(name,value) ;
				}
			) ;
			
		},

	// ½ºÅ¸ÀÏ °ª ¼¼ÆÃÇÏ±â
	setS :

		function(name,value,index)
		{
			this.iter(
				function(item,cur) {
					if( index == undefined )
						item.setS(name,value) ;
					else if( cur == index )
						item.setS(name,value) ;
				}
			) ;

		},

	// ÅØ½ºÆ® °ª ¼¼ÆÃ
	setT :

		function(value,index)
		{
			var type = ( typeof(value) == "string" ) ? "string" : "array" ;

			this.iter(
				function(item,cur) {

					rvalue = ( type == "string" ) ? value : value[cur] ;

					if( index == undefined )
						item.setT(rvalue) ;
					else if( cur == index )
						item.setT(rvalue) ;
				}
			) ;
		},

	// ÅØ½ºÆ® °ª ¼¼ÆÃ
	// index ±â´É Áö¿ø
	// value : String , Array 
	setV :

		function(value,index)
		{
			var type = ( typeof(value) == "string" ) ? "string" : "array" ;

			this.iter(
				function(item,cur) {

					rvalue = ( type == "string" ) ? value : value[cur] ;

					if( index == undefined )
						item.setV(rvalue) ;
					else if( cur == index )
						item.setV(rvalue) ;
				}
			) ;
		},

	// Ã¼Å©¹Ú½º , ¶óµð¿À¸¸ °¡´ÉÇÑ ¸Þ¼Òµå
	// setCheck(index)
	setC :

		function(index)
		{
			this.iter(
				function(item,cur)
				{	
					if( index == cur )
						item.checked = true ;
				}
			) ;
		},


	// ±¸ºÐÀÚ¸¦ ±âÁØÀ¸·Î ³ª´« ¹è¿­À» °¡Áö°í °ªÀ» ¼¼ÆÃÇÒ ¼ö ÀÖ°Ô ÇÑ´Ù.
	// ¶Ç´Â ±¸ºÐÀÚ°¡ ¾øÀ» °æ¿ì eValue ·Î ÀüºÎ ¼¼ÆÃÇÑ´Ù.
	setVBySpliter :

		function(eValue,spliter)
		{
			var aValue = ( spliter != undefined ) ? eValue.split(spliter) : new Array() ;

			this.iter(
				function(item)
				{
					item.value = ( spliter == undefined ) ? eValue : aValue[i] ;
				}
			) ;

		},

	setOrgEv :

		function(ele)
		{
			this.evOrgElement = ele ;
		},


	// °´Ã¼ »ç¿ë ¿©ºÎ ¼¼ÆÃ
	able :

		function(isAble)
		{
			this.iter(
				function(item) {
					item.able(isAble) ;
				}
			) ;
		},

	// ÀÐ±â Àü¿ëÀ¸·Î ÇÒ°ÍÀÎÁö
	readable :

		function(isAble)
		{
			this.iter(
				function(item) {
					item.readable(isAble) ;
				}
			) ;
		},

	// °´Ã¼ ¼û±â±â V0.5
	// true/false ·£´õ¸µ ¿©ºÎ
	hide :

		function(isRendering)
		{
			this.iter(
				function(item) {
					item.hide(isRendering) ;
				}
			) ;
		},


	// °´Ã¼ º¸ÀÌ±â V0.5
	// true/false ·£´õ¸µ ¿©ºÎ
	show :

		function(isRendering)
		{
			this.iter(
				function(item) {
					item.show(isRendering) ;
				}
			) ;
		}

	


}) ;


// overloading getOrg(index) 
/*
Class.overload.apply(RBaseElementObject,[ 'getOrg',[ String ] , 
	function(index)
	{
			return this.getOrg()[index] ;

	} ]
) ;

*/



