/* ·¹ÀÌ¾î °ü·Ã ½ºÅ©¸³Æ® */
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

/* ÇÃ·¡½Ã ½ºÅ©¸³Æ® */
function __tx__(id){
document.write(document.getElementById(id).value);
}

/* ºê¶ó¿ìÁ® Å¸ÀÌÆ² */
document.title="Gallery Iang";

/* ÀÚµ¿ ÀÌ¹ÌÁö Æ÷Ä¿½º ¾Æ¿ô */
function autoblur(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
	document.body.focus(); 
} 
	document.onfocusin=autoblur;

/* PNG IE6 ¿¡¼­ ±¸ÇöÇÏ±â */
function setPng24(obj) { 
	obj.width=obj.height=1; 
	obj.className=obj.className.replace(/\bpng24\b/i,''); 
	obj.style.filter = 
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
	obj.src='';  
	return ''; 
} 

//iframe auto resize
function iframe_autoresize(arg) {
    arg.height = eval(arg.name+".document.body.scrollHeight");
}

//Email Çü½Ä check
function Email_chk(Form_Name, Field_Name) {
	var t = eval("document." + Form_Name + "." + Field_Name + ".value");
	var ValidFlag = false;
	var atCount = 0;
	var SpecialFlag;
	var atLoop;
	var atChr;
	var BadFlag;
	var tAry1;
	var UserName;
	var DomainName;
	
	if(t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0) {
		atCount = 0;
		SpecialFlag = false;
		
		for(atLoop=1; atLoop<=t.length; atLoop++) {
			atChr = t.substring(atLoop, atLoop+1);
			
			if(atChr == "@") atCount = atCount + 1;
			if((atChr >= 32) && (atChr <= 44)) SpecialFlag = true;
			if((atChr == 47) || (atChr == 96) || (atChr >= 123)) SpecialFlag = true;
			if((atChr >= 58) && (atChr <= 63)) SpecialFlag = true;
			if((atChr >= 91) && (atChr <= 94)) SpecialFlag = true;
		}
		
		if((atCount == 1) && (SpecialFlag == false)) {
			BadFlag = false;
			tAry1 = t.split("@");
			UserName = tAry1[0];
			DomainName = tAry1[1];
			
			if((UserName.length <= 0) || (DomainName.length <= 0 )) BadFlag = true;
			if(DomainName.substring(1, 2 ) == ".") BadFlag = true;
			if(DomainName.substring(DomainName.length-1, DomainName.length) == ".") BadFlag = true;
			
			ValidFlag = true;
		}
	}
	
	if(BadFlag == true) ValidFlag = false;
	
	return ValidFlag;
}

//ID Çü½Ä Check
function CheckChar(name) {
	strarr = new Array(name.value.length);
	
	if((name.value.charAt(0) < "a" || name.value.charAt(0) > "z") && (name.value.charAt(0) < "A" || name.value.charAt(0) > "Z")) {
		return true;
	}
	
	for(i = 0; i < name.value.length; i++) {
		strarr[i] = name.value.charAt(i)
		if((strarr[i] >= 0) && (strarr[i] <= 9))
			continue;
		else if((strarr[i] >= "a") && (strarr[i] <= "z"))
			continue;
		else if((strarr[i] >= "A") && (strarr[i] <= "Z"))
			continue;
		else {
			return true;
		}
	}  
	return false;
}

//±ÛÀÚ¼ö Á¦ÇÑ.
function in_ti(word, length) {
	if(word.length > length) {
		word = word.substring(0, length) + "..";
	}
	
	document.write(word);
}

/*
launchCenter(str1, str2, int1, int2, str3)
 - str1 : ÆË¾÷µÉ url 
 - str2 : ÆË¾÷Ã¢ ¸í
 - int1 : ÆË¾÷Ã¢ÀÇ °¡·Î±æÀÌ
 - int2 : ÆË¾÷Ã¢ÀÇ ¼¼·Î±æÀÌ
 - str3 : ±âÅ¸ ÆË¾÷Ã¢ÀÇ Attribute
 - ¼³¸í : ÆË¾÷Ã¢À» ¸ð´ÏÅÍÀÇ ÇÑ°¡¿îµ¥¿¡ À§Ä¡½ÃÅ´
 - ¹ÝÈ¯°ª : ¾øÀ½
*/

