//ÆË¾÷ (Áß¾ÓÀ¸·Î À§Ä¡ ¼öÁ¤ - T,L ÀÎÀÚ°ªÀº °øÅëÀÌ¶ó »èÁ¦ ¾ÈÇÔ 08.01.17)
function PopupPgaeOpen(theURL,winName,W,H,L,T,S,R) { //v2.0
	var T = (screen.height-H)/2;
  var L = (screen.width-W)/2;
	var popupOpen = window.open(theURL,winName,'width='+W+',height='+H+',left='+L+',top='+T+',scrollbars='+S+',resizable='+R+',toolbar=0,location=0,status=1,menubar=0');
	popupOpen.focus();
}

//¼¿·ºÆ® ÆäÀÌÁö ÀÌµ¿

function goPage(sel,str)
{
	//var dev = document.form1;
	obj = document.getElementById(sel);

	if(!obj.value || obj.value == ''){
		alert(str+"¸¦(À») ¼±ÅÃÇØÁÖ¼¼¿ä.");
		obj.focus();
		return false;
	}
	document.location.href = obj.value;
	return false;
}

// cookie µî·Ï
function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) +
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

// cookie »èÁ¦
function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
  //ÆäÀÌÁö ¸®·Îµå
  document.location.reload();
}

var firstCall = true;

function changeFontsize(fSize, increment) {
	if (firstCall) {
		firstCall = false;
		if (increment != "") {
			changeFontsize('12', '');
		}
	}

	if (document.getElementsByTagName) {
		var getElement = document.getElementsByTagName("*");
		var eachElement, currentFontSize, fontIncrease, newFontSize;
		for (i=0; i<getElement.length; i++) {
			eachElement = getElement[i];
			if (increment != "") {
				currentFontSize = parseInt(eachElement.style.fontSize);
				fontIncrease = parseInt(increment);
				newFontSize = currentFontSize + fontIncrease;
			}
			else if (fSize != "") {
				newFontSize = parseInt(fSize);
			}
			if (getElement[i].tagName == "LI") {
				eachElement.style.lineHeight = Math.round(newFontSize*1.2) + "px";
			} else {
				eachElement.style.lineHeight = Math.round(newFontSize*1.5) + "px";
			}
			if (fSize != "") {
				switch(getElement[i].tagName) {
					case "H2": newFontSize += 3; break;
					case "H3": newFontSize += 2; break;
					case "H4": newFontSize += 1; break;
					case "H5": newFontSize += 1; break;
					case "H6": newFontSize += 1;
				}
			}
			eachElement.style.fontSize = newFontSize + "px";
			setCookie('fontSize', newFontSize);
		}
	}
	return false;
}