<?php
/**
 * 画像を見る
 * do_image_popup.php
 * @author zhouz
 * @access public
 * @package manager.public_html.dynamicscripts
 */

// クラス・設定読み込み
require_once("../manager_include.inc");
?>

/**
 * 画像を見る。
 * @return
 */
function doImagePopup(url, width, height) {
	var selectpopup = document.getElementById('selectpopup');
	selectpopup.className = "showdialog";
	height = parseInt(height);
	width = parseInt(width);

	var width_min = <?=POPUP_WINDOW_IMAGE_MIN_WIDTH ?>;
	var width_max = <?=POPUP_WINDOW_IMAGE_MAX_WIDTH ?>;
	var height_min = <?=POPUP_WINDOW_IMAGE_MAX_HEIGHT ?>;
	var height_max = <?=POPUP_WINDOW_IMAGE_MAX_HEIGHT ?>;
	if (height > height_max) {
		height = height_max;
	} else if (height < height_min) {
		height = height_min;
	}
	if (width > width_max) {
		width = width_max;
	} else if (width < width_min) {
		width = width_min;
	}

	var html_data = '<table style="width:' + (width - 37) + 'px; height:' + (height - 57) + 'px;"><tr><td class="img_td"><img style="width: 100%;" src="' + url + '"></td></tr></table>';

	doPopup(html_data, width, width, height, height);
}