// launchCenter(url, name, width, height, att)
function launchCenter(url, name, width, height, att) 
{
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
    str += "," + att
  }
  return window.open(url, name, str);
}

// keyCode °¡ 13 ÀÏ °æ¿ì tab.
function EnterTab(FocusName) {
  if (event.keyCode == 13) {    
	eval("document.all." + FocusName + ".focus()");
  }
}

// keyCode °¡ 13 ÀÏ °æ¿ì¸¸ submit
function EnterSubmit(SubmitName) {
	if(event.keyCode == 13) {
		if(SubmitName != "") {
			eval(SubmitName + "()");
		}
	}
}

//Text Field¿¡ Text °¨Ãß±â
function clearField(field){ 
    if (field.value == field.defaultValue) { 
        field.value = ""; 
    } 
} 
//Text Field¿¡ Text º¸ÀÌ±â
function checkField(field){ 
    if (field.value == "") { 
        field.value = field.defaultValue; 
    } 
} 

// ¿ìÆí¹øÈ£ »õÃ¢
function WinZipcode(FormName, Field_01, Field_02) {
	launchCenter("../Zipcode.php?FormName=" + FormName + "&Field_01=" + Field_01 + "&Field_02=" + Field_02, "WinZipcode", "532", "360", "scrollbars=yes");
}

// IDNum µÎ¹øÂ° field ·Î focus
function IDNum_01_keyup(FormName, IDNum) {
	if(FormName == null) {
		f = document.member;
	} else {
		f = eval("document." + FormName);
	}
	
	if(IDNum == null) {
		IDNum = "IDNum";
	}
	
	if(eval("f." + IDNum + "_01.value.length") == 6) {
		eval("f." + IDNum + "_02.focus();");
	}
}

//----- ÀÌ¹ÌÁö°¡ load µÈ ÈÄ¿¡ ÀÌ¹ÌÁö resize s. -----//
function ImgResize(ImgName, width, height) {
	var True_width = ImgName.width;
	var True_height = ImgName.height;
	
	try
	{
		//°¡·Î°¡ '0'ÀÏ °æ¿ì ¼¼·Î ±âÁØÀ¸·Î ÀÌ¹ÌÁö resize
		if(width == 0 && height != 0) {
			//¿øº» ¼¼·Î°¡ ¼±¾ðµÈ ¼¼·Îº¸´Ù Å¬°æ¿ì ¼±¾ðµÈ ¼¼·Î·Î resize.
			if(True_height > height) {
				var Fixed_height = height;
			}
		} else if(width != 0 && height == 0) {
			//¼¼·Î°¡ '0'ÀÏ °æ¿ì °¡·Î ±âÁØÀ¸·Î ÀÌ¹ÌÁö resize
			//¿øº» °¡·Î°¡ ¼±¾ðµÈ °¡·Îº¸´Ù Å¬°æ¿ì ¼±¾ðµÈ °¡·Î·Î resize.
			if(True_width > width) {
				var Fixed_width = width;
			}
		} else {
			//°¡·Î, ¼¼·Î µÑ´Ù '0'ÀÌ ¾Æ´Ò °æ¿ì
			//ÀÌ¹ÌÁöÀÇ °¡·Î »çÀÌÁî¿Í ¼¼·Î »çÀÌÁîÁß Å«°ª È®ÀÎ.
			//°¡·Î°¡ ¼¼·Îº¸´Ù Å¬°æ¿ì.
			//°¡·Î¸¦ ±âÁØÀ¸·Î ÀÌ¹ÌÁö resize.
			if(True_width * height > True_height * width) {
				if(True_width > width) {
					var Fixed_width = width;
				}
			} else {
				//¼¼·Î°¡ °¡·Îº¸´Ù Å¬°æ¿ì.
				//¼¼·Î¸¦ ±âÁØÀ¸·Î ÀÌ¹ÌÁö resize.
				if(True_height > height) {
					var Fixed_height = height;
				}
			}
		}
		
		//°¡·Î, ¼¼·Î Áß ÇÏ³ªÀÇ »çÀÌÁî¶óµµ '0'ÀÏ °æ¿ì.(ÀÌ¹ÌÁö »çÀÌÁî¸¦ Àç´ë·Î °¡Á®¿ÀÁö ¸øÇßÀ» °æ¿ì.)
		if(True_width == 0 || True_height == 0) {
			if(width != 0) {
				ImgName.width = width;
			}
			if(height != 0) {
				ImgName.height = height;
			}
		} else {
			//ÀÌ¹ÌÁö »çÀÌÁî¸¦ Á¦´ë·Î °¡Á®¿ÔÀ» °æ¿ì.
			if(Fixed_width) { 
				ImgName.width = Fixed_width;
			} else if(Fixed_height) {
				ImgName.height = Fixed_height;
			}
		}
	}
	catch(e)
	{
	}
}
//----- ÀÌ¹ÌÁö°¡ load µÈ ÈÄ¿¡ ÀÌ¹ÌÁö resize e. -----//
//----------------------------------------------------------------------------//

