function resizeFrame(subWin)
{
	var guestDoc = subWin.contentWindow.document.body;
	var frameHeight = guestDoc.offsetHeight;

	//var frameWidth = guestDoc.offsetWidth;
	
	subWin.height = frameHeight;
	//subWin.width = framewidth;				
}

function movie_up() {
	//window.open('/movie/media_upload.php','mup','height=700, width=720, menubar=no, scrollbars=no, resizable=no, toolbar=no, status=no, top=0, left=50');
	//location.href = "/movie/media_upload.php";
	window.open('http://sdch.swimdoctor.co.kr/movie/media_upload.php');
}

function photo_up() {
	//window.open('/movie/media_upload.php','mup','height=700, width=720, menubar=no, scrollbars=no, resizable=no, toolbar=no, status=no, top=0, left=50');
	location.href = "/bbs/photo_upload.php";
}

function recom_media(frm) {
	frm.submit();
}

function recom_re(frm) {
	frm.mode.value = "recom_re";
	frm.submit();
}

function go_exchange(wp) {

	if(parseInt(wp) < 5000) {
		alert("³²Àº ¹°¹æ¿ïÀÌ 5000Á¡ ÀÌÇÏÀÌ¹Ç·Î ÀüÈ¯ÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù.")
	}
	else {
	if(confirm(wp +" ¹°¹æ¿ïÀ» Çö±ÝÀ¸·Î ÀüÈ¯ÇÏ½Ã°Ú½À´Ï±î?")) {
	location.href="wp_exchange.php?wpa="+wp;	
	//alert("wp_exchange.php?np="+wp);	
	} 
	}
}

function media_edit(idx,page) {

	location.href = "media_upload.php?mode=edit&idx=" + idx + "&page=" + page;
	
}

function media_delete(idx,page) {
	if(confirm("ÀÌ °Ô½Ã¹°À» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) {
		location.href = "media_save.php?mode=delete&idx=" + idx + "&page=" + page;
	}
	
}

function CheckKeyword(frm){

  if(frm.query.value == ""){
    alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
    frm.query.focus();
    return false;
  }
  
}

function kview() {

	document.all['klink'].style.display = "none";
	document.all['krank'].style.display = "block";
	
	//genWindow('krank');

}

function kout() {

	document.all['klink'].style.display = "block";
	document.all['krank'].style.display = "none";

}

function mout() {

	if(document.all.mlayer.style.display == "block") {
		document.all['mlayer'].style.display = "none";
	}

}

function qview() {

	document.all['klink'].style.display = "none";
	document.all['krank'].style.display = "block";
	
	genWindow('krank');

}

function genWindow(layername) { 
	var xMax = document.body.clientWidth, yMax = document.body.clientHeight; 
	//var xOffset = (xMax-190)/2+370, yOffset = (yMax)/2; 
	var xOffset = (xMax-190)/2+400, yOffset = 140; 
	var divMenu = document.all[layername].style; 

	divMenu.top = yOffset; 
	divMenu.left = xOffset; 
	
	//alert(xMax + "|" + yMax);
} 

function viewl_media() {
	document.all.lmedia.style.display = "block";
	document.all.lbbs.style.display = "none";
	document.all.lreply.style.display = "none";
}

function viewl_bbs() {
	document.all.lmedia.style.display = "none";
	document.all.lbbs.style.display = "block";
	document.all.lreply.style.display = "none";
}

function viewl_reply() {
	document.all.lmedia.style.display = "none";
	document.all.lbbs.style.display = "none";
	document.all.lreply.style.display = "block";
}

function view_mlayer(mid) {

	layer_x=event.clientX; 
	layer_y=event.clientY; 
	xx=layer_x + document.body.scrollLeft; 
	yy=layer_y + document.body.scrollTop;
	
	document.gopop.memid.value = mid
	
	document.all.memlayer.style.top = yy;
	document.all.memlayer.style.left = xx;
	document.all.memlayer.style.display = "block";
	
}

function open_meminfo() {
	window.open("", "meminfo", "height=244, width=280, menubar=no, scrollbars=no, resizable=no, toolbar=no, status=no, left=50, top=50");
	document.gopop.action = "/member/meminfo.php";
	document.gopop.target = "meminfo";
	document.gopop.submit();
}

function open_meminfo2() {
	window.open("", "meminfo", "height=490, width=532, menubar=no, scrollbars=no, resizable=no, toolbar=no, status=no, left=50, top=50");
	document.gopop.action = "/member/meminfo_a.php";
	document.gopop.target = "meminfo";
	document.gopop.submit();
}

function open_sendmemo() {
	document.gopop.action = "/mypage/memo_send.php";
	document.gopop.target = "_blank";
	document.gopop.submit();
}

// ¼ö¿µµî±Þ º¸±â
function view_swimlevel(){
   var url = "/include/sdoclevel.htm";
   window.open(url, "swimlevel", "height=600, width=1020, menubar=no, scrollbars=yes, resizable=no, toolbar=no, status=no, left=50, top=50");
}

//¾ÆÀÌµð/ºñ¹ø Ã£±â
function idpw_pop() {
	var url = "http://shop.swimdoctor.co.kr/member/member-index2.php?cmn=2&sts=passid";
	var width = "650";
	var height = "650";
    window.open(url, "wprint", "width=" + width + ", height=" + height +", resizable=0, scrollbars=yes") ;
}

function logincheck(frm) {
	if(frm.id.value == "") {
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		frm.id.focus();
		return false;
	}
	if(frm.passwd.value == "") {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		frm.passwd.focus();
		return false;
	}
	
	if(frm.login_security.checked == true) {
		frm.action = "https://www.swimdoctor.co.kr/member/login_process.php";
	}
}

function show_submenu(idx) {

	for(i=1;i<9;i++) {
		document.getElementById('submenu'+i).style.display = "none";
	}
	
	if(idx) {
		document.getElementById('submenu'+idx).style.display = "block";
	}

}
