/**
 * Keyword
 */
YAHOO.namespace("p3g.keyword");

YAHOO.p3g.keyword.Keyword = function(id, name) {
	this.id = id;
	this.name = name;
}

YAHOO.p3g.keyword.Branch = function() {
	this.keywords = new Array();
}

YAHOO.p3g.keyword.Branch = function() {
	this.keywords = new Array();
}

YAHOO.p3g.keyword.Branch.prototype.getLeaf = function () {
	var leafIndex = this.keywords.length - 1;
	var leaf = this.keywords[leafIndex];
	return leaf;
}

YAHOO.p3g.keyword.Branch.prototype.getAllNames = function () {
	var fullName = '';
	for(var j = 0; j < this.keywords.length; ++j) {
		fullName += this.keywords[j].name;
		if(j < (this.keywords.length - 1)) fullName += ' / ';
	}
	return fullName;
}

YAHOO.p3g.keyword.Branch.prototype.getAllIds = function () {
	var ids = '';
	for(var j = 0; j < this.keywords.length; ++j) {
		ids += this.keywords[j].id;
		if(j < (this.keywords.length - 1)) ids += '|';
	}
	return ids;
}

YAHOO.p3g.keyword.Branch.prototype.getValue = function () {
	return this.getAllIds();
}
