			
			var baseID = "lRow0";
			var sKey = 1;
			
			ListRowViewState = {
				EXPANDED : "expanded",
				COLLAPSED : "collapsed",
				DEFAULT : "default"
			}
			
			DataListRow = new Class({ 
					//Should have a base class usercontrol that takes care of all the housekeeping done below, including
					// event handling and bubbling
					
					//modify initialization to account for a brand new dataList
					initialize:function(element, options){
						if(element)
							var paramType = typeof(element);
							this.el = paramType == "string"? $(element) : element;
							
							if(paramType == "object"){
							//See if existing element on stage
							try{
								this.height = this.el.getStyle('height');
								this.width = this.el.getStyle('width');
								this.opacity = this.el.getStyle('opacity');
							}
							catch(e){}	
						}
						else{
							this.el = document.createElement('div');	
						}
						//alert("current element is " + this.el.id);
						
						this.data = null;
						this.backgroundColor = "#fff";
						this.className = "";
						this.id = this.ID = "";
						this.toolTip = "";
						this.el.setStyle('visibility', 'hidden');
						this.visible = false;
						if(options) this.setOptions(options);
						this.init();
						this.state =  ListRowViewState.DEFAULT;
						this.cache = {};  // Temporarily Hold pointers to eventhandler and other info (Change to Hashmap later)
						this.el.id = baseID + (sKey++).toString();
						//closebutton setup
						/*var closebtn = this.el.getElementById('closeBtn');
						closeBtn.addEvent('click',function(){alert('close clicked');});*/
					},
					
					init:function(){
							
						this.setVisible('visible');
					},
					
					setOptions: function(options){
						if(options.height) this.el.setStyle('height', options.height);
						if(options.width) this.el.setStyle('width', options.width);
						if(options.opacity) this.el.setOpacity(options.opacity);
						if(options.className) this.el.addClass(options.className);
						if(options.id) this.el.id = this.ID = options.id;
						if(options.toolTip) this.el.setAttribute('title', options.toolTip);
						if(options.backgroundColor) this.el.setStyle('background-color', options.backgroundColor);
						if(options.eventHandlers){
							var ind;
							for(opt in options.eventHandlers){
								ind = opt.toString()
								//this.el.addEvent(ind, options.eventHandlers[ind].bindAsEventListener(this));
								this.el["on" + ind] = options.eventHandlers[ind].bindAsEventListener(this);
							}
						}
						
					},
					getBorder:function(){
						return this.el.getStyle('border');
					},
					setBorder:function(value){
						this.el.addClass('dataListHover');
					},
					setVisible:function(value){
						if(value == true){value = 'visible';this.visible = true;}
						if(value == false){value = 'hidden';this.visible = false;}
						this.el.setStyle('visibility', value);
						
					},
					getVisible:function(value){
						return this.el.getStyle('visibility');
					},
					setState:function(value){
						if(value == ListRowViewState.EXPANDED){
							this.cache["onmouseover"] = this.el.onmouseover;
							this.cache["onmouseout"] = this.el.onmouseout;
							this.el.onmouseout = null;
							this.el.onmouseover = null;
							
							this.el.addClass('dataListFocus');
						}
						
						if(value == ListRowViewState.DEFAULT){
							this.el.onmouseover = this.cache["onmouseover"];
							this.el.onmouseout = this.cache["onmouseout"];
							this.cache["onmouseover"] = null;
							this.cache["onmouseout"] = null;
							this.el.removeClass('dataListFocus');
						}
						this.state = value;	
					},
					
					toggleState:function(){
						var curr = this.state;
						if(curr == ListRowViewState.DEFAULT){
							this.state = ListRowViewState.EXPANDED;
							this.setState(ListRowViewState.EXPANDED)
							return;
						}
						else{
							this.state = ListRowViewState.DEFAULT;
							this.setState(ListRowViewState.DEFAULT)
							//hideContent(this);
							return;
						}
						
					}
				});