max_width_small  = 270;
max_height_small  = 160;

max_width_big  = 460;
max_height_big  = 330;


//============================================================================
//　関数名　: 　fncKeepMaxSize
//　関数内容：　HTML表示画像の最大縦幅、横幅を指定する（縦横比固定）
//　引数　　：　なし
//　戻り値　：　なし
//============================================================================
function fncKeepMaxSize(){

	for( i in document.images ){
		//代表イメージ
		if( document.images[i].className == 'img_big' ){

			if( document.images[i].width > document.images[i].height ){
				//横幅と指定サイズの比較
				if( document.images[i].width > max_width_big ){
					if( document.images[i].height > max_height_big ){
						document.images[i].height = max_height_big;
						if( document.images[i].width > max_width_big ){
							document.images[i].width = max_width_big;
						}
					}
					else{
						document.images[i].width = max_width_big;
					}
				}
				else{
					if( document.images[i].height > max_height_big ){
						document.images[i].height = max_height_big;
					}
				}
			}
			else{
				if( document.images[i].height > max_height_big ){
					document.images[i].height = max_height_big;
				}
			}
		}

		//写真１〜６
		if( document.images[i].className != 'img_mini' ) continue;

		if( document.images[i].width > document.images[i].height ){

			if( document.images[i].width > max_width_small ){
				if( document.images[i].height > max_height_small ){
					document.images[i].height = max_height_small;
					if( document.images[i].width > max_width_small ){
						document.images[i].width = max_width_small;
					}
				}
				else{
					document.images[i].width = max_width_small;
				}
			}
			else{
				if( document.images[i].height > max_height_small ){
					document.images[i].height = max_height_small;
				}
			}
		}
		else{
			if( document.images[i].height > max_height_small ){
				document.images[i].height = max_height_small;
			}
		}
	}
}
