function fncFrameBodyCommon () {
	this.getStatus = function ( target, status ) {
		if ( status == true ) {
			$(target + "_frame_button_open").removeClass("frame_button_open");
			$(target + "_frame_button_open").addClass("frame_button_close");
			$(target + "_frame_body").slideDown("fast");
			return false;
		} else {
			$(target + "_frame_button_open").removeClass("frame_button_close");
			$(target + "_frame_button_open").addClass("frame_button_open");
			$(target + "_frame_body").slideUp("fast");
			return true;
		}
	}
	this.basicFrame = function () {
		//ターゲットフレームタイトル
		$(this.target + "_frame_header_title").text( this.title );
		
		status		= this.status;
		statusName	= this.statusName;
		
		//初期状態
		this.status = this.getStatus( this.target, this.status );
		
		//開閉ボタン
		toggleOpenButton = function ( obj ) {
			return function() {
				$.cookie( obj.statusName, obj.status );
				obj.status = obj.getStatus( obj.target, obj.status );
			}
		}
		$(this.target + "_frame_button_open").click( toggleOpenButton( this ) );
	}
	this.toggleListButton = function ( obj, viewStatus ) {
		return function() {
			$.cookie( obj.viewStatusName, viewStatus );
			obj.viewStatus = viewStatus;
			obj.getList();
		}
	}
}

function fncFrameBodyUser  () {
	this.getList = function() {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile, dataType : "JSONP" };
		var myData = utl.getDataWithAjax( item );
		myData = eval( 'json=' + myData );

		this.total;	//全件数
		target = this.target;
		maxColumns = this.maxColumns;
		this.total = myData.channel.total;
		
		if ( this.viewStatus == true ) {
			if ( this.total == 1 ) {
					items = UtlColumnView.pickupThumbnails ( myData.channel.item );
					$( target + '_frame_body' ).append ( items );
			} else if ( this.total > 1 ) {
				var j = 1;
				for( var i=0; i < myData.channel.item.length; i++ ){
					if ( maxColumns > i ) {
						var items;
						items = UtlColumnView.pickupThumbnails ( myData.channel.item[i] );
						if ( j == 4 ) {
							items += '<div class="c-both"></div>';
							j = 1;
						} else {
							j += 1;
						}
						$( target + '_frame_body' ).append ( items );
					}
				}
			}
		} else {
			if ( this.total == 1 ) {
					items = UtlColumnView.pickupThumbnailList ( myData.channel.item );
					$( target + '_frame_body' ).append ( items );
			} else if ( this.total > 1 ) {
				for( var i=0; i < myData.channel.item.length; i++ ){
					if ( maxColumns > i ) {
						var items;
						items = UtlColumnView.pickupThumbnailList ( myData.channel.item[i] );
						$( target + '_frame_body' ).append ( items );
					}
				}
			}
		}
		$( target + '_frame_body' ).append ( '<div class="c-both"></div>' );
	}
}
fncFrameBodyUser.prototype = new fncFrameBodyCommon;


function fncFrameBodyMovie () {
	this.getList = function () {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile, dataType : "JSONP" };
		var myData = utl.getDataWithAjax( item );
		
		//JSONへ明示的変換
		myData = eval( 'json=' + myData );
		
		this.total;	//全件数
		target = this.target;
		maxColumns = this.maxColumns;
		this.total = myData.channel.total;
		if ( this.viewStatus == true ) {
			if ( this.total == 1 ) {
					items = UtlColumnView.movieThumbnailsSizeS ( myData.channel.item );
					$( target + '_frame_body' ).append ( items );
			} else if ( this.total > 1 ) {
				var j = 1;
				if( myData.channel.item.length == undefined ) {
					if( myData.channel.item.md5Id != '' ){
						items = UtlColumnView.movieThumbnailsSizeS ( myData.channel.item );
						$( target + '_frame_body' ).append ( items );
					}
				} else {
					for( var i=0; i < myData.channel.item.length; i++ ){
						if ( maxColumns > i ) {
							var items;
							items = UtlColumnView.movieThumbnails ( myData.channel.item[i] );
							if ( j == 4 ) {
								items += '<div class="c-both"></div>';
								j = 1;
							} else {
								j += 1;
							}
							$( target + '_frame_body' ).append ( items );
						}
					}
				}
			}
		} else {
			if ( this.total == 1 ) {
					items = UtlColumnView.movieThumbnailList ( myData.channel.item );
					$( target + '_frame_body' ).append ( items );
			} else if ( this.total > 1 ) {
				for( var i=0; i < myData.channel.item.length; i++ ){
					if ( maxColumns > i ) {
						var items;
						items = UtlColumnView.movieThumbnailList ( myData.channel.item[i] );
						$( target + '_frame_body' ).append ( items );
					}
				}
			}
		}
		$( target + '_frame_body' ).append ( '<div class="c-both"></div>' );
	}
}
fncFrameBodyMovie.prototype = new fncFrameBodyCommon;

