function is_empty(str) {
	var i;

	for (i = 0; i < str.length; i++)
		if (str.charAt(i) != " ")
			return false;
	return true;
}

function is_numberic(obj) {
	if (event.keyCode) {
		if ((escape(event.keyCode) >= 48) && (escape(event.keyCode) <= 57)) {
			return true;
		}
		else {
			event.returnValue = false;
		}
	}
}

function is_numberic_2(obj) {
	if (event.keyCode) {
		if ((escape(event.keyCode) >= 48) && (escape(event.keyCode) <= 57) && ((obj.value.length != 0) || (escape(event.keyCode) != 48))) {
			return true;
		}
		else {
			event.returnValue = false;
		}
	}
}

function set_number_format(obj) {
	var number, i, j, temp_value;

	number = obj.value.replace(/,/g, '');
	j = 0;
	temp_value = "";

	for (i = number.length; i > 0; i--) {
		if ((j % 3 == 0) && (j != 0)) {
			temp_value = number.substring(i, i - 1) + "," + temp_value;
		}
		else {
			temp_value = number.substring(i, i - 1) + temp_value;
		}
		j++;
	}

	obj.value = temp_value;
}

function check_email(str) {
 	var i, val, loc, loc2;

  loc = str.indexOf("@", 0) + 1;
  loc2 = str.indexOf(".", 0) + 1;
  if (loc == 0 || loc2 == 0)
   return false;
  else {
   for (i = 0; i < loc - 1; i++) {
   	val = str.charAt(i);
    if (! ((val >= '0' && val <= '9') || (val >= 'A' && val <= 'Z') || (val >= '_') || (val >= '-') || (val >= 'a' && val <= 'z')))
     return false;
   }
   for (i = loc; i < str.length; i++) {
   	val = str.charAt(i);
    if (! ((val >= '0' && val <= '9') || (val >= 'A' && val <= 'Z') || (val >= 'a' && val <= 'z') || val == "."))
     return false;
   }
   return true;
  }
}

function fl_view(objhtml) { 
	document.write(objhtml); 
}


function openNewWindow(URLtoOpen, windowName, windowFeatures) { 
	newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}

function contentPrint() { // ÇÁ¸°Æ®½ºÅ©¸³Æ®
	var windowLeft = (screen.width-665)/2;
	var windowTop = 20;
	var printURL = "/include/Print.html";
	 window.open(printURL,"content",'width=700, height=620, menubar=yes, scrollbars=yes,status=no,resizable=yes,top=' + windowTop + ',left=' + windowLeft + '');
}
function contentPrint2(w,h) { // ÇÁ¸°Æ®½ºÅ©¸³Æ®
	var windowLeft = (screen.width-665)/2;
	var windowTop = 20;
	var printURL = "/include/Print2.html";
	 window.open(printURL,"content",'width='+w+', height='+h+', menubar=yes, scrollbars=yes,status=no,resizable=yes,top=' + windowTop + ',left=' + windowLeft + '');
}
/* 	SUB º»¹® ±ÛÀÚÅ©±â 
* desc : ±ÛÀÚÅ©±âÈ®´ëÃà¼Ò, ÃÖ´ëÃÖ¼Ò°ª°íÁ¤.
* È®´ëÃà¼Ò¿µ¿ª ÁöÁ¤ Ãß°¡. ÀÌº¥Æ®´Â ½ºÅ©¸³Æ®¿¡¼­ Ã³¸®, ±âº» Å©±â Ãß°¡.
* ex) initFontZoom(document.getElementById("container")); setFontSize(+1); setFontSize(-1); setFontSize(0);
*/
function setFontSize(a,zoomArea){
	var defaultFontSize = 1;//em
	var minFontSize = 1;//em
	var maxFontSize = 2;//em
	if(!zoomArea){//È®´ëÃà¼Ò¿µ¿ª ÁöÁ¤ ¾øÀ¸¸é
		zoomArea = document.getElementById("page");//±âº» È®´ëÃà¼Ò¿µ¿ªÀº ¼­ºê º»¹®
		if(!zoomArea) zoomArea = document.getElementById("body");//¸ÞÀÎÀÏ °æ¿ì
	}
	if(zoomArea){
		if(!a) zoomArea.style.fontSize = parseFloat(defaultFontSize)+"em";//±âº»°ª
		else {
			var objFontSize = zoomArea.style.fontSize;
			if (!objFontSize) objFontSize = parseFloat(defaultFontSize)+"em";
			var checkFontSize = (Math.round(12*parseFloat(objFontSize))+(a*2))/12;
			if (checkFontSize > maxFontSize) { checkFontSize = maxFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õ ´Ã¸± ¼ö ¾ø½À´Ï´Ù."); }
			else if (checkFontSize < minFontSize) { checkFontSize = minFontSize; zoomArea.style.fontSize = checkFontSize+"em"; alert("´õ ÁÙÀÏ ¼ö ¾ø½À´Ï´Ù."); }
			else { zoomArea.style.fontSize = checkFontSize+"em"; }
		}
	}
}
function initFontZoom(zoomArea){
	zoomArea = (zoomArea)? zoomArea: null;//Àü¿ªº¯¼ö·ÎÁöÁ¤
	var fzoomIn = document.getElementById("fontsize-larger");
	var fzoomOut = document.getElementById("fontsize-smaller");
	var fzoom0 = document.getElementById("fontsize-default");
	if(fzoomIn) fzoomIn.onclick = function(){ setFontSize(+1,zoomArea); return false; }
	if(fzoomOut) fzoomOut.onclick = function(){ setFontSize(-1,zoomArea); return false; }
	if(fzoom0) fzoom0.onclick = function(){ setFontSize(0,zoomArea);	 return false; }
}

/********************************************************************
  Flash
*********************************************************************/
function flash(value, width, height){	//???
	document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'">');
	document.writeln('<param name="movie" value="'+value+'">');
	document.writeln('<param name="quality" value="high">');
	document.writeln('<param name="wmode" value="transparent">');
	document.writeln('<param name="menu" value="false">');
	document.writeln('<embed src="'+value+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false"></embed>');
	document.writeln('</object>');
}
