var max_width  = 100 ;
var max_height =  100 ;
var _CLASSNAME_BOOKS = "bookBunner";


window.onload = function() {
	var objFontS = document.getElementById("fontS");
	var objFontL = document.getElementById("fontL");
	var screen = document.getElementById("screen");
	var footer = document.getElementById("footer");
	
	objFontL.onclick = function () {
		document.body.style.fontSize = "100%";
		if ( this.getAttribute ( "src" ).match ( "00" ) ) {
			this.setAttribute ( "src" , this.getAttribute ( "src" ).replace ( "00" , "Act01" ) );
		}
		if ( objFontS.getAttribute ( "src" ).match ( "Act01" ) ) {
			objFontS.setAttribute ( "src" , objFontS.getAttribute ( "src" ).replace ( "Act01" , "00" ) );
		}
		screen.style.paddingBottom = "300px";
		footer.style.height = "300px";
	}

	objFontS.onclick = function () {
		document.body.style.fontSize = "80%";
		if ( this.getAttribute ( "src" ).match ( "00" ) ) {
			this.setAttribute ( "src" , this.getAttribute ( "src" ).replace ( "00" , "Act01" ) );
		}
		if ( objFontL.getAttribute ( "src" ).match ( "Act01" ) ) {
			objFontL.setAttribute ( "src" , objFontL.getAttribute ( "src" ).replace ( "Act01" , "00" ) );
		}
		screen.style.paddingBottom = "220px";
		footer.style.height = "220px";
	}
	
	keep_max ();
	
}

/**
 * 画像の縦横比を維持してサイズ変更を行う
 */
function keep_max () {
	for ( i in document.images ) {
		if ( document.images [ i ].className != "bookBunner" ) continue;
		
		document.images [ i ].width = max_width;
		/*
		if ( document.images [ i ].width > document.images [ i ].height && document.images [ i ].width > max_width ) {
			document.images [ i ].width = max_width;
		} else {
			if ( document.images [ i ].height > max_height ) {
				document.images [ i ].height = max_height;
			}
		}
		*/
	}
}


