/**
 * Cupe face model representation data type
 */
FaceModel = function ( faceParams )
{
	this.faceParams = faceParams;
	this.myModel = 0;
	this.myWoodType = 0;
	this.myGlassType = 0;
	this.myClosed = false;
}

// Adding methods
mixin(FaceModel.prototype, {
	/**
	 * Returing image url function
	 */
	imageSrc: function ()
	{
		url = new jFly("{v root}imgconstructor.php?material_map={v material}&shadow_map={v light}&speckular_map={v specular}&wood={v wood}&glass={v glass}&rnd={v rnd}&closed={v closed}");
		url.root = rootPath;
		url.material = this.faceParams.models[this.myModel].material;
		url.light = this.faceParams.models[this.myModel].light;
		url.specular = this.faceParams.models[this.myModel].specular;
		url.wood = this.faceParams.wood_types[this.myWoodType].file_name;
		url.glass = this.faceParams.glass_types[this.myGlassType].file_name;
		url.rnd = Math.random();
		url.closed = this.myClosed ? 1 : 0;
		if (this.myClosed)
			url.glass = url.wood;
		
		return url.release();
	}
});
