
/////////////////// SSL º¸¾È»çÀÌÆ® Àû¿ë (2008.09 Á¤¿ø°æ) ///////////////////////////////
if (location.hostname=="bestsoul.com")
{
           location.href="http://www.bestsoul.com";
}
if (location.hostname=="stx-soul.co.kr")
{
           location.href="http://www.stx-soul.co.kr";
}


mylocation = location.href;
ssl_url= "https://www.bestsoul.com:447"
ssl_url2= "https://www.stx-soul.co.kr:448"

web_url= "http://www.bestsoul.com"
web_url2= "http://www.stx-soul.co.kr"

mypath = location.pathname;
pagename = mypath.split("/");

if (location.hostname=="www.bestsoul.com")
{
           if (location.protocol=="http:"){ //http·Î Á¢¼Ó½Ã https·Î °­Á¦ ÀÌµ¿½ÃÅ´
                     fullpath= mylocation.split(web_url);
                     location.href=ssl_url + fullpath[1];
           }else{//https·Î Á¢¼Ó½Ã 
           }

}

if (location.hostname=="www.stx-soul.co.kr")
{
           if (location.protocol=="http:"){ //http·Î Á¢¼Ó½Ã https·Î °­Á¦ ÀÌµ¿½ÃÅ´
                     fullpath= mylocation.split(web_url2);
                     location.href=ssl_url2 + fullpath[1];
           }else{//https·Î Á¢¼Ó½Ã 
           }

}


var sw = screen.availWidth;
var sh = screen.availHeight;

