var URL = "/html/";
var HOME = "/html/index.php";

function newWin(url){
	newWin = window.open(url,"","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
}

function newWin_size(url){
	newWin_size = window.open(url,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=820,height=700");
}

function newWins(url,winW,winH){
	var l =  (screen.availWidth - winW) / 2;
	var t = (screen.availHeight - winH) / 2;
	var winSet = 'width=' + winW + ',height=' + winH + ',left=' + l + ',top=' + t + ',scrollbars=no, toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no';
	window.open(url,"",winSet);
}

function pop_store(url,winW,winH){
	var l =  (screen.availWidth - winW) / 2;
	var t = (screen.availHeight - winH) / 2;
	var winSet = 'width=' + winW + ',height=' + winH + ',left=' + l + ',top=' + t + ',scrollbars=yes, toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no';
	window.open(url,"",winSet);
}

function M01(rnum){ // ±èÄ¡¸»ÀÌ±¹¼ö ¼Ò°³
	switch(rnum){
		case 0 :
		case 1 : // 
			location.href = URL+"kimchimali/greeting.html";
		break;
		case 2 : //
			location.href = URL+"kimchimali/history.html";
		break;
		case 3 : // 
			location.href = URL+"kimchimali/authentication.html";
		break;
		case 4 : // 
			location.href = "/bbs/bbs/board.php?bo_table=m14";
		break;
		case 5 : // 
			location.href = URL+"kimchimali/map.html";
		break;
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function M02(rnum){ // ¸Þ´º¼Ò°³
	switch(rnum){
		case 0 :
		case 1 : // ±¹¼ö·ù
			location.href = URL+"menu/menu.html";
		break;
		case 2 : // ½Ä»ç·ù
			location.href = URL+"menu/menu2.html";
		break;
		case 3 : // Àü±¹¼ö·ù
			location.href = URL+"menu/menu3.html";
		break;		
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}


function M03(rnum){ // Ã¢¾÷¹®ÀÇ
	switch(rnum){
		case 0 :
		case 1 : // °³¼³Á¶°Ç
			location.href = URL+"franchise/condition.html";
		break;
		case 2 : // °³¼³ÀýÂ÷
			location.href = URL+"franchise/procedure.html";
		break;
		case 3 : // °³¼³ºñ¿ë
			location.href = URL+"franchise/cost.html";
		break;
		case 4 : // Ã¢¾÷ÀÇ·Ú
			location.href = "/bbs/bbs/board.php?bo_table=m53";
		break;
		case 5 : // 
			location.href = URL+"";
		break;
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function M04(rnum){ // ¸ÅÀå¾È³»
	switch(rnum){
		case 0 :
		case 1 : // 
			location.href = "/bbs/bbs/board.php?bo_table=m41";
		break;
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function M05(rnum){ // °í°´¼¾ÅÍ
	switch(rnum){
		case 0 :
		case 1 : // °øÁö»çÇ×
			location.href = "/bbs/bbs/board.php?bo_table=m51";
		break;
		case 2 : // º¸µµÀÚ·á
			location.href = "/bbs/bbs/board.php?bo_table=m52";
		break;

		case 3 : // ÀÚÁÖ¹¯´Â Áú¹®°ú ´äº¯
			location.href = URL+"community/customer.html";
		break;
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}


/*
function M03(rnum){ // Ã¢¾÷¹®ÀÇ
	switch(rnum){
		case 0 :
		case 1 : // °³¼³Á¶°Ç
			location.href = URL+"franchise/condition.html";
		break;
		case 2 : // °³¼³ÀýÂ÷
			location.href = URL+"franchise/procedure.html";
		break;
		case 3 : // °³¼³ºñ¿ë
			location.href = URL+"franchise/cost.html";
		break;
		case 4 : // Ã¢¾÷ÀÇ·Ú
			location.href = "/bbs/bbs/board.php?bo_table=m53";
		break;
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}


function M05(rnum){ // °í°´¼¾ÅÍ
	switch(rnum){
		case 0 :
		case 1 : // °øÁö»çÇ×
			location.href = "/bbs/bbs/board.php?bo_table=m51";
		break;
		case 2 : // º¸µµÀÚ·á
			location.href = "/bbs/bbs/board.php?bo_table=m52";
		break;
		case 3 : // ÀÚÁÖ¹¯´Â Áú¹®°ú ´äº¯
			location.href = URL+"community/customer.html";
		break;
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}



function M06(rnum){ // Ã¢¾÷Á¤º¸
	switch(rnum){
		case 0 :
		case 1 : // Ã¢¾÷°æÀï·Â
			location.href = "";
		break;
		case 2 : // Ã¢¾÷Àü·«
			location.href = "";
		break;
		case 3 : // ÃßÃµÁ¡Æ÷
			location.href = "/bbs/bbs/board.php?bo_table=m63";
		break;
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}
*/







/*********************************************************************
*  Right Quick Menu Control
// initMoving(document.getElementById("qmn"), 10, 50, 10);
**********************************************************************/
function initMoving(target, position, topLimit, btmLimit) {
	if (!target){
		return false;
	}

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - btmLimit - obj.offsetHeight;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") { //WebKit
		obj.getTop = function() {
			return window.pageYOffset;
		}
	}else if (typeof(document.documentElement.scrollTop) == "number"){
		obj.getTop = function() {
			return Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		}
	}else{
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) { //WebKit
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	}else{
		obj.getHeight = function() {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		}else{
			//pos = obj.getTop() + obj.getHeight() + obj.initTop;
			pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit){
			pos = obj.bottomLimit;
		}
		if (pos < obj.topLimit){
			pos = obj.topLimit;
		}
			interval = obj.top - pos;
			obj.top = obj.top - interval / 5;
			obj.style.top = obj.top + "px";
		}, 30)
}


function addLoadEvent(func){
 var oldonload = window.onload;
 if(typeof window.onload != 'function'){
  window.onload = func;
 }else{
  window.onload = function(){
   oldonload();
   func();
  }
 }
}
