function getBlogCategory ($id, $node_id, $depth,  $limit, $class_id)
{
	this.node_id     = $node_id
	this.depth       = $depth;
	this.chara       = $id;
	this.limit       = $limit;
	this.class_id    = $class_id;
	this.defaultHtml = '<option value="">カテゴリを選択してください</option>';

	this.getBlogCategory = function()
	{
		$action.getBlogCategory.execute(this);
	}

	this.getBlogCategoryObject = function()
	{
		return this;
	}

}

$action.getBlogCategory = {
	execute : function($object)
	{
		this.object = $object;
		if(this.object.node_id)
		{
			this.get();
		}
		else
		{
			this.set();
		}
	},
	getObject : function()
	{
		$this = this.object.getBlogCategoryObject();
		return $this;
	},
	get : function()
	{
		var $this = this.getObject();

		var $param      = {depth:$this.depth,object_id:$this.node_id,class_id:$this.class_id,a:'get_blog_category'};
		var $path       = '/ajax/get_category/';
		var $after      = '$action.getBlogCategory.inner()';
		$($this.chara + $this.depth).attr({disabled:true});

		new get( $path, $param, $after );
	},
	inner : function()
	{
		var $response = new ajaxResponse();
		var $this     = this.getObject();

		$($this.chara + $this.depth).html($response.response);
		//$($this.chara + $this.depth).val('');

		if( $($this.chara + $this.depth).attr('disabled') )
		{
			$($this.chara + $this.depth).attr({disabled:false});
			this.set();
		}
	},
	set : function()
	{
		var $this    = this.getObject(); 
		var $_action = this;

		if( $this.depth < $this.limit )
		{
			$($this.chara + $this.depth).change( 
				function()
				{
					var $add   = $(this).val() ? 1 : 0;
					var $depth = parseInt($(this).attr('class').split('depth')[1]) + $add;

					for( $i = $depth; $i < $this.limit; $i++ )
					{
						$($this.chara+($i+1)).html($this.defaultHtml);
						$($this.chara+($i+1)).attr({disabled:true});
					}

					$this.depth   = $depth
					$this.node_id = $(this).val();

					$_action.execute($this);
				}
			 );
		}
	}
}