var sw = screen.availWidth;
var sh = screen.availHeight;

// À©µµ¿ì ¿ÀÇÂ
function openWindowCenter(url,name,width,height,scrollbars) {
//alert(url);
	var posLt = (screen.availWidth-width)/2;
	var posTp = (screen.availHeight-height)/2;
	var pop = window.open(url,name,"top="+posTp+",left="+posLt+",width="+width+",height="+height+",scrollbars="+scrollbars);
	if(pop) {pop.focus();}
}


/* ¸Þ´º °ü·Ã */
var arrMnu = new Array();
arrMnu.push({key:"home",txt:"Home",url:"/service/main.php"})
arrMnu.push({key:"login",  txt:"Login",		url:"javascript:void openWindowCenter('/service/login/login.php','','360','280','0');"});
arrMnu.push({key:"loginout",  txt:"Logout",		url:"/service/login/loginout.php"});
arrMnu.push({key:"regist",  txt:"Regist",		url:"javascript:void openWindowCenter('/service/member/join1.php','','600','650','0');"});
arrMnu.push({key:"mypage",  txt:"Mypage",		url:"javascript:void openWindowCenter('/service/member/mypage.php','','600','650','0');"});
arrMnu.push({key:"findpw",  txt:"FindPW",		url:"/service/login/findpw.php"});
arrMnu.push({key:"sitemap",  txt:"sitemap",		url:"/service/global/sitemap.php"});

arrMnu.push({key:"program",  txt:"Club Program",		url:"program1"});
arrMnu.push({key:"program1",  txt:"Program",		url:"/service/program/read.php"});

arrMnu.push({key:"information",  txt:"Information",  url:"information1"});
arrMnu.push({key:"information1", txt:"map",          url:"/service/map/list.php"});
arrMnu.push({key:"information2", txt:"archive",      url:"/service/information/archive/list.php"});
arrMnu.push({key:"information3", txt:"history",      url:"/service/information/history.php"});
arrMnu.push({key:"information4", txt:"link",      url:"/service/information/links.php"});
arrMnu.push({key:"information5", txt:"clubs",      url:"/service/information/clubs.php"});

arrMnu.push({key:"music",  txt:"Music",		url:"music1"});
arrMnu.push({key:"music1",  txt:"bands",	url:"/service/music/list.php?category=BAND"});
arrMnu.push({key:"music2",  txt:"djs",	url:"/service/music/list.php?category=DJ"});


arrMnu.push({key:"clubber",  txt:"Clubber",		url:"clubber1"});
arrMnu.push({key:"clubber1",  txt:"Official Photo",		url:"/service/community/board/list.php?category=2"});
arrMnu.push({key:"clubber2",  txt:"We Love Clubday",	url:"/service/community/board/list.php?category=3"});
arrMnu.push({key:"clubber3",  txt:"Video",		url:"/service/community/board/list.php?category=4"});
arrMnu.push({key:"clubber4",  txt:"Radio",		url:"/service/community/board/list.php?category=5"});

arrMnu.push({key:"community",  txt:"Community",		url:"community1"});
arrMnu.push({key:"community1",  txt:"Board",		url:"/service/community/board/list.php?category=6"});
arrMnu.push({key:"community2",  txt:"party_info",   url:"/service/community/party_info/list.php"});

arrMnu.push({key:"audition",  txt:"Audition",		url:"audition1"});
arrMnu.push({key:"audition1",  txt:"Audition",		url:"/service/audition/index.php"});

arrMnu.push({key:"event",  txt:"event",		url:"event1"});
arrMnu.push({key:"event1",  txt:"event",		url:"/service/community/board/list.php?category=7"});


function getMnuURL(param) {
	for(var i=0;i<arrMnu.length;i++) {
		if(arrMnu[i].key==param) {
			return arrMnu[i].url;
		}
	}
}

function goURL(param) {
//	alert(param);
	if(!param) return;
	url = getMnuURL(param);
	if(!url) return;
	if(url.indexOf("javascript:")>-1) {
		eval(url.replace("javascript:",""));
	} else if(url.indexOf(".php")<0) {
		goURL(url)	
	} else {
		location.href = "http://www.theclubday.co.kr" + url;
	}
}

function getMnuNM(param) {
	for(var i=0;i<arrMnu.length;i++) {
		if(arrMnu[i].key==param) {
			return arrMnu[i].txt;
		}
	}
}

function goMain(){
	location.href = "http://www.theclubday.co.kr/";
}


// ¿¡µðÅÍ¹öÆ° ·Ñ¿À¹ö
function imgOver(fileName){
        eval("document.getElementById('"+ fileName +"')").src = "/isolation/images/editor/btn_" + fileName + "_o.gif"
}
function imgOut(fileName){
        eval("document.getElementById('"+ fileName +"')").src = "/isolation/images/editor/btn_" + fileName + ".gif"
}

function viewImgPop(fileURL)
{
	var posLt = 50;
	var posTp = 50;
	var popImg = window.open("/lib/include/pop_img.php?FileURL="+fileURL,"popImg","top="+posTp+",left="+posLt+",width=100,height=100");
	popImg.focus();
}

// ÀÐ±â ÆäÀÌÁöÀÇ ³ÑÄ¡´Â ÀÌ¹ÌÁö¸¦ Á¶Á¤ÇÑ´Ù.
function reSizeImgContent(id,width){
	var dom = document.getElementById(id);
	if(dom==null) return false;
	var imgs = dom.getElementsByTagName("img");
	/*
	for (dd in imgs) {
		var tmpImg = new Image();
		tmpImg.src = imgs[dd].src;
		if(tmpImg.width>width) {
			imgs[dd].width=width;
		}
	} 
	*/
	for (i=0;i<imgs.length;i++) {
		var tmpImg = new Image();
		tmpImg.src = imgs[i].src;
		if(tmpImg.width>width) {
			imgs[i].width=width;
		}
	} 
}
