<!--
/* aion COMMON */

var header=[
'<link type=\"text\/css\" rel=\"stylesheet\" media=\"screen\" href=\"http:\/\/static.plaync.com.tw\/aion\/common\/css2\/common.css\" \/>',
'<link type=\"text\/css\" rel=\"stylesheet\" media=\"screen\" href=\"http:\/\/static.plaync.com.tw\/powerbook\/aion_beta\/include\/aion_common_v2.css\"\/>'
];
document.writeln(header.join(''));
if ( location.href.indexOf('rc.search.plaync.co.kr') == -1) {
	var aion_path ='http://aion.plaync.com.tw';
	var power_path ='http://power.plaync.com.tw/aion';
	var qna_path ='http://qna.plaync.com.tw/aion';
} else {
	var aion_path ='http://rc.new.aion.plaync.com.tw';
	var power_path ='http://rc.power.plaync.com.tw/aion';
	var qna_path ='http://rc.qna.plaync.com.tw/aion';
}

function getCookie(cookieName){var cookies=document.cookie;if(cookies.indexOf(cookieName)==-1)return false;cookie=cookies.substr(cookies.indexOf(cookieName));cookie=cookie.split(';')[0];cookie=cookie.substr(cookie.indexOf('=')+1);return cookie;}function getStyleAtt(obj,stylePrp){var att="";if(obj.currentStyle){stylePrp=stylePrp.replace(/\-(\w)/g,function(k,z){return z.toUpperCase();});att=obj.currentStyle[stylePrp];}else if(document.defaultView&&document.defaultView.getComputedStyle)att=document.defaultView.getComputedStyle(obj,null).getPropertyValue(stylePrp);return att;}function imgOverScope(scope){var rollarea;rollarea=(scope==null)?document:scope;imgs=rollarea.getElementsByTagName('img');for(i=0;i<imgs.length;i++){if(imgs[i].className=='over'||imgs[i].className.indexOf('over')>=0){imgs[i].onmouseover=imgOver;imgs[i].onmouseout=imgOver;}}}function imgOver(obj){if(window.event){var img=(obj!=null&&obj.type!='mouseover'&&obj.type!='mouseout')?obj:this;}else var img=(obj.type=='mouseover'||obj.type=='mouseout')?this:obj;var imgurl=img.src;var imginfo=imgurl.substr(imgurl.lastIndexOf('_')+1).split('.');if(imginfo[0]=='on'){img.src=imgurl.substr(0,imgurl.lastIndexOf('_'))+'_off.'+imginfo[1];}else{img.src=imgurl.substr(0,imgurl.lastIndexOf('_'))+'_on.'+imginfo[1];}}function rowClassChange(elementId,tagName,denyClass){if(document.getElementById(elementId)==null)return;var xElement=document.getElementById(elementId).getElementsByTagName(tagName);for(i=0;i<xElement.length;i++){if(xElement[i].className!=denyClass){xElement[i].onmouseover=classOver;xElement[i].onmouseout=classOut;}}}function classOver(obj){if(window.event){var xElement=(obj!=null&&obj.type!='mouseover'&&obj.type!='mouseout')?obj:this;}else var xElement=(obj.type=='mouseover'||obj.type=='mouseout')?this:obj;if(xElement.className=="")xElement.className="on";else xElement.className=xElement.className+" on";}function classOut(obj){if(window.event){var xElement=(obj!=null&&obj.type!='mouseover'&&obj.type!='mouseout')?obj:this;}else var xElement=(obj.type=='mouseover'||obj.type=='mouseout')?this:obj;if(xElement.className=="on")xElement.className="";else xElement.className=xElement.className.replace(" on","");}
function openPopup(obj,objWidth,objHeight,objName,objScroll,deny,objFull,addParam){try{if(typeof(obj)=='string'){var setup="width="+objWidth+",height="+objHeight+",toolbar=no,location=no,status=no,menubar=no,top=20,left=20,scrollbars="+objName+",resizable=no";if(objScroll==""||!objScroll)objScroll="popup";if(objFull)setup="fullscreen=1,scrollbars=0";var win=window.open(obj,objScroll,setup);if(win!=null)win.focus();return;}if(!objName)objName="popup";if(!objScroll)objScroll="auto";var url=addParam?obj.href+'?'+addParam:obj.href;var setup="width="+objWidth+",height="+objHeight+",toolbar=no,location=no,status=no,menubar=no,top=20,left=20,scrollbars="+objScroll+",resizable=no";if(objFull)setup="fullscreen=1,scrollbars=0";var win=window.open(url,objName,setup);if(deny){if(win==null)alert('팝업 차단을 해제하여 주시기 바랍니다.');else win.focus();}}catch(e){}}function flashOpenPage(popUrl,popWidth,popHeight,isScroll,logId){try{_trk_clickTrace("EVT",logId);}catch(_e){}if(popWidth=="0"&&popHeight=="0"){if(isscroll=="0")document.location.href=popUrl;else window.open(popUrl,"_blank");}else{var setup="width="+popWidth+",height="+popHeight+",toolbar=no,location=no,status=no,menubar=no,top=20,left=20,scrollbars="+isScroll+",resizable=no";window.open(popUrl,"openbyflash",setup);}}function toggleMenu(menu,sub){var toggleid=document.getElementById(menu);var togglediv=sub.split('.');var togglesub=toggleid.getElementsByTagName(togglediv[0]);this.openContents=function(){var currentmenu=navigator.userAgent.indexOf("MSIE")==-1?this.nextSibling.nextSibling:this.nextSibling;var menustatus=currentmenu.style.display=='block'?1:0;var closemenu=this.parentNode.getElementsByTagName(currentmenu.tagName);for(i=0;i<closemenu.length;i++){closemenu[i].style.display='none';}if(menustatus)return;currentmenu.style.display='block';};for(i=0;i<togglesub.length;i++){if(togglediv[1]){if(togglesub[i].className!=togglediv[1]){togglesub[i].onclick=this.openContents;}}else{togglesub[i].onclick=this.openContents;}}}function showFlashObject(objID,objSource,objWidth,objHeight,objQuality,objWmode,objBgcolor,objXML){if(objXML){var chkMovie=0;if(objSource.match(/=/))objSource=objSource+"&server="+objXML+"&chkMovie="+chkMovie;else objSource=objSource+"?server="+objXML+"&chkMovie="+chkMovie;}var pageUrl=self.window.location.href;if(pageUrl.substring(0,5)=="https")swfUrl="https";else swfUrl="http";if(!objID)objID="ShockwaveFlash1";if(!objWidth)objWidth="0";if(!objHeight)objHeight="0";if(!objQuality)objQuality="high";if(!objWmode)objWmode="transparent";document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+swfUrl+'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="'+objWidth+'" height="'+objHeight+'" id="'+objID+'" align="middle">');document.writeln('<param name="allowFullScreen" value="false" />');document.writeln('<param name="scale" value="noscale" />');document.writeln('<param name="movie" value="'+objSource+'" />');document.writeln('<param name="allowScriptAccess" value="always" />');document.writeln('<param name="menu" value="false" />');document.writeln('<param name="quality" value="high" />');document.writeln('<param name="bgcolor" value="'+objBgcolor+'" />');document.writeln('<param name="wmode" value="'+objWmode+'" />');document.writeln('<embed src="'+objSource+'" allowScriptAccess="always" menu="false" quality="high" bgcolor="'+objBgcolor+'" wmode="'+objWmode+'" width="'+objWidth+'" height="'+objHeight+'" name="'+objID+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');document.writeln('</object>');}function showMediaObject(objSource,objID,objWidth,objHeight,autostart,showcontrols){if(!objID)objID="MovieClip1";if(!objWidth)objWidth="400";if(!objHeight)objHeight="345";if(!autostart)autostart="0";if(!showcontrols)showcontrols="0";if(-1!=navigator.userAgent.indexOf("MSIE")){document.writeln('<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="'+objID+'" width="'+objWidth+'" height="'+objHeight+'">');document.writeln('<param name="AutoSize" value="1">');document.writeln('<param name="AutoStart" value="'+autostart+'">');document.writeln('<param name="AutoRewind" value="1">');document.writeln('<param name="ClickToPlay" value="0">');document.writeln('<param name="Enabled" value="1">');document.writeln('<param name="EnableTracker" value="1">');document.writeln('<param name="EnableContextMenu" value="0">');document.writeln('<param name="ShowStatusBar" value="0">');document.writeln('<param name="ShowControls" value="'+showcontrols+'">');document.writeln('<param name="ShowAudioControls" value="'+showcontrols+'">');document.writeln('<param name="ShowCaptioning" value="0">');document.writeln('<param name="Mute" value="0">');document.writeln('<param name="ShowDisplay" value="0">');document.writeln('<param name="filename" value="'+objSource+'">');document.writeln('</object>');}else{document.writeln(' <object id="'+objID+'" type="video/x-ms-wmv" data="'+objSource+'" width="'+objWidth+'" height="'+objHeight+'">');document.writeln(' <param name="AutoStart" value="'+autostart+'">');document.writeln(' <param name="AutoRewind" value="1">');document.writeln(' <param name="Enabled" value="1">');document.writeln(' <param name="EnableTracker" value="1">');document.writeln(' <param name="EnableContextMenu" value="0">');document.writeln(' <param name="ShowStatusBar" value="0">');document.writeln(' <param name="ShowControls" value="'+showcontrols+'">');document.writeln(' <param name="ShowAudioControls" value="'+showcontrols+'">');document.writeln(' <param name="ShowCaptioning" value="0">');document.writeln(' <param name="ShowDisplay" value="0">');document.writeln(' <param name="url" value="'+objSource+'">');document.writeln(' <param name="src" value="'+objSource+'">');document.writeln(' </object>');}}
function open_popup(url,wid,hei,scroll,winName) {
	var url=url;
	var posi="width="+wid+",height="+hei+",toolbar=no,location=no,status=no,menubar=no,top=10,left=50,scrollbars="+scroll+",resizable=no";
	if(winName==""){
		winName=popup;
	}
	window.open(url,winName,posi);
}
function showFlashObject(objID,objSource,objWidth,objHeight,objQuality,objWmode,objBgcolor,objXML){
	if(objXML){
	var chkMovie=0;
	if(objSource.match(/=/))objSource=objSource+"&server="+objXML+"&chkMovie="+chkMovie;
	else objSource=objSource+"?server="+objXML+"&chkMovie="+chkMovie;
	}
	var pageUrl=self.window.location.href;
	if(pageUrl.substring(0,5)=="https")swfUrl="https";
	else swfUrl="http";
	if(!objID)objID="ShockwaveFlash1";
	if(!objWidth)objWidth="0";
	if(!objHeight)objHeight="0";
	if(!objQuality)objQuality="high";
	if(!objWmode)objWmode="transparent";
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+swfUrl+'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="'+objWidth+'" height="'+objHeight+'" id="'+objID+'" align="middle">');
	document.writeln('<param name="allowFullScreen" value="false" />');
	document.writeln('<param name="scale" value="noscale" />');
	document.writeln('<param name="movie" value="'+objSource+'" />');
	document.writeln('<param name="allowScriptAccess" value="always" />');
	document.writeln('<param name="menu" value="false" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="bgcolor" value="'+objBgcolor+'" />');
	document.writeln('<param name="wmode" value="'+objWmode+'" />');
	document.writeln('<embed src="'+objSource+'" allowScriptAccess="always" menu="false" quality="high" bgcolor="'+objBgcolor+'" wmode="'+objWmode+'" width="'+objWidth+'" height="'+objHeight+'" name="'+objID+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.writeln('</object>');
}

/* link.js */
function MenuRedirect(ch1,ch2)
{
	var url="";
	if(ch1=='1')	//遊戲情報
	{
		if(ch2=='1')url=aion_path+"/info/search/search";
		else if(ch2=='2')url=aion_path+"/info/abyss/";
		else if(ch2=='3')url=aion_path+"/info/ranking/playerlist?serverID=1";
		else if(ch2=='4')url="http://power.plaync.com.tw/aion";
		else if(ch2=='5')openPopup('http://aioninfo.plaync.com.tw/index.asp',500,500,0,'aioninfo',0,true);
		else if(ch2=='6')url=aion_path+"/aioninfo/gameInterface";
		else if(ch2=='7')url="http://aioninfo.plaync.com.tw/update/update1_5/main.asp";
		else openPopup('http://aioninfo.plaync.com.tw/index.asp',500,500,0,'aioninfo',0,true);
	}
	else if(ch1=='2') //軍團特區
	{
		if(ch2=='1')url=aion_path+"/legion/list";
		else if(ch2=='2')url=aion_path+"/board/publicity/list";
		else url=aion_path+"/legion/list";
	}
	else if(ch1=='3')	//新聞活動
	{
		if(ch2=='1')url=aion_path+"/board/notice/list?category=102";
		else if(ch2=='2')url=aion_path+"/board/notice/list?category=101";
		else if(ch2=='3')url=aion_path+ "/event/list";
		else if(ch2=='4')url=aion_path+"/board/eventwinner/list";
		else if(ch2=='5')url=aion_path+"/board/update/list?category=203";
		else if(ch2=='6')url=aion_path+"/board/notice/list?category=103";
		else url=aion_path+"/board/notice/list?category=102";
	}
	else if(ch1=='4')	//玩家社群
	{
		if(ch2=='1')url=aion_path+"/board";
		else if(ch2=='2')url="http://aioninfo.plaync.com.tw/carton/list.asp";
		else if(ch2=='3')window.open('http://www.youtube.com/user/aiontw','_blank');
		else if(ch2=='4')window.open('http://www.wretch.cc/blog/aiontw','_blank');
		else url=aion_path+"/board";
	}
	else if(ch1=='5')	//帳號管理
	{
		if (ch2=='1') url=aion_path+"/myaion/gameinfo";
		else if(ch2=='2')url="http://aioninfo.plaync.com.tw/accountCenter/paymentInfo.asp";
		else if(ch2=='3')url="https://secure.plaync.com.tw/payment/AION/AIONPayment.aspx";
		else if(ch2=='4')url="https://secure.plaync.com.tw/payment/AION/AionSetAutoPayment.aspx";
		else if(ch2=='5')url="https://secure.plaync.com.tw/payment/gamePaymentHistory.aspx";
		else if(ch2=='6')url="https://event.plaync.com.tw/aion/accountCenter/free7DayApply.asp";
		else if(ch2=='7')window.open('http://www.plaync.com.tw/accountCenter/ABRService/ABRIndex.asp','_blank');
		else if(ch2=='8')window.open('https://secure.plaync.com.tw/payment/additionalSelectGame.aspx');
		else url=aion_path+"/myaion/gameinfo";
	}
	else if(ch1=='6')
	{
		if(ch2=='0')url="http://power.plaync.com.tw/aion/";
	}
	if(url)window.location.href=url;
}

function TopMenu(ch1,ch2)
{
	var url="";
	if(ch1=='1')	//FS專區
	{
		if(ch2=='1')url="http://aioninfo.plaync.com.tw/Fscenter/index.asp";
		else if(ch2=='2')url="http://aioninfo.plaync.com.tw/Fscenter/memberFS.asp";
		else if(ch2=='3')url="http://aioninfo.plaync.com.tw/Fscenter/evil.asp"; // 7/21開放
		else if(ch2=='4')url="http://aioninfo.plaync.com.tw/Fscenter/rulesFS.asp";
		else if(ch2=='5')url="http://aioninfo.plaync.com.tw/Fscenter/contactFS.asp";
		else if(ch2=='6')url=aion_path+"/board/proposal/list";
		else if(ch2=='7')url=aion_path+"/board/improve/list";
		else if(ch2=='8')url="http://aioninfo.plaync.com.tw/Fscenter/diaryFS.asp";
		else url="http://aioninfo.plaync.com.tw/Fscenter/index.asp";
	}
	else if(ch1=='2') //客服中心
	{
		if(ch2=='1')url="http://aioninfo.plaync.com.tw/serviceCenter/index.asp";
		else if(ch2=='2')url="http://aioninfo.plaync.com.tw/serviceCenter/serviceContract.asp";
		else if(ch2=='3')url="http://aioninfo.plaync.com.tw/serviceCenter/faq/faqIndex.asp";
		else if(ch2=='4')url="https://event.plaync.com.tw/aion/serviceCenter/eBox/index.asp";
		else if(ch2=='5')url="http://aioninfo.plaync.com.tw/serviceCenter/accountService.asp";
		else if(ch2=='6')url="http://www.plaync.com.tw/serviceCenter/formDownLoad.asp";
		else url="http://aioninfo.plaync.com.tw/serviceCenter/index.asp";
	}
	else if(ch1=='3')	//下載專區
	{
		if(ch2=='1')url=aion_path+"/download/index";
		else if(ch2=='2')openPopup('http://aioninfo.plaync.com.tw/index.asp#a01b01',500,500,0,'aioninfo',0,true);
		else if(ch2=='3')url="http://aioninfo.plaync.com.tw/download/screenshot.asp";
		else if(ch2=='4')url="http://aioninfo.plaync.com.tw/download/artwork.asp";
		else if(ch2=='5')url="http://aioninfo.plaync.com.tw/download/wallpaper.asp";
		else if(ch2=='6')url="http://aioninfo.plaync.com.tw/download/screensaver.asp";
		else if(ch2=='7')url=aion_path+"/download/fansitekit";
		else url=aion_path+"/download/index";
	}
	if(url)window.location.href=url;
}

function goHome(){window.location.href=aion_path+"/index";}
function goPowerinfo(){window.location.href=power_path}
function goEnchant(){window.location.href=qna_path}
function goServer(myurl,mywidth,myheight,isscroll){if(mywidth=="0"&&myheight=="0"){if(isscroll=="0"){document.location.href=myurl;}else{window.open(myurl,"_blank");}}else{open_popup(myurl,mywidth,myheight,isscroll,"goServer");}}
function goPreServ(){window.location.href=aion_path+"/event/081030_server/";}

/* login zone Script */
var tips=['<div id="logintip1"><p>2007년 5월16일부터 <strong>plaync 통합계정 서비스를 실시</strong>하고 있습니다.</p><p><em>통합계정 실시 후 새롭게 서비스되는 게임은 통합계정으로만<br/>이용이 가능합니다.</em></p><p>기존 <em>리니지, 리니지II를 이용하신 고객님은<br/>통합계정으로 전환하시거나 가입</em>하신 후 이용하세요.</p></div>',
	'<div id="logintip2"><p>2007년 5월 16일부터 <em>1인당 5개의 통합계정(정회원) 가입이 가능</em>합니다.<br />(단, 체험계정은 가입 수를 제한하지 않습니다.)<br />plaync를 더 많이, 더 즐겁게 이용하고 싶다면,<br />지금 바로 계정을 추가해 보세요.</p></div>'];
var logintip = {
	visible : function(event){
		var target = $('logintiplayer');
		var tip = ( $$('fieldset.logout') ) ? tips[0] :tips[1] ;
		var el = Event.element(event);
		if( el.tagName.toUpperCase() != 'SPAN' ) return;
		var p_y = Event.pointerY(event);
		var layerTop = p_y - 280 + 'px';
		target.setStyle({left:'200px',top:layerTop});
		target.innerHTML= tip;
		target.show();
	},
	hidden : function(){
		$('logintiplayer').hide();
	}
};
var loginareaAction=function(){
	if($('id').value=="")	$('id').className="id_default";
	if($('pwd').value=="")	$('pwd').className="pw_default";
	Event.observe($('id'),'focus',function(){if( $('id').className="id_default" ) $('id').className="";});
	Event.observe($('id'),'blur',function(){if(! $('id').value) $('id').className="id_default";});
	Event.observe($('pwd'),'focus',function(){if( $('pwd').className == "pw_default" ) $('pwd').className="";});
	Event.observe($('pwd'),'blur',function(){if(! $('pwd').value) $('pwd').className="pw_default";});
	if($('logintip')){
		Event.observe($('logintip'),'mouseover',logintip.visible);
		Event.observe($('logintip'),'mouseout',logintip.hidden);
	}
};

function startPage(Obj,urlStr){
	if (document.all && window.external){
		Obj.style.behavior='url(#default#homepage)';
		Obj.setHomePage(urlStr);
	} else {
		alert('아이온을 시작페이지로 버튼을 드래그 하여 브라우저 상단의 홈아이콘 위에 올려주세요.');
	}
}

function bookmark(title, url){
	if (document.all)  // IE Favorite
		window.external.AddFavorite(url, title);
	else if (window.sidebar) // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url, "")
	else if (window.sidebar&&window.sidebar.addPanel)
		window.sidebar.addPanel(title,url,"");
}

function obj_gamestart(){
	showFlashObject('start','http://static.plaync.co.kr/aion/swf/layout/gamestart_081224.swf','185','163');
}
function obj_navigation(){
	showFlashObject('navi','http://static.plaync.com.tw/aion/swf/layout/mnav.swf','796','162');
//	showFlashObject('navi','http://static.plaync.co.kr/aion/swf/layout/mnav_090304.swf?ch1=100&searchURL=http://rc.search.plaync.co.kr/aion/index.jsp','796','162');
}
function obj_topnavi(){
	showFlashObject('navi','http://static.plaync.com.tw/aion/swf/layout/top_nav.swf','167','178');
}
function lolgamebanner(myurl,mywidth,myheight,isscroll){
if(mywidth=="0"&&myheight=="0"){
if(isscroll=="0"){
document.location.href=myurl;
}else{
window.open(myurl,"_blank");
}
}else{
open_popup(myurl,mywidth,myheight,isscroll,"lolgamebanner");
}
}

function showTab(e) {
             var el=Event.element(e);
             var list =$('game_tab').select('li');
             var con =$('game_con').select('table');
             var cidx;
             if (el.tagName=='LI') cidx=el.previousSiblings().length;
             else if (el.tagName=='SPAN') cidx=el.parentNode.previousSiblings().length;
             $A(con).each(Element.hide);
             list.each(function(o){o.className='';});
             con[cidx].setStyle({display:''});
             list[cidx].className='on';
}

function getScrollY(){
var scrollY;
if(document.documentElement.scrollTop){
scrollY=document.documentElement.scrollTop;
}
else if(document.body.scrollTop){
scrollY=document.body.scrollTop;
}
else if(window.pageYOffset){
scrollY=pageYOffset;
}
else{
scrollY=0;
}
return scrollY;
}
function getUserWindowY()
{
var winY;
if(window.innerHeight)
{
winY=window.innerHeight;
}
else if(document.documentElement.clientHeight)
{
winY=document.documentElement.clientHeight;
}
else if(document.body.clientHeight)
{
winY=document.body.clientHeight;
}
return winY;
}

function scrollingBanner(obj,parent,offset){
var k=0.1;
var objH=parseInt(getStyleAtt(obj,"height"));
if(isNaN(objH))return false;
if(parent)var parentEl=document.getElementById(parent);
setInterval(function()
{
var agentY=getUserWindowY();
var scrollY=getScrollY();
var objY=parseInt(getStyleAtt(obj,"top"));
var targetY=agentY+scrollY-(objH+offset);
var distanceY=objY-targetY;
var steps=Math.abs(distanceY)*k;
if(objY<targetY){
if(parent){
if(parseInt(obj.style.top)<parentEl.clientHeight-obj.clientHeight-offset)objY+=Math.ceil(steps);
}
else objY+=Math.ceil(steps);
}
else if(objY>targetY)objY-=Math.ceil(steps);
obj.style.top=objY+"px";
},1);
}
function goTop(){document.documentElement.scrollTop=0;}
function getServerList(url) {
	var serverReq=new Ajax.Request(url, {
		method: 'get',
		onSuccess:function(transport) {
			var reqText=transport.responseText;
			var servers=reqText.split(',');
			servers=servers.sort();
			var allServers=[];
			var qserver;
			for (var i=0; i<servers.length; i++) {
				qserver=servers[i].split(':');
				allServers.push('<li><a rel=\"'+qserver[1].strip()+'\">'+qserver[0].strip()+'</a></li>')
			}
		$('serverList').update(allServers.join(''));
		serverSelect($('serverList').select('a')[0],'Y');
		}
	});
}
var serverSelect = function(e,first) {
	var obj=$('serverList').select('li');
	var el=Object.isElement(e) ? e : Event.element(e);
	var idx=Object.isElement(e) ? 0 : 1;
	var current,cotent,size,html,start,first;
	var max=6;
	if (el.tagName=="A") {
		current=el.up().previousSiblings().length;
		group=parseInt(current/6);
		idx=current%6;
		start=group*6;
		html=['<li><a rel=\"all\">전체</a></li>'];
		for (var i=group*6;i<(group*6)+6;i++) {
			start++;
			if (start>=obj.length+1) continue;
			html.push('<li>'+obj[i].innerHTML+'</li>');
		}
		$('view_server').update(html.join(''));
		if (first=='Y') $('view_server').select('li')[idx].className='on';
		else $('view_server').select('li')[idx+1].className='on';
	}
	$('sel_list').removeClassName('on');
}

	var allServer = function(e) {
	var el = Event.element(e);
	var obj = el.next();
	if (el.tagName=='DT') obj.toggleClassName('on');
}

var sel_on = function(e) {
	var el = Event.element(e);
	var obj = this.select('li');
	if (el.up().tagName=="LI") {
		for (var i=0;i<obj.length;i++) {
			if (el.up()==this.select('li')[i]) {
			 this.select('li')[i].addClassName('on');
			}else {
			 this.select('li')[i].removeClassName('on');
			}
		}
	}
}

var sel_default = function() {
	serverSelect($('serverList').select('a')[0],'Y');
	if ($('sel_race')) {
		$('sel_race').select('li.on')[0].className="";
		$('sel_race').select('li')[0].className="on";
	} 
	else return;
	if ($('sel_class')) {
		$('sel_class').select('li.on')[0].className="";
		$('sel_class').select('li')[0].className="on";
	}
	else return;
}





var MyAzitList='';
var MyAzit={
getAzitList:function(src){
var head=document.getElementsByTagName('HEAD')[0];
if(MyAzitList!=''){
head.removeChild(MyAzitList);
}
MyAzitList=document.createElement('SCRIPT');
MyAzitList.src=src;
head.appendChild(MyAzitList);
},
goAzit:function(){
var obj=$('azitList');
var selectedValue=obj.options[obj.selectedIndex].value;
if(selectedValue!=""){
window.location.href=selectedValue;
}
}
};
function getMyAzitList(azitApiData){
var jsonObj=eval(azitApiData);
var aionAzitListInfo=azitApi_UserAzitListByGameCode(27);
var cnt=aionAzitListInfo.azitapi.length;
var combobox=$('myAzitList');
var _oldServerId=-1;
var _newServerId="";
var _optGroup="";
var prevUrl="";
var innerHTML='<select name="azitList" id="azitList" onchange="MyAzit.goAzit();">';
innerHTML=innerHTML+'<option value="">레기온 아지트 바로가기</option>';
for(var i=0;i<cnt;i++){
var url=aionAzitListInfo.azitapi[i].userAzitContainer.userAzitInfo.azitUrl;
var name=aionAzitListInfo.azitapi[i].userAzitContainer.userAzitInfo.azitName;
var serverID=aionAzitListInfo.azitapi[i].userAzitContainer.userAzitInfo.serverID;
var serverName=aionAzitListInfo.azitapi[i].userAzitContainer.userAzitInfo.categoryPath;
var arrServerName=serverName.split('>');
_newServerId=aionAzitListInfo.azitapi[i].userAzitContainer.userAzitInfo.categoryID;
if(prevUrl!=url){
innerHTML=innerHTML+'<option value="'+url+'">'+name+'</option>';
}
prevUrl=url;
}
innerHTML=innerHTML+"</select>";
$('myAzitList').innerHTML=innerHTML;
}
function azitApi_UserAzitListByGameCode(gameCode){
var userAzitListByGameCode={"azitapi":[]};
var azitApiDataObj=eval(azitApiData);
var i=0;
var j=0;
while(azitApiDataObj.azitapi[i]!=null){
if(azitApiDataObj.azitapi[i].userAzitContainer.userAzitInfo.gameCode==gameCode){
userAzitListByGameCode.azitapi[j]=azitApiDataObj.azitapi[i];
j++;
}
i++;
}
return userAzitListByGameCode;
}
var MyAion={
goUrl:function(url){
this._loginCheck(url);
},
_loginCheck:function(url){
new Ajax.Request('/common/inc/loginCheck',
{
method:'post',
encoding:'UTF-8',
onSuccess:function(request){
if(request.responseText=='true'){location.href=url;}
else{alert("로그인이 필요한 메뉴입니다.");}
},
onFailure:function(){alert("잠시 후에 다시 이용해 주십시오.");}
}
);
}
};
var serviceTabStatus=0;
function showService(num) {
var sTab = $('tab').select('li');
var sInfo = $('service_info').select('p');
	for (var i=1; i<4; i++) {
		$("show"+i).style.display = "none";
	}
	if (serviceTabStatus != num ) {
		$("show"+num).style.display = "block";
		$('tab').className = 'm_tab'+num;
		serviceTabStatus = num;
	} else {
		$("show"+num).style.display = "none";
		$('tab').className = 'm_tab';
		serviceTabStatus = 0;
	}
}

function viewMyAzitList(azitApiData) {
	var jsonObj=eval(azitApiData);
	var aionAzitListInfo = azitApi_UserAzitListByGameCode(27);
	var cnt=aionAzitListInfo.azitapi.length;	
	var innerHTML = ''
	var prevUrl = '';
	if(cnt > 0) {
		for(var i=0;i<cnt;i++){
			var url = aionAzitListInfo.azitapi[i].userAzitContainer.userAzitInfo.azitUrl;
			var name = aionAzitListInfo.azitapi[i].userAzitContainer.userAzitInfo.azitName;
			if(prevUrl!=url){
				innerHTML += '<li><a href="'+url+'">'+name+'</a></li>';
			}
			prevUrl = url;
		}
	} else {
		innerHTML += '가입한 레기온 아지트가<br/> 없습니다';
	}
	
	document.getElementById("lyr_azitlist").style.display = "block";
	$('myAzitList').innerHTML=innerHTML;
}

function showAzit(type) {
	if(type == 'off') {
		$('lyr_azitlist').style.display = 'none';
	}
}

if (location.href.indexOf('rc.power.plaync.com.tw') == -1) {
	var root_path = 'http://power.plaync.com.tw/';
	var doc_path = 'http://power.plaync.com.tw/aion/';
	var src_path = 'http://power.plaync.com.tw/exe/ao1/';
	var img_path = 'http://powerfs.plaync.com.tw/aion/img/';
	var fs_path =  'http://powerfs.plaync.com.tw/aion/';
	var aion_path ='http://aion.plaync.com.tw';
} else {
	var root_path = 'http://rc.power.plaync.com.tw/';
	var doc_path = 'http://rc.power.plaync.com.tw/aion/';
	var src_path = 'http://rc.power.plaync.com.tw/exe/ao1/';
	var img_path = 'http://rc.power.plaync.com.tw/aion/img/';
	var fs_path =  'http://rc.power.plaync.com.tw/fs_ao1/';
	var aion_path = 'http://rc.new.aion.plaync.com.tw';

//	var root_path = 'http://rc-power.plaync.jp/';
//	var doc_path = 'http://rc-power.plaync.jp/aion/';
//	var src_path = 'http://rc-power.plaync.jp/exe/ao1/';
//	var img_path = 'http://rc-power.plaync.jp/aion/img/';
//	var fs_path = 'http://rc-power.plaync.jp/fs_ao1/';
//	var aion_path ='http://rc.new.aion.plaync.co.kr';
}
	var static_path ='http://static.plaync.com.tw/powerbook/aion/img/';

var isIE = document.all ? true : false;
	
var keepalive_trial = 0;
function keepalive() {
           var url = src_path + 'index.php';
           pars = "";
           var myAjax = new Ajax.Request(url, { method: 'post', postBody: pars, onComplete: ''});
           
           keepalive_trial++;
           if(keepalive_trial < 5) {
                     setTimeout("keepalive()", 600000);  // 以10分鐘爲一單位 反覆5次
           }
}

function trim(st) {
	while(st) {
		if (st.indexOf(" ")==0) st = st.substring(1);
		else break;
	}
	while(st){
		if (st.lastIndexOf(" ")==st.length-1) st = st.substring(0, st.length-1);
		else break;
	}
	return st;
}

function trim_all(checkform) {
	var i=0;
	while (i < checkform.length) {
		if (checkform.elements[i].type != 'file') {
			checkform.elements[i].value = trim(checkform.elements[i].value);
		}
		i++;
	}
	return true;
}

function is_null(obj, message) {
	if (obj.value.length==0) { alert(message+'\t'); obj.focus(); return true; }
	return false;
}

function layer_toggle(obj) {
	if (obj.style.display == 'none') obj.style.display = 'block';
	else if (obj.style.display == 'block') obj.style.display = 'none';
}

function is_checked(obj) {
	var flag = false;
	for(var i =0; i < obj.length ; i++) {
		flag = flag | obj[i].checked;
	}
	if (obj.length == undefined) flag = true;
	return flag;
}

function url_encode(str) {
	return str.replace(/&/g, '%26');
}


function dec_tag_value(str) {
	str = str.replace(/quot;/g, '"');
	str = str.replace(/#39;/g, '&#39;');
	str = str.replace(/lt;/g, '<');
	str = str.replace(/gt;/g, '>');
	return str;
}

function onclick_member_info(no) {
	window.open('/member_info.php?no='+no,'mi', 'width=630,height=800');
}

function onclick_mk(code, obj) {
	var mk1 = static_path + 'mk1.gif'; 
	var mk2 = static_path + 'mk2.gif'; 
	if (obj.src == mk1) {
		document.getElementById('area_'+code).style.display = 'block';
		obj.src = mk2;
	} else {
		document.getElementById('area_'+code).style.display = 'none';
		obj.src = mk1;
	}
}

function onclick_open(code_set) {
	var mk1 = static_path + 'mk1.gif'; 
	var mk2 = static_path + 'mk2.gif'; 

	for(var i=0; i < code_set.length; i++) {
		document.getElementById('area_'+code_set[i]).style.display = 'block';
		document.getElementById('img_'+code_set[i]).src = mk2;
	}  

}

function onclick_close(code_set) {
	var mk1 = static_path + 'mk1.gif'; 
	var mk2 = static_path + 'mk2.gif'; 

	for(var i=0; i < code_set.length; i++) {
		document.getElementById('area_'+code_set[i]).style.display = 'none';
		document.getElementById('img_'+code_set[i]).src = mk1;
	}  
}



/* tb_history */
var onhistory = {
	load : function(){
		$('layer_history').setStyle({display:'none'});
		Event.observe($('tb_history'),'mouseover',onhistory.show);
		Event.observe($('tb_history'),'mouseout',onhistory.hide);
	},
	show : function(event){
		var doc_no, ver_on, p_x, p_y, layerLeft, layerTop;
		var el = Event.element(event);
		if( el.tagName.toUpperCase() != 'SPAN' ) return;
		var _id = el.id.split('_');
		p_x = Event.pointerX(event);
		p_y = Event.pointerY(event);
		layerLeft = p_x + 'px';
		layerTop = p_y + 15 + 'px';
		$('layer_history').setStyle({top:layerTop,left:layerLeft});
		doc_no = _id[1];
		ver_no = _id[2];

		var url = src_path+'ajax_exe_con.php';
		pars = 'mode=check_doc_history';
		pars += '&doc_no='+doc_no;
		pars += '&ver_no='+ver_no;
		var myAjax = new Ajax.Request(url, { method: 'post', postBody: pars, onComplete: onhistory.display });
	},
	display : function(originalRequest) {
		var result = originalRequest.responseText;
		$('layer_history').innerHTML = result;
		$('layer_history').setStyle({display:'block'});
	},
	hide : function(){
		$('layer_history').setStyle({display:'none'});
	}
}

/* idxlist  */
var togIndex = function(obj){
	var parent = obj.parentNode;
	if(obj.className == 'off'){
		parent.style.height="24px";
		obj.className='on';
		obj.nodeValue=obj.title='開啓';
	}else{
		parent.style.height="";
		obj.className='off';
		obj.nodeValue=obj.title='關閉';
	}
}

/* resize dl thumbnail */
function setDlThumb(){
	var dl_thumb = $$('div.dl_thumb')[0];
	var dl_thumb_obj = dl_thumb.select('img')[0];
	var setLeft, setTop;
	var p_w = parseInt(dl_thumb.getStyle('width'));
	var p_h = parseInt(dl_thumb.getStyle('height'));
	var w = dl_thumb_obj.getWidth();
	var h = dl_thumb_obj.getHeight();
	if( w > p_w ) 	setLeft = -(Math.ceil(Math.abs(w - p_w)/2))+'px';
	else setLeft = 0;
	if( h > p_h )	setTop =  -(Math.ceil(Math.abs(h - p_h)/2))+'px';
	else setTop = 0;
	$(dl_thumb_obj).setStyle({left:setLeft,top:setTop});
}

var oldEditorObj = "";
viewObj=function(obj){
	if (oldEditorObj != obj && oldEditorObj != "") hideObj(oldEditorObj);
	if(document.getElementById(obj).style.display == "block") hideObj(obj);
	else document.getElementById(obj).style.display = "block";
	oldEditorObj = obj;
	htmleditor.document.body.focus();
}

hideObj=function(obj){
	document.getElementById(obj).style.display="none";
}

/* Item tree for Powerbook
 * author : yeongun@ncsoft.net
 * last update: 2008.08.08
 * (c) 2008 ncsoft UIDevelopment Team */
var Itemtree={
	icon:['http://static.plaync.com.tw/powerbook/lineage/content/ic_c2.gif','http://static.plaync.com.tw/powerbook/lineage/content/ic_o2.gif'],
	load:function() {
		var treeList=$$('div.div_itemtree');
		var branch,branch2,handle;
		if (treeList.length==0) return;
		for (trees=0;trees<treeList.length;trees++) {
			branch=treeList[trees].getElementsByTagName('li');		
			for (i=0;i<branch.length;i++) {
				branch2=branch[i].getElementsByTagName('ul');
				if (i!=0&&branch2.length>0) {
					branch2[0].style.display='none';
					branch[i].innerHTML+='<img src="'+Itemtree.icon[0]+'" class="tree_branch" />';
				}
			}
			Event.observe(treeList[trees].select('img.tree_open')[0],'click',Itemtree.extend);
			Event.observe(treeList[trees].select('img.tree_close')[0],'click',Itemtree.extend);
		}
		handle=$$('img.tree_branch');
		for (handles=0;handles<handle.length;handles++) 
			Event.observe(handle[handles],'click',Itemtree.fold);
	},
	fold:function(e) {
		var element=Event.element(e);
		var icUrl=['ic_o.gif','ic_c.gif'];
		if (element.tagName.toUpperCase()!='IMG') return;
		var target=element.ancestors()[0].select('ul')[0];
		if (target.getStyle('display').toUpperCase()!='NONE') {
			target.setStyle({display:'none'});
			element.src=Itemtree.icon[0];
		}
		else {
			target.setStyle({display:''});
			element.src=Itemtree.icon[1];
		}	
	},
	extend:function(e) {
		var element=Event.element(e);
		var ancestors=element.ancestors();
		var list=Itemtree.findtree(ancestors);
		var targets=list.getElementsByTagName('ul');
		var handle=$$('img.tree_branch');
		var basis=(element.className.toUpperCase()=='TREE_OPEN') ? 1 : 0;
		for (i=0;i<targets.length;i++) {
			if (!basis)
				targets[i].style.display=(i!=0) ? 'none' : '';
			else targets[i].style.display='';
		}
		for (j=0;j<handle.length;j++)
			handle[j].src=(basis) ? Itemtree.icon[1] : Itemtree.icon[0];
	},
	findtree:function(data) {
		for (i=0;i<data.length;i++) {
			if (data[i].className=='div_itemtree') {
				return data[i].select('ul.ul_itemtree')[0];
			}
		}	
	}
}


// Event.observe(window,'load',Itemtree.load);

-->