function fncFrameBodyMovieSizeS () {
	this.getList = function () {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile, dataType : "JSONP" };
		var myData = utl.getDataWithAjax( item );
		
		//JSONへ明示的変換
		myData = eval( 'json=' + myData );
		
		target = this.target;
		maxColumns = this.maxColumns;
		this.total = myData.channel.total;
		
		if ( this.viewStatus == true ) {
			if ( this.total == 1 ) {
					items = UtlColumnView.movieThumbnailsSizeS ( myData.channel.item );
					$( target + '_frame_body' ).append ( items );
			} else if ( this.total > 1 ) {
				var j = 1;
				for( var i=0; i < myData.channel.item.length; i++ ){
					if ( maxColumns > i ) {
						var items;
						items = UtlColumnView.movieThumbnailsSizeS ( myData.channel.item[i] );
						if ( j == 2 ) {
							items += '<div class="c-both"></div>';
							j = 1;
						} else {
							j += 1;
						}
						$( target + '_frame_body' ).append ( items );
					}
				}
			}
		} else {
			if ( this.total == 1 ) {
					items = UtlColumnView.movieThumbnailListSizeS ( myData.channel.item );
					$( target + '_frame_body' ).append ( items );
			} else if ( this.total > 1 ) {
				for( var i=0; i < myData.channel.item.length; i++ ){
					if ( maxColumns > i ) {
						var items;
						items = UtlColumnView.movieThumbnailListSizeS ( myData.channel.item[i] );
						$( target + '_frame_body' ).append ( items );
					}
				}
			}
		}
		$( target + '_frame_body' ).append ( '<div class="c-both"></div>' );
	}
}
fncFrameBodyMovieSizeS.prototype = new fncFrameBodyCommon;


function fncFrameBodySimpleColumn () {
	this.getList = function () {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile };
		var myData = utl.getDataWithAjax( item );

		target = this.target;
		maxColumns = this.maxColumns;

		$(myData).find("item ").each(function( i ){
			if ( maxColumns > i ) {
				var items;
				items = UtlColumnView.newColumn ( $(this) );
				$( target + '_frame_body' ).append ( items );
			}
		});
		$( target + '_frame_body' ).append ( '<div class="c-both"></div>' );
	}
}
fncFrameBodySimpleColumn.prototype = new fncFrameBodyCommon;

function fncFrameBodyRankingPopC () {
	this.getList = function () {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile };
		var myData = utl.getDataWithAjax( item );

		this.total;	//全件数
		target = this.target;
		maxColumns = this.maxColumns;

		//ランキング種リンク
		var link;
		link  = '<div id="ranking_navi_box">';
		link += '	<div id="ranking_navi_type">';
		link += '		再生回数ランキング作品別｜';
		link += '		<a href="./?o=u&r=pop">再生回数ランキングユーザ別</a>｜';
//		link += '		<a href="./?o=c&r=fav">お気に入りランキング作品別</a>｜';
//		link += '		<a href="./?o=u&r=fav">お気に入りランキングユーザ別</a>';
		link += '	</div>';
		link += '	<div id="ranking_navi_term">';
		link += '		<a href="./?o=c&r=pop&t=d">日ごと</a>｜';
		link += '		<a href="./?o=c&r=pop&t=w">週ごと</a>｜';
		link += '		<a href="./?o=c&r=pop&t=m">月ごと</a>';
		link += '	</div>';
		link += '</div>';
		$( target + '_frame_body' ).append( link );

		this.total = $(myData).find("total").text();
		if ( this.viewStatus == true ) {
			var j = 1;
			$(myData).find("item").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingPopCThumbnails ( $(this) );
					if ( j == 4 ) {
						items += '<div class="c-both"></div>';
						j = 1;
					} else {
						j += 1;
					}
					$( target + '_frame_body' ).append( items );
				}
			});
		} else {
			$(myData).find("item ").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingPopCList( $(this) );
					$( target + '_frame_body' ).append( items );
				}
			});
		}
		$( target + '_frame_body' ).append( '<div class="c-both"></div>' );
	}
}
fncFrameBodyRankingPopC.prototype = new fncFrameBodyCommon;

