function SimpleSelector(sToken) {
	this.id = '';
	this.tag = '';
	this.classList = new Array();
	
	this.pseudoClass = '';
	this.counter = '';
	this.not = null;

	var sParts = sToken.split(':');
	if(sParts.length == 2) {	// doesn't support pseudo-elements (length == 3), or multiple pseudo-classes
		var sPseudoParts = sParts[1].split('(');
		this.pseudoClass = sPseudoParts[0];
		if(sPseudoParts.length == 2) {
			var sPseudoArg = sPseudoParts[1].split(')');	// get rid of trailing )
			sPseudoArg = sPseudoArg[0];
			
			switch(this.pseudoClass) {
			case 'not':
				this.not = new SimpleSelector(sPseudoArg);
				break;
			case 'nth-child':
				this.counter = sPseudoArg;
				break;
			}
		}
	}

	sParts = sParts[0].split('#');
	
	if(sParts.length == 1) {	// no id
		var sClassList = sParts[0].split('.');
		this.tag = sClassList[0];
		sClassList.shift();	// removes first element
		this.classList = sClassList;
	} else {					// has id
		this.tag = sParts[0];
		var sClassList = sParts[1].split('.');
		this.id = sClassList[0];
		sClassList.shift();
		this.classList = sClassList;
	}
	SimpleSelector.log += '\n' + this.toString();
}

SimpleSelector.log = '';

p = SimpleSelector.prototype;

p.toString = function () {
	var sSelector = '';
	if(this.tag)
		sSelector += this.tag;
	if(this.id)
		sSelector += '#' + this.id;
	
	for(var i = 0; i < this.classList.length; i++) {
		sSelector += '.' + this.classList[i];
	}
	if(this.pseudoClass) {
		sSelector += ':' + this.pseudoClass;
		if(this.pseudoArgument != undefined) {
			sSelector += '(' + this.pseudoArgument + ')';
		}
	}
	
	return sSelector;
}