var data = new Array();

function Genle(arg1){
	this.title = arg1;
	this.item  = new Array();

	this.addItem      = addItem;
	this.addSeparator = addSeparator;
}

function Item(arg1,arg2,arg3,arg4,arg5){
	this.site   = arg1;
	this.admin  = arg2;
	this.url    = arg3;
	this.banner = arg4;
	this.memo   = arg5;
}

function Separator(){
}

function setGenle(arg1){
	var calc = new Array();

	for(calc[0]=0; calc[1] = data[calc[0]]; calc[0]++){
		if(calc[1].title == arg1) return calc[1];
	}

	data[data.length] = new Genle(arg1);
	return data[data.length-1];
}

function addItem(arg1,arg2,arg3,arg4,arg5){
	if(! this instanceof Genle) return;

	this.item[this.item.length] = new Item(arg1,arg2,arg3,arg4,arg5);
}

function addSeparator(){
	if(! this instanceof Genle) return;

	this.item[this.item.length] = new Separator();
}

function getGenle(arg){
	return data[decodeGenle(arg)];
}

function getItem(arg){
	return data[decodeGenle(arg)].item[decodeItem(arg)];
}

function decodeGenle(arg){
	return arg.substr(0,arg.indexOf("-"));
}

function decodeItem(arg){
	return arg.substr(arg.indexOf("-")+1);
}
