	gsDom = function(){
	
	      /* Public methods and variables */
	      return {

		      appendChild : function(parentEl, childEl){
		         parentEl.appendChild(childEl);
		         return this;
		      },

		      tagFunc : function(tag){
		         try{
			         return function(){
			             var attrs, children;
			             if(arguments.length > 0){
			                 if(arguments[0].nodeName || typeof arguments[0] == "string"){
			                     children = arguments;
			                 }
			                 else{
			                     attrs = arguments[0];
			                     children = Array.prototype.slice.call(arguments,1);
			                 };
			             }
			             return gsDom.create(tag, attrs, children);
			         };
		         }
		         catch(err){
		             alert(err + " Dom tagFunc()");
		         }
		      },
		      
		      create : function(tag, attrs, children){
		         try{
		             attrs = attrs || {};
		             children = children || {};
		             var el = document.createElement(tag);
		             var attrName = null;
		             for(var attr in attrs){
		                attrName = attr;
		                if(attrName.substr(0,1)=="_"){
		                   attrName = attrName.substr(1);
		                }
		                el.setAttribute(attrName, attrs[attr].toString());
		             }
		             for(var i=0; i< children.length; i++){
		                if(typeof children[i]=="string"){
		                    children[i] = document.createTextNode(children[i]);
		                }
		                el.appendChild(children[i]);
		             }
		             return el;
		         }
		         catch(err){
		             alert(err.message + " DOM create()" + tag+''+ attr);
		         }
		      }	      







		        
	      }; 






	
	}();
	
	
	
	
	
	/* Dom self-executing support function */
	(function(){
	   var els = ("table|tr|th|td|thead|tfoot|tbody|frm|img|br|span|a|h1|h2|h3|h4|h4|h6|hr|ul|li|form|label|p|fieldset|legend|option|textarea|select|form|div|input|fieldset").split("|");
	   var el, i=0;
	   while(el = els[i++]){
	      window['$' + el]= gsDom.tagFunc(el);
	   }
	})();
	
	/* Example usage : 
	li = $li({_class:'record_item'}, 
		                          $label({_for: fieldName}, cols[col].label),
		                          ($input({_class: inputType, id: fieldName, name: fieldName, type: inputType, value: ''}))); 
	*/




