//-------------------------------------accessories
function accessories_recipe(info)
{
	this.cat_index = 2;
	this.id = info[0];
	this.name = info[2];
	this.equip_slot = info[3];
	this.mdefpower = info[4];
	this.grade = first_to_upper(info[5]);
	this.no_crystal = info[6];
	this.weight = info[7];

	this.sys_name = info[1].replace(']', '').replace('[', '').replace("'", "");
	this.heading = new Array('Name', 'M.&nbsp;Def.', 'Grade', 'Weight', 'Crystal Count');
	this.screen = info[info.length -1];
	this.qty = info[info.length -2];
	this.icon = info[info.length -4];
	this.ingredients = info[info.length -3];
	this.ingredients = split_ingredients(this.ingredients);
	this.mp = info[info.length -5];
	this.skill = info[info.length -6];
	
	this.row_data = make_row_accessories;
}

function make_row_accessories()
{
	return new Array(this.pic, this.name, this.mdefpower, this.grade, this.weight, this.no_crystal);
}
//-------------------------------------etc
function etc_recipe(info)
{
	this.cat_index = 3;
	this.id = info[0];
	this.name = info[2].replace(/\(Grade (.*)\)/i, '(Grade&nbsp;$1)');
	this.grade = first_to_upper(info[3]);
	this.type = info[4];
	this.obtain = first_to_upper(info[7].replace('1', '-'));
	this.level_req = (this.name.indexOf("High Degree") > 0) ? 40 : ((this.name.indexOf("Dye of") >= 0) ? 20 : '-');
	this.weight = info[5];
	this.pic = info[9];

	this.sys_name = info[1].replace(']', '').replace('[', '').replace("'", "");
	this.heading = new Array('Name', 'Grade', 'Weight', 'Level Req.', 'Obtained From');
	this.screen = info[info.length -1];
	this.qty = info[info.length -2];
	this.icon = info[info.length -4];
	this.ingredients = info[info.length -3];
	this.ingredients = split_ingredients(this.ingredients);
	this.mp = info[info.length -5];
	this.skill = info[info.length -6];
		
	this.row_data = make_row_etc;
}

function make_row_etc()
{
	return new Array(this.pic, this.name, this.grade, this.weight, this.level_req, this.obtain);
}
//-------------------------------------weapons
function weapons_recipe(info)
{
	this.cat_index = 0;
	this.id = info[0];
	this.name = (info[3] == "Dual") ? info[1].replace(/-/i, ' * ') : info[1];
	this.worn_slot = info[5];
	this.speed = info[6];
	this.type = info[3];
	this.patk = info[7];
	this.matk = info[8];
	this.grade = info[4];
	this.no_crystal = info[9];
	this.screenshot = info[10];
	this.pic = info[11];

	this.sys_name = info[2].replace(']', '').replace('[', '').replace("'", "");
	this.heading = new Array('Name', 'Grade', 'Worn Slot', 'Speed', 'P. Atk.', 'M. Atk.', 'Crystal Count');
	this.screen = info[info.length -1];
	this.qty = info[info.length -2];
	this.icon = info[info.length -4];
	this.ingredients = info[info.length -3];
	this.ingredients = split_ingredients(this.ingredients);
	this.mp = info[info.length -5];
	this.skill = info[info.length -6];
	
	this.row_data = make_row_weapon;
}

function make_row_weapon()
{
	return new Array(this.pic, this.name, this.grade, this.worn_slot, this.speed, this.patk, this.matk, this.no_crystal);
}
//-------------------------------------armor
function armor_recipe(info)
{
	this.cat_index = 1;
	this.id = info[0];
	this.name = info[1];
	this.type = info[3];
	this.pdef = info[5];
	this.shielddef = info[6];
	this.grade = info[4];
	this.no_crystal = info[9];
	this.mp_bonus = info[8];
	this.weight = info[7];
	this.screenshot = info[10];
	this.pic = info[11];

	this.sys_name = info[2].replace(']', '').replace('[', '').replace("'", "");
	this.heading = new Array('Name', 'Grade', 'P.&nbsp;Def.', 'Weight', 'MP Bonus', 'Crystal Count');
	this.screen = info[info.length -1];
	this.qty = info[info.length -2];
	this.icon = info[info.length -4];
	this.ingredients = info[info.length -3];
	this.ingredients = split_ingredients(this.ingredients);
	this.mp = info[info.length -5];
	this.skill = info[info.length -6];
		
	this.row_data = make_row_armor;
}

function make_row_armor()
{
	return new Array(this.pic, this.name, this.grade, this.pdef, this.weight, this.mp_bonus, this.no_crystal);
}
//-----------------------------------Item without stats..
function result_item_recipe(info)
{
	this.cat_index = 3;
	this.id = info[0];
	this.name = info[1];
	this.ingredients = split_ingredients(info[2]);
	this.icon = info[3];
	this.qty = info[4];
	this.mp = info[6];
	this.skill = info[5];

	this.heading = new Array();
	this.row_data = make_row_statless;
}
function make_row_statless()
{
	// nothing
	return false;
}
// ---------------------------------ingredient container
function Ingredient(id, qty, name)
{
	this.id = id;
	this.qty = qty;
	this.name = name;
}
//----------------------------------Skill Levels Container
var skill_levels = new Array();
for(i=1; i <= 8; i++)
	skill_levels[i] = new Array();