/* ÁØºñÁß */
function ready(){
	window.alert("ÇØ´ç¸Þ´º´Â ¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù.");
}


/* Main */
function main(){
	window.location.href = "../main/main.php";
}

/* GloBal Menu */
function gloMenu_01(){
	window.location.href = "../common/Log.php";
}
function gloMenu_02(){
	window.location.href = "../mem/member_addnew.php";
}
function gloMenu_03(){
	window.location.href = "../mem/sitemap.php";
}
function gloMenu_04(){
	window.location.href = "../common/Logout.php";
}
function gloMenu_05(){
	window.location.href = "../mem/member_edit.php";
}
function gloMenu_06(){
	window.location.href = "../main/main.php";
}
function gloMenu_07(){
	window.location.href = "../admin/";
}

/* °¶·¯¸® ÀÌ¾Ó */
function gall_01() {
	window.location.href = "../gall/gall_01.php";
}
function gall_02() {
	window.location.href = "../gall/gall_02.php";
}
function gall_03() {
	window.location.href = "../gall/gall_03.php";
}
function gall_04() {
	window.location.href = "../gall/gall_04.php";
}
function gall_05() {
	window.location.href = "../gall/gall_05.php";
}

/* Àü½Ã */
function ex_01() {
//	window.location.href = "../ex/ex_01.php";
	window.location.href = "../Board_01/List.php?BoardNum=4";
}
function ex_02() {
	window.location.href = "../ex/ex_02.php";
}
function ex_03() {
	window.location.href = "../ex/ex_03.php";
}

/* ´ë°ü */
function app_01() {
	window.location.href = "../app/app_01.php";
}
function app_02() {
	window.location.href = "../app/app_02.php";
}

/* ¾ÆÄ«ÀÌºê */
function arch_01() {
//	window.location.href = "../arch/arch_01.php";
	window.location.href = "../Board_01/List.php?BoardNum=7";
}
function arch_02() {
//	window.location.href = "../arch/arch_02.php";
	window.location.href = "../Board_01/List.php?BoardNum=8";
}
function arch_03() {
//	window.location.href = "../arch/arch_03.php";
	window.location.href = "../Board_01/List.php?BoardNum=9";
}

/* ºÏÄ«Æä ÀÌ¾Ó */
function book_01() {
	window.location.href = "../book/book_01.php";
}
function book_02() {
	window.location.href = "../book/book_02.php";
}

/* °Ô½ÃÆÇ */
function board_01() {
	window.location.href = "../Board_01/List.php?BoardNum=1";
}
function board_02() {
	window.location.href = "../Board_01/List.php?BoardNum=2";
}
function board_03() {
	window.location.href = "../Board_01/List.php?BoardNum=3";
}

/* È¸¿ø */
function MyInfo() {
	window.location.href = "../mem/mem_01.php";
}
function IDSc() {
	window.location.href = "../mem/mem_02.php";
}
function PWSc() {
	window.location.href = "../mem/mem_03.php";
}