function fncFrameBodyRankingFavC () {
	this.getList = function () {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile };
		var myData = utl.getDataWithAjax( item );

		this.total;	//全件数
		target = this.target;
		maxColumns = this.maxColumns;

		//ランキング種リンク
		var link;
		link  = '<div id="ranking_navi_box">';
		link += '	<div id="ranking_navi_type">';
		link += '		<a href="./?o=c&r=pop">再生回数ランキング作品別</a>｜';
		link += '		<a href="./?o=u&r=pop">再生回数ランキングユーザ別</a>｜';
//		link += '		お気に入りランキング作品別｜';
//		link += '		<a href="./?o=u&r=fav">お気に入りランキングユーザ別</a>';
		link += '	</div>';
		link += '	<div id="ranking_navi_term">';
		link += '		<a href="./?o=c&r=fav&t=d">日ごと</a>｜';
		link += '		<a href="./?o=c&r=fav&t=w">週ごと</a>｜';
		link += '		<a href="./?o=c&r=fav&t=m">月ごと</a>';
		link += '	</div>';
		link += '</div>';
		$( target + '_frame_body' ).append( link );

		this.total = $(myData).find("total").text();
		if ( this.viewStatus == true ) {
			var j = 1;
			$(myData).find("item ").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingFavCThumbnails( $(this) );
					if ( j == 4 ) {
						items += '<div class="c-both"></div>';
						j = 1;
					} else {
						j += 1;
					}
					$( target + '_frame_body' ).append( items );
				}
			});
		} else {
			$(myData).find("item ").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingFavCList( $(this) );
					$( target + '_frame_body' ).append( items );
				}
			});
		}
		$( target + '_frame_body' ).append( '<div class="c-both"></div>' );
	}
}
fncFrameBodyRankingFavC.prototype = new fncFrameBodyCommon;

function fncFrameBodyRankingPopU () {
	this.getList = function () {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile };
		var myData = utl.getDataWithAjax( item );

		this.total;	//全件数
		target = this.target;
		maxColumns = this.maxColumns;

		//ランキング種リンク
		var link;
		link  = '<div id="ranking_navi_box">';
		link += '	<div id="ranking_navi_type">';
		link += '		<a href="./?o=c&r=pop">再生回数ランキング作品別</a>｜';
		link += '		再生回数ランキングユーザ別｜';
//		link += '		<a href="./?o=c&r=fav">お気に入りランキング作品別</a>｜';
//		link += '		<a href="./?o=u&r=fav">お気に入りランキングユーザ別</a>';
		link += '	</div>';
		link += '	<div id="ranking_navi_term">';
		link += '		<a href="./?o=u&r=pop&t=d">日ごと</a>｜';
		link += '		<a href="./?o=u&r=pop&t=w">週ごと</a>｜';
		link += '		<a href="./?o=u&r=pop&t=m">月ごと</a>';
		link += '	</div>';
		link += '</div>';
		$( target + '_frame_body' ).append( link );

		this.total = $(myData).find("total").text();
		if ( this.viewStatus == true ) {
			var j = 1;
			$(myData).find("item ").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingPopUThumbnails( $(this) );
					if ( j == 4 ) {
						items += '<div class="c-both"></div>';
						j = 1;
					} else {
						j += 1;
					}
					$( target + '_frame_body' ).append( items );
				}
			});
		} else {
			$(myData).find("item ").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingPopUList( $(this) );
					$( target + '_frame_body' ).append( items );
				}
			});
		}
		$( target + '_frame_body' ).append( '<div class="c-both"></div>' );
	}
}
fncFrameBodyRankingPopU.prototype = new fncFrameBodyCommon;

function fncFrameBodyRankingFavU () {
	this.getList = function () {
		//リストをクリア
		$( this.target + '_frame_body' ).empty();
		//XML読み込み
		var item = { url : this.xmlFile };
		var myData = utl.getDataWithAjax( item );

		this.total;	//全件数
		target = this.target;
		maxColumns = this.maxColumns;

		//ランキング種リンク
		var link;
		link  = '<div id="ranking_navi_box">';
		link += '	<div id="ranking_navi_type">';
		link += '		<a href="./?o=c&r=pop">再生回数ランキング作品別</a>｜';
		link += '		<a href="./?o=u&r=pop">再生回数ランキングユーザ別</a>｜';
//		link += '		<a href="./?o=c&r=fav">お気に入りランキング作品別</a>｜';
//		link += '		お気に入りランキングユーザ別';
		link += '	</div>';
		link += '	<div id="ranking_navi_term">';
		link += '		<a href="./?o=u&r=fav&t=d">日ごと</a>｜';
		link += '		<a href="./?o=u&r=fav&t=w">週ごと</a>｜';
		link += '		<a href="./?o=u&r=fav&t=m">月ごと</a>';
		link += '	</div>';
		link += '</div>';
		$( target + '_frame_body' ).append( link );

		this.total = $(myData).find("total").text();
		if ( this.viewStatus == true ) {
			var j = 1;
			$(myData).find("item ").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingFavUThumbnails( $(this) );
					if ( j == 4 ) {
						items += '<div class="c-both"></div>';
						j = 1;
					} else {
						j += 1;
					}
					$( target + '_frame_body' ).append( items );
				}
			});
		} else {
			$(myData).find("item ").each(function( i ){
				if ( maxColumns > i ) {
					var items;
					items = UtlColumnView.rankingFavUList( $(this) );
					$( target + '_frame_body' ).append( items );
				}
			});
		}
		$( target + '_frame_body' ).append( '<div class="c-both"></div>' );
	}
}
fncFrameBodyRankingFavU.prototype = new fncFrameBodyCommon;
