function openPrintDialog(id)
{
	window.open("/"+id+".html/print", "window_print", "width=650, height=600, scrollbars=yes, menubar=no");
}

function change_font_size(element, action) {
	var max_font_size = 48;
	var min_font_size = 12;
	var current_font_size = parseFloat(element.getStyle('fontSize').replace('px', ''));
	
	if (action == '-') {
		if (current_font_size <= min_font_size) return false;
		current_font_size -= 2;
	} else if (action == '+') {
		if (current_font_size >= max_font_size) return false;
		current_font_size += 2;
	}
	element.setStyle({ fontSize: current_font_size + 'px' });
}

//---------------------------------------------------------------------------------------------------
// 넘겨 보기
//---------------------------------------------------------------------------------------------------
var ThisPhoto = 0;
var ThisWhy = 0;
function ViewNextPre( bnext,divname,cnt ) {
	var i,n,o;
	n = cnt;

	if ( bnext == 1 ) {
		ThisPhoto += 1;
	} else {
		ThisPhoto = ThisPhoto + (n - 1);
	}

	ThisPhoto %= n;

	for(i = 0; i < n; i++) {
		o = document.getElementById(divname + i);
		if(i == ThisPhoto) {
			o.style.display = '';
		} else {
			o.style.display = 'none';
		}
	}
}

//---------------------------------------------------------------------------------------------------
// 자동으로 넘겨 보기
//---------------------------------------------------------------------------------------------------
var bRoll = 0;
function ViewNextPreRolling ( bnext,divname,cnt,timeLimit ) {
	if (bRoll == 0) {
		bRoll = 1;
		setTimeout("ViewNextPreRolling( "+bnext+",'"+divname+"',"+cnt+","+timeLimit+")", timeLimit);
		return
	}

	ViewNextPre(bnext,divname,cnt);
	setTimeout("ViewNextPreRolling( "+bnext+",'"+divname+"',"+cnt+","+timeLimit+")", timeLimit);
}
