function newWin(filename,p_name,s_width,s_height,s_scrol){
	x = screen.width;
	y = screen.height;
	wid = (x / 2) - (s_width / 2);
	hei = (y / 2) - (s_height / 2);

   window.open(filename, p_name, "toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,scrollbars=" + s_scrol + ",width=" + s_width + ",height=" + s_height + ",top=" + hei + ",left=" + wid + ",scrolbar=no"); 
}

//¸ðÀÓÅÍ °ü·Ã ½ºÅ©¸³Æ® Á¤ÀÇ

//ÇØ´çÅ¬·´À¸·Î ÀÌµ¿
function goClub(clubId){
	if(clubId){
		location.href="clubmain.php?clubId="+clubId;
	}
	return;	
}

//ÇØ´çÅ¬·´¸Þ´º·Î ÀÌµ¿
function goClubMenu(auth, myAuth, clubId, menuNum){
	switch(menuNum){
		case "91":	//È¸¿ø°¡ÀÔ/Å»Åð
			if(myAuth>=80){
				alert("½Ã¼¥ÀÌ»óÀº Å»ÅðÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return;
			}else if(myAuth==50){
				alert("°¡ÀÔÃ³¸®ÁßÀÔ´Ï´Ù.");
				return;
			}
			if(auth>myAuth){	//°¡ÀÔÀ¸·Î
				location.href="clubmember.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{	//Å»Åð·Î
				location.href="clubmemberout.php?clubId="+clubId +"&menuNum="+ menuNum;
			}
			break;
		case "92":	//È¸¿ø¸®½ºÆ®
			if(auth<=myAuth){
				location.href="clubmemberlist.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{
				authAlertMsg(auth);
			}
			break;
		case "93":	//¸ÞÀÏº¸³»±â
			if(auth<=myAuth){
				location.href="clubmail.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{
				authAlertMsg(auth);
			}
			break;
		case "99":	//³»Á¤º¸¼öÁ¤
			if(auth<=myAuth){
				location.href="clubmyinfo.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{
				authAlertMsg(auth);
			}
			break;
		case "00":
			if(auth<=myAuth){
				location.href="clubadminmain.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{
				authAlertMsg(auth);
			}
			break;
		default:
			if(auth>myAuth){
				authAlertMsg(auth);
				return;
			}
			location.href="clubboardlist.php?clubId="+ clubId +"&menuNum="+ menuNum;
			break;
	}
}

function goAdminMenu(auth, myAuth, clubId, menuNum){
	switch(menuNum){
		case "1":
			if(auth<=myAuth){
				location.href="clubadmin1.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{
				authAlertMsg(auth);
				return;
			}
			break;
		case "2":
			if(auth<=myAuth){
				location.href="clubadmin2.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{
				authAlertMsg(auth);
				return;
			}
			break;
		case "3":
			if(auth<=myAuth){
				location.href="clubadmin3.php?clubId="+clubId +"&menuNum="+ menuNum;
			}else{
				authAlertMsg(auth);
				return;
			}
			break;
		default:
			break;
	}
}

function goAdminBoardRestore(auth, myAuth, clubId, menuNum){
	if(menuNum){
		if(auth<=myAuth){
			location.href="clubadminboardRestore.php?clubId="+clubId +"&menuNum="+ menuNum;
		}else{
			authAlertMsg(auth);
			return;
		}
	}
}

//°Ô½ÃÆÇ³»¿ëº¸±â
function goClubBoardView(auth, myAuth, num, param){
	if(num){
		if(auth<=myAuth){
			location.href="clubboardview.php?num="+ num +"&"+ param;
		}else{
			authAlertMsg(auth);
		}
	}
}

//°Ô½ÃÆÇ±Û¾²±âÀÌµ¿
function goClubBoardWrite(auth, myAuth, param, mode){
	if(param){
		if(auth<=myAuth){
			location.href="clubboardwrite.php?mode="+ mode +"&"+ param;
		}else{
			authAlertMsg(auth);
		}
	}
}

//°Ô½ÃÆÇ¼öÁ¤ÀÌµ¿
function goClubBoardEdit(auth, myAuth, param, mode, writeId, myId){
	if(writeId==myId || auth<=myAuth){
		location.href="clubboardwrite.php?mode="+ mode +"&"+ param;
	}else{
		alert("¼öÁ¤±ÇÇÑÀÌ ¾ø½À´Ï´Ù.");
	}
}

//°Ô½ÃÆÇ»èÁ¦ÀÌµ¿
function goClubBoardDel(auth, myAuth, param, mode, writeId, myId){
	if(writeId==myId || auth<=myAuth){
		if(writeId){
			location.href="clubboardProcess.php?mode="+ mode +"&"+ param;		
		}else{
			location.href="clubboardwrite.php?mode="+ mode +"&"+ param;
		}
	}else{
		alert("»èÁ¦±ÇÇÑÀÌ ¾ø½À´Ï´Ù.");
	}
}

//°Ô½ÃÆÇ ¸®½ºÆ®ÀÌµ¿
function goClubBoardList(auth, myAuth, param){
	if(auth<=myAuth){
		location.href="clubboardlist.php?"+ param;
	}else{
		authAlertMsg(auth);
	}
}

//°æ°íÃ¢ ¶ç¿ì±â s=>¸Þ¼¼Áö, t=>Á¦¸ñ, 
function clubErrMessage(s,t){
	window.showModalDialog("/park/club/error.php?title="+t+"&msg="+s,"","dialogHeight:256px;dialogWidth:288px;edge:raised;center:yes;help:no;resizable:no;status:no;scroll:no;unadorned:no");
}

//·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿
function goLogin(url){
	refer=escape(url);
	location.href="login.php?prevUrl="+refer;
}

function myClub(mId, url){
	if(mId){
		goMenu("6010");
	}else{
		goLogin(url);
	}
}

function authAlertMsg(auth){
	authName=new Array(["100", "°ü¸®ÀÚ"], ["90", "¿î¿µÀÚ"], ["80", "¿î¿µÀÚ"], ["70", "ºÎ¿î¿µÀÚ"], ["60", "Á¤È¸¿ø"], ["50", "ÁØÈ¸¿ø"], ["40", "¼Õ´Ô"], ["30", "³ª±×³×"]);
	for(i=0;i<authName.length;i++){
		if(authName[i][0]==auth){
			alert(authName[i][1]+'ÀÌ»ó °¡´ÉÇÕ´Ï´Ù.');
		}
	}
}

//¸ðÀÓÅÍ °ü·Ã ½ºÅ©¸³Æ® Á¤ÀÇ ³¡

// ÀÌ¹ÌÁö º¸±â ÆË¾÷, 2004.06.25
function viewImgPop(path,file){
	var popname = 'ImgView';
	var url =  '/common/pop_img_view.asp?ViewPath='+ path +'&ViewImg='+ file
	var popstate = '';
		popstate += 'width=100,';
		popstate += 'height=100,';
		popstate += 'left=100,';
		popstate += 'top=100,';
		popstate += 'fullscreen=no,';
		popstate += 'channelmode=no,';
		popstate += 'toolbar=no,';
		popstate += 'location=no,';
		popstate += 'directories=no,';
		popstate += 'status=no,';
		popstate += 'menubar=no,';
		popstate += 'scrollbars=no,';
		popstate += 'resizable=no,';
		popstate += 'titlebar=no,';
		popstate += 'hotkeys=no';
	var PopupWin = window.open(url,popname,popstate);
	return;
}


// Áö¿ª»ç ¾àµµ ÆË¾÷, 2004.06.25
function viewBranchImgPop(idx){
	if(idx!=''){
		var popname = 'BranchImg';
		var url =  '/library/popup/branchMapView.php?idx='+ idx;
		var popstate = '';
			popstate += 'width=100,';
			popstate += 'height=100,';
			popstate += 'left=100,';
			popstate += 'top=100,';
			popstate += 'fullscreen=no,';
			popstate += 'channelmode=no,';
			popstate += 'toolbar=no,';
			popstate += 'location=no,';
			popstate += 'directories=no,';
			popstate += 'status=no,';
			popstate += 'menubar=no,';
			popstate += 'scrollbars=no,';
			popstate += 'resizable=no,';
			popstate += 'titlebar=no,';
			popstate += 'hotkeys=no';
		var PopupWin = window.open(url,popname,popstate);
	}
	return;
}

// ModelessÇü½ÄÀÇ ¸Þ½ÃÁö¸¦ º¸¿©ÁÜ, 2004.06.25
function errModeless(msg){
	if(msg=='') msg='¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù';
	window.showModelessDialog("/library/popup/notice.php",msg,"dialogWidth:296px; dialogHeight:220px; center=yes; screenTop=yes; scroll=no; status=no; help=no;");
}
// window open Çü½ÄÀÇ ¸Þ½ÃÁö¸¦ º¸¿©ÁÜ, 2006.06.25
function openErrPop(msg){
	if(msg=='') msg='¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù';
	window.open('/library/popup/notice.php?msg='+ msg ,'err_page','width=290,height=195,left=100,top=100');
}


// SelectBox»ç¿ë ÆäÀÌÁö ÀÌµ¿
function selGoBranch(url){
	if(url!=''){
		window.location.href=url;
	}
}


// ¿ìÆí¹øÈ£°Ë»ö , 2004.06.26, hoon
// => searchZip_Click('1',document.PageForm)
function searchZip_Click(flag,obj){

	var intWidth = 292;
	var intHeight = 220;
	var urlPopup = '/library/common/popZipSearch.php?flag='+flag;
	var namePopup = 'SearchZip';
	var featuresPopup = '';
		featuresPopup += 'width='+intWidth+',';
		featuresPopup += 'height='+intHeight+',';
		featuresPopup += 'left='+((window.document.body.clientWidth-intWidth)/2)+',';
		featuresPopup += 'top='+((window.document.body.clientHeight-intHeight)/2)+',';
		featuresPopup += 'fullscreen=no,';
		featuresPopup += 'channelmode=no,';
		featuresPopup += 'toolbar=no,';
		featuresPopup += 'location=no,';
		featuresPopup += 'directories=no,';
		featuresPopup += 'status=no,';
		featuresPopup += 'menubar=no,';
		featuresPopup += 'scrollbars=no,';
		featuresPopup += 'resizable=no,';
		featuresPopup += 'titlebar=no,';
		featuresPopup += 'hotkeys=no';
	var replacePopup = true;

	switch(flag){
		case '1' :
			obj.addr1.focus();
			var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
			window.status = window.defaultStatus;
			return ;
			break;
		case '2' :
			obj.pcsAddr1.focus();
			var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
			window.status = window.defaultStatus;
			return ;
			break;
		case '3' :
			obj.FRB_ADDR1.focus();
			var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
			window.status = window.defaultStatus;
			return ;
			break;
		case '4' :
			obj.fecAddr1.focus();
			var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
			window.status = window.defaultStatus;
			return ;
			break;
		case '5' :
			obj.fvtAddr1.focus();
			var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
			window.status = window.defaultStatus;
			return ;
			break;
		case '6' :
			obj.frcHomeAddr1.focus();
			var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
			window.status = window.defaultStatus;
			return ;
			break;
		case '7' :
			obj.frcAddr1.focus();
			var PopupWin = window.open(urlPopup, namePopup, featuresPopup, replacePopup);
			window.status = window.defaultStatus;
			return ;
			break;
		default :
			break;
	}
}
