//onfocus=blur() ÀÚµ¿À¸·Î ³Ö±â 
function autoblur() {
        if(event.srcElement.tagName == "A") document.body.focus();
}
document.onfocusin = autoblur;

//·Ñ¿À¹ö
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//À©µµ¿ìÃ¢¿­±â
function OpenWin(theURL,winName,features){
	window.open(theURL,winName,features);
}


function GoBoard(board_div)
{
	document.GoBoard.div.value=board_div ;

	

	if (board_div=="photo_normal"){
	document.GoBoard.action="/board/photo/list.html" ;
	}else if(board_div=="music_normal"){
	document.GoBoard.action="/board/music/list.html" ;	
	}else{
	document.GoBoard.action="/board/list.html" ;
	}
	document.GoBoard.submit();
}

function open_post(){
	objWin =window.open('/member/member_post.html','open_post','width=450,height=500');
		if(objWin.focus)objWin.focus();
}


////////// JavaScript·Î ÄíÅ°»ý¼º ÇÔ¼ö name:ÄíÅ°ÀÌ¸§ value:ÄíÅ°°ª expiredays:ÄíÅ°À¯Áö½Ã°£(ÀÏ) //////////
function setCookie(name,value,expiredays){
	if(expiredays){   // ÄíÅ°À¯Áö½Ã°£(ÀÏ)ÀÌ ÀÖÀ¸¸é
		var todayDate = new Date();
		todayDate.setDate(todayDate.getDate() + expiredays);
		document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";";
		//document.write(todayDate.toGMTString());
	}else{            // ÄíÅ°À¯Áö½Ã°£(ÀÏ)ÀÌ ¾øÀ¸¸é À¯Áö½Ã°£ ¼³Á¤ÇÏÁö ¾ÊÀ½ (ÇöÀçºê¶ó¿ìÀú ³»¿¡¼­¸¸ À¯Áö)
		document.cookie = name + "=" + escape(value) + "; path=/;";
	}
}

////////// JavaScript·Î ÄíÅ°°ª ºÒ·¯¿À´Â ÇÔ¼ö name:ÄíÅ°ÀÌ¸§ //////////
function getCookie(name){
	var Found = false;
	var start, end, i;
	for(i=0; i<=document.cookie.length; i++){
		start = i;
		end = start + name.length;
		if(document.cookie.substring(start,end)==name){
			Found = true;
			break;
		}
	}
	if(Found==true){
		start = end + 1;
		end = document.cookie.indexOf(";",start);
		if(end<start) end = document.cookie.length;   // ¸¶Áö¸·¿¡´Â ";"°¡ ¾øÀ¸¹Ç·Î
		return unescape(document.cookie.substring(start,end));   // JavaScript°¡ ÀÐÀ»¶§´Â unescape°¡ ÇÊ¿ä, PHP³ª ASP°¡ ÀÐÀ»¶§´Â ±×³É ÀÐÀ¸¸é µÊ
	}else{
		return "";
	}
}

function ResizePopWin(){
	    var winBody	    =	this.document.body;

		var winWidth = winBody.scrollWidth + (winBody.offsetWidth - winBody.clientWidth) +2;
		var winHeight = winBody.scrollHeight + (winBody.offsetHeight - winBody.clientHeight) + 55;
		if(winHeight > 500){
			if(typeof(document.all['searchResult']) == "object"){
				document.all['searchResult'].style.pixelHeight = winHeight -100;
			}
		}
		else if(winHeight < 100){
			winHeight = 100;
		}
		else{

		}

		this.resizeTo(winWidth, winHeight);	

		if(parent != this){
			if(typeof(parent.ResizePopWin) == "function"){
				parent.ResizePopWin();
			}
		}
	}