// À©µµ¿ì ¿ÀÇÂ
function openWindowCenter(url,name,width,height,scrollbars) {
	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();

/* °ü¸®ÀÚ ¸Þ´º Á¤¸® */

//Top ¸Þ´º
arrMnu.push({key:"home",		txt:"¸ÞÀÎ",				url:"/service/default.aspx"});
arrMnu.push({key:"login",		txt:"·Î±×ÀÎ",			url:"/service/membership/login.aspx"});
arrMnu.push({key:"logout",		txt:"·Î±×¾Æ¿ô",			url:"membership4"});
arrMnu.push({key:"contact",		txt:"CONTACT",			url:"javascript:void openWindowCenter('/service/contactus/send.aspx','contact',600,486,0);"});

arrMnu.push({key:"membership",	txt:"MEMBERSHIP",		url:"membership2"});
arrMnu.push({key:"membership1",	txt:"·Î±×ÀÎ",			url:"/service/membership/login.aspx"});
arrMnu.push({key:"membership2",	txt:"È¸¿ø°¡ÀÔ",			url:"/service/membership/join/step1.aspx"});
arrMnu.push({key:"membership3",	txt:"ID/PWÃ£±â",		url:"/service/membership/find_id_pw.aspx"});
arrMnu.push({key:"membership4",	txt:"·Î±×¾Æ¿ô",			url:"/service/membership/logout.aspx"});

arrMnu.push({key:"sitemap",		txt:"SITEMAP",			url:"sitemap1"});
arrMnu.push({key:"sitemap1",	txt:"SITEMAP",			url:"/service/sitemap/sitemap.aspx"});

arrMnu.push({key:"mypage",		txt:"MYPAGE",			url:"mypage1"});
arrMnu.push({key:"mypage1",		txt:"ÂÊÁöÇÔ",			url:"/service/mypage/paper/recive.aspx"});
arrMnu.push({key:"mypage2",		txt:"È¸¿øÁ¤º¸¼öÁ¤",		url:"/service/mypage/member_modify.aspx"});
arrMnu.push({key:"mypage3",		txt:"È¸¿øÅ»Åð",			url:"/service/mypage/member_secession.aspx"});

arrMnu.push({key:"stxsoul",		txt:"STX Soul",			url:"stxsoul1"});
arrMnu.push({key:"stxsoul1",	txt:"STX Soul±×·ì¼Ò°³",	url:"/service/stxsoul/company_introduce.aspx"});
arrMnu.push({key:"stxsoul2",	txt:"STX Soul ¼Ò°³",	url:"/service/stxsoul/stxsoul_introduce.aspx"});
arrMnu.push({key:"stxsoul3",	txt:"´ÜÀåÀÎ»ç¸»",		url:"/service/stxsoul/head.aspx"});
arrMnu.push({key:"stxsoul4",	txt:"¿¬Çõ/¼ö»ó³»¿ª",	url:"/service/stxsoul/history.aspx"});

arrMnu.push({key:"gamer",		txt:"¼±¼ö°ü¸®",			url:"gamer1"});
arrMnu.push({key:"gamer1",		txt:"¼±¼ö¼Ò°³",			url:"/service/gamer/gamer/list.aspx"});
arrMnu.push({key:"gamer2",		txt:"ÄÚÄª½ºÅÂÇÁ¼Ò°³",	url:"/service/gamer/staff/list.aspx"});
arrMnu.push({key:"gamer3",		txt:"¼Ò¿ï°¶·¯¸®",		url:"/service/gamer/soul_gallery/list.aspx"});

arrMnu.push({key:"news",		txt:"´º½º°ü¸®",			url:"news1"});
arrMnu.push({key:"news1",		txt:"°øÁö»çÇ×",			url:"/service/news/notice/list.aspx"});
arrMnu.push({key:"news2",		txt:"¾ð·Ð±â»ç",			url:"/service/news/news_article/list.aspx"});
arrMnu.push({key:"news3",		txt:"¼Ò¿ïÀÌ¾ß±â",		url:"/service/news/soul_story/list.aspx"});

arrMnu.push({key:"schedule",	txt:"ÀÏÁ¤°ü¸®",			url:"schedule1"});
arrMnu.push({key:"schedule1",	txt:"°æ±âÀÏÁ¤/Çà»ç",	url:"/service/schedule/schedule_game_event/calendar.aspx"});
arrMnu.push({key:"schedule2",	txt:"°æ±â°á°ú",			url:"/service/schedule/game_result/list.aspx"});
arrMnu.push({key:"schedule3",	txt:"ÆÀ¼øÀ§",			url:"/service/schedule/team_rank/team_ranking.aspx"});

arrMnu.push({key:"community",	txt:"Ä¿¹Â´ÏÆ¼°ü¸®",		url:"community1"});
arrMnu.push({key:"community1",	txt:"ÀÚÀ¯°Ô½ÃÆÇ",		url:"/service/community/free_board/list.aspx"});
arrMnu.push({key:"community2",	txt:"ÈÄ±â°Ô½ÃÆÇ",		url:"/service/community/afternote/list.aspx"});
arrMnu.push({key:"community3",	txt:"ÇÑÁÙ¸Þ¸ðÀå",		url:"/service/community/one_word/default.aspx"});
arrMnu.push({key:"community4",	txt:"QA",				url:"/service/community/qa/list.aspx"});
arrMnu.push({key:"community5",	txt:"¼±¼ö°Ô½ÃÆÇ",		url:"/service/community/player_board/default.aspx"});
arrMnu.push({key:"community51",	txt:"¼±¼ö°Ô½ÃÆÇ",		url:"/service/community/player_board/list.aspx"});
arrMnu.push({key:"community6",	txt:"Ä¡¾îÇ®",			url:"/service/community/cheerful/list.aspx"});
arrMnu.push({key:"community7",	txt:"ÆÒ°¶·¯¸®",			url:"/service/community/fan_gallery/list.aspx"});

arrMnu.push({key:"download",	txt:"´Ù¿î·Îµå°ü¸®",		url:"download1"});
arrMnu.push({key:"download1",	txt:"¿ùÆäÀÌÆÛ",			url:"/service/download/wallpaper/list.aspx"});
arrMnu.push({key:"download2",	txt:"½ºÅ©¸°¼¼ÀÌ¹ö",		url:"/service/download/screensaver/list.aspx"});
arrMnu.push({key:"download3",	txt:"VOD",				url:"/service/download/vod/list.aspx"});
arrMnu.push({key:"download4",	txt:"ÀÚ·á½Ç",			url:"/service/download/pds/list.aspx"});

arrMnu.push({key:"reqLogin",	txt:"·Î±×ÀÎÇÊ¿ä",		url:"javascript:void alert('·Î±×ÀÎ ÈÄ ÀÌ¿ëÇØ ÁÖ½Ê½Ã¿À')"});
arrMnu.push({key:"privacy",		txt:"°³ÀÎÁ¤º¸Ãë±Þ¹æÄ§",	url:"javascript:void window.open('/service/etc/personal.htm','personal','width=700,height=600')"});

function getMnuURL(param) {
	for(var i=0;i<arrMnu.length;i++) {
		if(arrMnu[i].key==param) {
			return arrMnu[i].url;
		}
	}
}

function getMnuTXT(param) {
	for(var i=0;i<arrMnu.length;i++) {
		if(arrMnu[i].key==param) {
			return arrMnu[i].txt;
		}
	}
}
function goURL(param,param2) {
	if(!param) return;
	url = getMnuURL(param);
	if(!url) return;
	if(url.indexOf("javascript:")>-1) {
		eval(url.replace("javascript:",""));
	} else if(url.indexOf(".asp")<0) {
		goURL(url)	
	} else {
		if(param2==undefined)
		{
			location.href = url
		}
		else
		{
			location.href = url +"?"+param2;
		}
	}
}

// ÀÐ±â ÆäÀÌÁöÀÇ ³ÑÄ¡´Â ÀÌ¹ÌÁö¸¦ Á¶Á¤ÇÑ´Ù.
function reSizeImgContent(id,width){
	var dom = document.getElementById(id);
	var imgs =dom.getElementsByTagName("img");
	for (var i=0;i<imgs.length;i++) {
		var tmpImg = new Image();
		tmpImg.src = imgs[i].src;
		if(tmpImg.width>width) {
			var x = tmpImg.width;
			var y = tmpImg.height;
			var x1 = width-1;
			var y1=0;
			imgs[i].width=width-1;
			imgs[i].height=Math.floor(x1*y/x);
		}
		imgs[i].style.cursor="pointer";
		imgs[i].onclick= function(){
			openWindowCenter("/service/lib/pop_img.aspx?strFileURL="+escape(this.src),'imgpop'+i,100,100,1);
		};
	} 
}

// html generate ÇÔ¼ö
function navi(param) {
	if(!param) return;
	arrParam = param.split("|");
	var str  = "<div class=\"tar\">";
	str += "<span style='color:#908f8f'></span> <span style='color:#908f8f'>Home</span> <span style='color:#908f8f'>></span> "
	for(var i=0;i<arrParam.length;i++) {
		if(i<arrParam.length-1) {
			str += "<span style='color:#908f8f'>"+getMnuNM(arrParam[i])+"</span> <span style='color:#908f8f'>><span> ";
		} else {
			str += "<span style='color:#908f8f'>"+getMnuNM(arrParam[i])+"</span>";
		}
	}
	str += "</div>";
	document.write(str);
}


function getMnuNM(param) {
	for(var i=0;i<arrMnu.length;i++) {
		if(arrMnu[i].key==param) {
			return arrMnu[i].txt;
		}
	}
}

function noticeStr(value){
	alert(value);
}

function chkLogin(){
	alert("·Î±×ÀÎ ÇØÁÖ¼¼¿ä");
}

// ÁÖÀü ¼±¼ö ¸µÅ© °É±â
function selectPlayer(value){
	if(value == 1)
		location.href('/service/gamer/gamer/read.aspx?oidPlayer=1');
	else if (value == 2)
		location.href('/service/gamer/gamer/read.aspx?oidPlayer=5');
	else if (value == 3)
		location.href('/service/gamer/gamer/read.aspx?oidPlayer=17');
	else if (value == 4)
		location.href('/service/gamer/gamer/read.aspx?oidPlayer=3');
	else if (value == 5)
		location.href('/service/gamer/gamer/read.aspx?oidPlayer=4');
	else if (value == 6)
		location.href('/service/gamer/gamer/read.aspx?oidPlayer=2');
	else if (value == 7)
		location.href('/service/gamer/gamer/read.aspx?oidPlayer=14');
	
}

//°ü°è»ç¹Ù·Î°¡±â
function goCompany(param)
{
	if(param == 0)	//STX Corporation
		void window.open('http://www.stx.co.kr','STX_CORPORATION');
	else if (param == 1)	//STX Pan Ocean
		void window.open('http://www.stxpanocean.co.kr/kor/main.aspx','STX_FOUNDATION');
	else if (param == 2)	//STXÁ¶¼± 
		void window.open('http://www.stxship.co.kr/','STX_Offshore_Ship');
	else if (param == 3)	//STXÀ¯·´
		void window.open('http://www.stxeurope.com/','STX_Europe');
	else if (param == 4)	//STX¿£Áø
		void window.open('http://www.stxengine.co.kr/','STX_ENGINE');
	else if (param == 5)	//STXÁß°ø¾÷
		void window.open('http://www.stxhi.co.kr/','STX_HI');
	else if (param == 6)	//STX¿£ÆÄÄÚ
		void window.open('http://www.stxenpaco.co.kr/','STX_ENPACO');
	else if (param == 7)	//STX¿¡³ÊÁö
		void window.open('http://www.stxenergy.co.kr/','STX_ENERGY');
	else if (param == 8)	//STX°Ç¼³
		void window.open('http://www.stxconst.co.kr/','STX_CONST');
	else if (param == 9)	//STX¼Ö¶ó
		void window.open('http://www.stxsolar.co.kr/','STX_Solar');
}

function clipLinkMsg(url,param) {
	if(!param) {
		alert("¸µÅ©°¡ ÀÚµ¿À¸·Î º¹»çµÇ¾îÁ³½À´Ï´Ù");
	} else {
		alert(param);
	}
	clipboardData.setData('Text',url);
}

function mainLogin(id, pw)
{
	var frm = document.getElementById("frm");
	frm.strID.value = id;
	frm.strPassword.value = pw;
	
	validate();
}

function swapDepth(action)
{
	
	var img = document.getElementById("image_area");
	var fla = document.getElementById("flash_area");
	
	if( action == '1') {
		fla.style.display = 'block';
		sendID();
	}
	else{
		fla.style.display = 'none';
	}
}

function sendID()
{
	var footerFlash = document.getElementById("footerFlash");
	footerFlash.SetVariable("getStartInfo","2");
}