
		/*
		*		class version 1.5
		*		create by igear 
		*		2005-12-23
		*/

		// +--------------------------------------------------------+ 
		// | js version .x														 | 
		// +--------------------------------------------------------+ 
		// | Copyright : heo woong <comefeel.com>            | 
		// +--------------------------------------------------------+ 
		// | License  : GPLv3												| 
		// +--------------------------------------------------------+ 

		function igearclass( proto ){

				var obj = function(){ this.__constructor.apply(this , arguments); };
				var Class = {

					__constructor : function(){
						// empty property
					},

					foundIt : function( original , clone ){

						var Dobehavior = new Array (
							
							function(){
								var value = this.i = original.length-1;
								if( value >= 0 )
								do { 

									clone[value] = original[value]; 
								} while ( value-- , this.i-- );
							},

							function(){
								var value = this.i = original.length-1;
								if( value >= 0 )
								do {

									revert = clone( arguments , value , this );
									if( revert != true ) return clone = revert;
								} while ( value-- , this.i-- );
							}
						);

						var Forbehavior = new Array (
							
							function(){
								for( var value in original ){

									clone[value] = original[value];
									this.i++;
								 }
							},

							function(){

								for( var value in original ){

									revert = clone( arguments , value , this );
									if( revert != true ) return clone = revert;
									this.i++;
								 }
							}
						);


						this.i = 0;
						var seq , revert;
						var tyob = this.ty ? this.ty.ob : typeof Object();
						var tyfn = this.ty ? this.ty.fn :  typeof Function();
						var behavior = original != null && original.length ? Dobehavior : Forbehavior;

						switch( typeof clone ){

							case tyob : {
								seq = 0;
								break;
							};

							case tyfn : {
								seq = 1;
								break;
							};

							default : {
								// update schedule...
							};
						}

						void( behavior[seq].apply( this , arguments ));

					return clone;
				},
				
				scrollSize : function(){

					return { 
						top : parseInt(self.pageYOffset ? self.pageYOffset : (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)) , 
						left : parseInt(self.pageXOffset ? self.pageXOffset : (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft)) , 
						width : parseInt(document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth) , 
						height : parseInt(document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight) 
					};
				},

				offsetSize : function(){

					return self.innerWidth ? { width : parseInt(self.innerWidth) , height : parseInt(self.innerHeight) } : 
						( document.documentElement && document.documentElement.clientWidth ? { width : parseInt(document.documentElement.clientWidth) , height : parseInt(document.documentElement.clientHeight) } : { width : parseInt(document.body.clientWidth) , height : parseInt(document.body.clientHeight) } );
				}, 

				bind : function(){

					var args =	new this.foundIt( arguments , [] ).concat(this);
					var alternateFunction = args.shift();
					var needle = args.shift();

					return function(){
						return alternateFunction.apply( needle , args[args.length-1].foundIt( arguments , [] ).concat(args));
					}
				},

				eventCatch : function( source , name , eventFunction ){

					if( !source) return false;

					if( source.addEventListener){
						return source.addEventListener( name , eventFunction , false );
					}
					else if( source.attachEvent )
						return source.attachEvent( String( 'on' + name ) , eventFunction  );
				},

				eventRemove : function( source , name , eventFunction ){

					if( !source) return false;

					if( source.removeEventListener ){
						return source.removeEventListener( name , eventFunction , false );
					}
					else if( source.detachEvent )
						return source.detachEvent( String( 'on' + name ) , eventFunction  );
				},

				eventFire : function( source , name , eventFunction ){

					if( !source) return false;

					if( source.fireEvent ) return source.fireEvent( 'on' + name , this.foundIt( eventFunction , document.createEventObject()));
					else {

							var evt = document.createEvent( eventFunction.eventName );
							evt[eventFunction.eventMathod].apply( evt , Array( name ).concat( eventFunction.eventArgs ));

						return !source.dispatchEvent( evt );
					}
				},

				ty : {

					ob : typeof Object() ,
					fn : typeof Function() ,
					num : typeof Number() ,
					str : typeof String() , 
					bool : typeof Boolean() ,
					not : typeof undefined
				},

				$ : function( name , args ){

					try { return this[name].apply( this , args ? args : [] ); }
					catch( e ){

						var line = e.line || e.number & 0xFFFF || e.lineNumber ;
						var name = e.name ? 'error name : ' + e.name + '\r\n' : String();
						line = line ? 'error line : ' + line + '\r\n' + 'error_messege : ' : String();

						if( confirm( name + line + e.message + '\r\n--------------------------------------------------------\r\n' + 'Document reload ok?') === true )
							self.location.replace( top.document.URL );
					}
				}
			};

		return obj.prototype = Class.foundIt( proto , Class ) , obj;
	};
