// JavaScript Document
//アルバム制御
var pages = 1;

function loadAccordions(){
	var with_px = 900-(31*pages);

	var height_px = 500;
	if(pages > 4){
		height_px = Math.ceil(15 / Math.floor( with_px / 150) )*150;
	}
	

	var Album_option ={
		classNames : {
			toggle : 'horizontal_accordion_toggle',
			toggleActive : 'horizontal_accordion_toggle_active',
			content : 'horizontal_accordion_content'
		},
		defaultSize : {
			height : height_px,
			width : with_px
		},
		direction : 'horizontal'
	};
	Album_Accordion = new accordion("album",Album_option);
	Album_Accordion.activate($$("#album .horizontal_accordion_toggle")[0]);
	
	
	var Content_p = $$("#album .horizontal_accordion_content p");
	Content_p.each(
		function(obj){
			obj.style.height = height_px+'px';
			obj.style.width =with_px+'px';
		}
	);
	if(pages > 4){
		var Content = $$("#album .horizontal_accordion_content");
		Content.each(
			function(obj){
				obj.style.height = height_px+'px';
			}
		);
		var Content = $$("#album  .horizontal_accordion_toggle");
		Content.each(
			function(obj){
				//obj.style.height = (height_px-400)+'px';
				obj.style.backgroundPosition = 'center '+(height_px-60)+'px';
				obj.style.paddingTop = (height_px-10)+'px';
			}
		);
	}
}

var Album_Accordion;
Event.observe(window, 'load', loadAccordions, false);
