var URL = "/";
var HOME = "/";

function newWin(url){
	window.open(url,"","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
}

function newWin_size(url){
	window.open(url,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=984,height=660");
}

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 M00(rnum){ // ¸ÞÀÎÀ¸·Î(·Î°í)
	if(rnum == 0){
		location.href = HOME;
	}
}

function M01(rnum){ // 
	switch(rnum){
		case 0 :
		case 1 : //
			location.href = URL+"m1_1_1.asp";
		break;
		case 2 : //
			location.href = URL+"m1_2.asp";
		break;
		case 3 : //
			location.href = URL+"m1_3_1.asp";
		break;
		case 4 : //
			location.href = URL+"m1_4.asp";
		break;

		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function M02(rnum){ // 
	switch(rnum){
		case 0 :
		case 1 : // 
			location.href = URL+"m2_1_1.asp";
		break;
		case 2 : //
			location.href = URL+"m2_2_1.asp";
		break;
		case 3 : //
			location.href = URL+"m2_3_1.asp";
		break;

		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function M03(rnum){ // 
	switch(rnum){
		case 0 :
		case 1 : // 
			location.href = URL+"m3_1_1.asp";
		break;
		case 2 : // 
			location.href = URL+"m3_2.asp";
		break;

		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function M04(rnum){ // 
	switch(rnum){
		case 0 :
		case 1 : // 
			location.href = URL+"m4_1.asp";
		break;
		case 2 : // 
			location.href = URL+"m4_2.asp";
		break;
		case 3 : // 
			location.href = URL+"m4_3.asp";
		break;
		case 4 : // 
			location.href = URL+"m4_4.asp";
		break;
	
		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function M05(rnum){ // 
	switch(rnum){
		case 0 :
		case 1 : // 
			location.href = URL+"m5_1.asp";
		break;
		case 2 : // 
			location.href = URL+"m5_2.asp";
		break;
		case 3 : // 
			location.href = URL+"m5_3.asp";
		break;
		case 4 : // 
			location.href = URL+"m5_4.asp";
		break;
		case 5 : // 
			location.href = URL+"m5_5.asp";
		break;
		case 6 : // 
			location.href = URL+"m5_6.asp";
		break;

		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function bottom(rnum){ // 
	switch(rnum){
		case 0 :
		case 1 : // 
			location.href = URL+"m5_1.asp";
		break;
		case 2 : // 
			location.href = URL+"m4_4.asp";
		break;
		case 3 : // 
			location.href = URL+"m5_4.asp";
		break;
		case 4 : // 
			location.href = URL+"m5_3.asp";
		break;

		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function family(rnum){ //  ÆÐ¹Ð¸® ±×·ì
	switch(rnum){
		case 0 :
		case 1 : // 
			window.open("http://www.peak.com.hk") ;
		break;
		case 2 : // 
			window.open("http://www.blackstoneresort.com") ;
		break;
		case 3 : // 
			window.open("http://www.thehillhouse.co.kr") ;
		break;
		case 4 : // 
			window.open("http://www.peak.com.hk") ;
		break;
		case 5 : // 
			window.open("http://www.blackstoneresort.com") ;
		break;
		case 6 : // 
			window.open("http://www.thehillhouse.co.kr") ;
		break;
		case 7 : // 
			window.open("http://www.peak.com.hk") ;
		break;
		case 8 : // 
			window.open("http://www.blackstoneresort.com") ;
		break;
		case 9 : // 
			window.open("http://www.thehillhouse.co.kr") ;
		break;

		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function topM(rnum){ //  »çÀÌÆ®¸Ê
	switch(rnum){
		
		case 0 :
		case 1 : // home
			location.href = HOME;
		break;

		case 2 : // contact us
			location.href = URL+"m5_2.asp";
		break;

		case 3 : // sitemap
			location.href = URL+"sitemap.asp";
		break;

		default :
			alert(rnum+" : ÁØºñÁßÀÎ ÆäÀÌÁöÀÔ´Ï´Ù.");
	}
}

function lang(){ //  English	
//		window.open("http://daewonspic.bsgrcc.com/en") ;
		location.href = "/en/";
}


function admin(){ //  ÇªÅÍ¹öÆ°	(°ü¸®ÀÚÆäÀÌÁö·Î ÀÌµ¿)
//		window.open("http://daewonspic.bsgrcc.com/en") ;
		location.href = URL+"admin/admin.asp";
}


function product(rnum){ //  Áö±¸ µÑ·¹
	switch(rnum){
		
		case 0 :
		case 1 : // 
			location.href = URL+"m2_1_4.asp";
		break;

		case 2 : // 
			location.href = URL+"m2_1_2.asp";
		break;
	
		case 3 : // 
			location.href = URL+"m2_1_5.asp";
		break;
		
		case 4 : // 
			location.href = URL+"m2_1_3.asp";
		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)
}

