// Ãâ·ÂÇÏ±â - html ÆäÀÌÁö
function jsPrint()
{
    var width = 735;
    var height = 600;
	var x, y;
	var screen_width  = screen.width;
	var screen_height = screen.height;
	x = (screen_width  / 2) - (width  / 2);
	y = (screen_height / 2) - (height / 2);
	var pop = window.open ( "/js/print/for_print.htm","print","width=" + width + ", height=" + height + ", left=" + x + ", top=" + y + ", toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes");
	pop.focus();
	return;
}

//°Ô½ÃÆÇ
function jsPrintBoard()
{
    var width = 735;
    var height = 600;
	var x, y;
	var screen_width  = screen.width;
	var screen_height = screen.height;
	x = (screen_width  / 2) - (width  / 2);
	y = (screen_height / 2) - (height / 2);
	var pop = window.open ( "/js/print/for_print_board.htm","print","width=" + width + ", height=" + height + ", left=" + x + ", top=" + y + ", toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes");
	pop.focus();
	return;
}

//ÀÌ¸ÞÀÏ ¹ß¼Û - htmlÆäÀÌÁö
function jsMailling() {
    var width = 735;
    var height = 600;
	var x, y;
	var screen_width  = screen.width;
	var screen_height = screen.height;
	x = (screen_width  / 2) - (width  / 2);
	y = (screen_height / 2) - (height / 2);
	var pop = window.open ( "/template/html/maf_kor/user/common/user.mail_form.vm","print","width=" + width + ", height=" + height + ", left=" + x + ", top=" + y + ", toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes");
	pop.focus();
	return;
}

//ÀÌ¸ÞÀÏ ¹ß¼Û - htmlÆäÀÌÁö
function jsMaillingBoard() {
    var width = 700;
    var height = 600;
	var x, y;
	var screen_width  = screen.width;
	var screen_height = screen.height;
	x = (screen_width  / 2) - (width  / 2);
	y = (screen_height / 2) - (height / 2);
	var pop = window.open ( "/template/html/maf_kor/user/common/user.mail_form_board.vm","print","width=" + width + ", height=" + height + ", left=" + x + ", top=" + y + ", toolbar=no, status=no, menubar=no, scrollbars=yes, resizable=yes");
	pop.focus();
	return;
}


	/*****Zoom In & Zoom Out Script*****/
	var zoomRate = 5;			// ??/??? ???
	var maxRate = 300;			//?????
	var minRate = 100;			//?????

	function GetCookie(name){
		if (document.cookie != "") {
			zoomc = document.cookie.split("; ");
			for (var i=0; i < zoomc.length; i++) {
                zoomv = zoomc[i].split("="); 
                if (zoomv[0] == name) {
				    return  unescape(zoomv[1]);
                }
			}        
		}else{
			return "";
		}
	}

	function SetCookie(name,value){
		document.cookie = name + "=" + escape (value)+";";
	}
	
	function GoZoom(contentid){
		if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
			document.all[contentid].style.zoom = GetCookie("zoomVal");
			currZoom=GetCookie("zoomVal");
		}
		else{
			document.all[contentid].style.zoom = '100%'; 
			currZoom = '100%';
		}
	}

	//Zoom In & Zoom Out
	function zoomInOut(contentid, how) {
		if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
			document.all[contentid].style.zoom = GetCookie("zoomVal");
			//document.all['Layer2left'].style.zoom = GetCookie("zoomVal");
			//document.all['menu2'].style.zoom = GetCookie("zoomVal");
			currZoom=GetCookie("zoomVal");
		}
		else{
			document.all[contentid].style.zoom = '100%'; 
			//document.all['Layer2left'].style.zoom = '100%';
			//document.all['Layer5'].style.zoom = '100%';

			currZoom = '100%';
		}
		if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
			return; 
		}
		if (how == "in") {
			document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%';
			//document.all['Layer2left'].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%';
			//document.all['Layer5'].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%';
		}
		else {
			document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'
			//document.all['Layer2left'].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%';
			//document.all['Layer5'].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%';
		}
		SetCookie("zoomVal",document.all[contentid].style.zoom);
	}

	//	+, - key event
	document.onkeypress = getKey;
	
	function getKey(keyStroke) {
		isNetscape=(document.layers);
		eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
		which = String.fromCharCode(eventChooser).toLowerCase();
		which2 = eventChooser;

		var el=event.srcElement;

		if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA"))		
		{			
			if(which == "+" )
				zoomInOut('zoom', 'in');
			else if(which == "-" )
				zoomInOut('zoom', 'out');
		}
	}