HW.UI.TabSet.prototype.change = function(n,link) {

		n = typeof(n)=='undefined'?this.state:n;
		if(link && link.hash && this.options.backButton) {
			self.location.hash = link.hash;
			this.current = link.hash;
		}else{
			if(!link){link = this.links[n];}
		}

		if(this.currentLink == link){return;};


		for(var i=0,j=this.links.length;i<j;i++) {
			var li = null, o = this.links[i];
			while(o && o.tagName != 'LI') {
				o = o.parentNode;
			}			
			if(o && o.tagName == 'LI') {
					HW.removeClass(o, 'afterSelected');
			}
		}

		for(var i=0,j=this.links.length;i<j;i++) {
			var li = null, o = this.links[i];
			while(o && o.tagName != 'LI') {
				o = o.parentNode;
			}			
			if(o && o.tagName == 'LI') {
				if(i != n) {
					HW.removeClass(o,this.options.highlight);
				}
				else {
					HW.addClass(o,this.options.highlight);
					var li = null, o = this.links[i+1];
					while(o && o.tagName != 'LI') {
						o = o.parentNode;
					}if(o && o.tagName == 'LI') {
						HW.addClass(o, 'afterSelected');
					}
				}
			}
		}
		this.currentLink = link;

		this.loadContent(link.href);
		this.links[n].blur();
	};

