
var build,numTabs,leftTips,rightTips;function Builder(className)
{this.className=className;this.pointsSpent=0;this.levelCap=50;this.hasAwakened=0;this.skillsJs=JSON.decode(className);this.skillsPvpJs=JSON.decode('pvp'+className);this.currentSelectedTab=0;this.optionHideHighLevels=0;this.optionPvpInfo=0;this.skillList=new Hash();}
Builder.prototype.GetSPCap=function(level)
{return this.GetSPForLevel(level)+this.GetBookSPForLevel(level);}
Builder.prototype.Init=function()
{this.InitTabs();this.AddSkillsToTabs();this.AddGrantedSkills();}
Builder.prototype.GetSPForLevel=function(level)
{var sp=0,i=0;for(i=1;i<level;i++)
sp+=30+i-1;return sp;}
Builder.prototype.GetBookSPForLevel=function(level)
{if(level==40)
return 290;else if(level==50)
return 350;else
return 675;}
Builder.prototype.AddGrantedSkills=function()
{$each(this.skillsJs.Granted,function(skill,i){this.AddActiveSkill(skill,true);},this);this.UpdateAllSkillDisplay();}
Builder.prototype.AddAwakenedSkills=function()
{$each(this.skillsJs.AwakeningGranted,function(skill,i){this.AddActiveSkill(skill,true);},this);$each(this.skillList,function(skill,i){if(skill.skill.awaken!==undefined)
skill.injectElement();},this);}
Builder.prototype.InitTabs=function()
{numTabs=0;var allTab=new Element('div',{'id':'taball','style':'display:none'});allTab.inject($('currentskillarea'));$each(this.skillsJs.Trees,function(tree,num){var left=18+num*60+num*15,leftPlus=left+455,i=0,j=0,tempButton=new Element('span',{'class':'tabunselected','id':'tab'+tree.id+'button','html':tree.name,'style':'top:65px; left:'+left+'px;'}),tempCurrentButton=new Element('span',{'class':'tabunselected','id':'tab'+tree.id+'currentbutton','html':tree.name,'style':'top: 65px; left:'+leftPlus+'px;'}),tempTab=new Element('div',{'id':'tab'+tree.id,'style':'display:none'}),tempCurrentTab=new Element('div',{'id':'tab'+tree.id+'current','style':'display:none'}),tempAllTitle=new Element('span',{'id':'alltabtitlesub'+tree.id,'html':tree.name}),tempAllDiv=new Element('div',{'id':'alltabsub'+tree.id,'class':'currentalldiv'});if(tree.id===0)
{tempButton.setProperty('class','tabselected');tempCurrentButton.setProperty('class','tabselected');tempTab.set('styles',{'display':'block'});tempCurrentTab.set('styles',{'display':'block'});}
tempTab.inject($('skillarea'));tempButton.inject($('skillarea'),'before');tempCurrentButton.inject($('currentskillarea'),'before');tempCurrentTab.inject($('currentskillarea'));tempAllTitle.inject($('taball'));tempAllDiv.inject($('taball'));tempTab.store('num',tree.id);tempButton.store('num',tree.id);tempCurrentButton.store('num',tree.id);tempCurrentTab.store('num',tree.id);numTabs++;});var allButtonLeft=18+(numTabs)*60+(numTabs)*15+455,allButton=new Element('span',{'class':'taballunselected','id':'taballbutton','html':'All','style':'top:65px; left:'+allButtonLeft+'px;'});allButton.store('num',numTabs);allTab.store('num',numTabs);allButton.inject($('currentskillarea'),'before');$('taballbutton').addEvent('mousedown',function(e)
{e.preventDefault();this.oncontextmenu=function()
{return false;};build.currentSelectedTab=this.retrieve('num');for(j=0;j<numTabs;j++)
{$('tab'+j+'current').setProperty('style','display:none');$('tab'+j+'currentbutton').setProperty('class','tabunselected');}
$('taballbutton').setProperty('class','taballselected');$('taball').setProperty('style','display:block');});for(i=0;i<numTabs;i++)
{$('tab'+i+'button').addEvent('mousedown',function(e)
{e.preventDefault();this.oncontextmenu=function()
{return false;};for(j=0;j<numTabs;j++)
{if(this.retrieve('num')==j)
{$('tab'+j).set('styles',{'display':'block'});$('tab'+j+'button').setProperty('class','tabselected');if(build.currentSelectedTab!=($('taballbutton')).retrieve('num'))
{$('tab'+j+'current').setProperty('style','display:block');$('tab'+j+'currentbutton').setProperty('class','tabselected');}}
else
{$('tab'+j).set('styles',{'display':'none'});$('tab'+j+'button').setProperty('class','tabunselected');$('tab'+j+'current').setProperty('style','display:none');$('tab'+j+'currentbutton').setProperty('class','tabunselected');}}});$('tab'+i+'currentbutton').addEvent('mousedown',function(e)
{e.preventDefault();this.oncontextmenu=function()
{return false;};for(j=0;j<numTabs;j++)
{if(this.retrieve('num')==j)
{$('tab'+j).set('styles',{'display':'block'});$('tab'+j+'button').setProperty('class','tabselected');$('tab'+j+'current').set('styles',{'display':'block'});$('tab'+j+'currentbutton').setProperty('class','tabselected');build.currentSelectedTab=j;}
else
{$('tab'+j).set('styles',{'display':'none'});$('tab'+j+'button').setProperty('class','tabunselected');$('tab'+j+'current').set('styles',{'display':'none'});$('tab'+j+'currentbutton').setProperty('class','tabunselected');}}
$('taballbutton').setProperty('class','taballunselected');$('taball').setProperty('style','display:none');});}};Builder.prototype.AddSkillsToTabs=function()
{$each(this.skillsJs.Skills,function(skill,num){var tempSkill=new Skill(skill,this.skillsPvpJs.Skills[num]);this.skillList.set(skill.id,tempSkill);},this);};Builder.prototype.SkillHasMetPrereqs=function(skillId)
{var tempSkill=this.skillList.get(skillId);for(i=0;i<tempSkill.skill.prereq.length;i+=2)
{if(this.skillList.get(tempSkill.skill.prereq[i]).currentRank<tempSkill.skill.prereq[i+1])
return false;}
return true;};Builder.prototype.AddActiveSkill=function(skillId,ignoreSp,ignorePrereq)
{var tempSkill=this.skillList.get(skillId);if(ignoreSp===undefined)
ignoreSp=false;if(ignorePrereq===undefined)
ignorePrereq=false;if(tempSkill===undefined)
return false;if(tempSkill.GetSP(tempSkill.currentRank)+this.pointsSpent>this.GetSPCap(this.levelCap))
return false;if(tempSkill.GetLevelReq(tempSkill.currentRank)>this.levelCap)
return false;if((tempSkill.skill.awaken!==undefined)&&(this.hasAwakened===0))
return false;if(tempSkill.skill.prereq!==0)
{if(!this.SkillHasMetPrereqs(skillId)&&(ignoreSp===false)&&(ignorePrereq===false))
return false;}
if(tempSkill.currentRank===0)
{if(!ignoreSp)
this.pointsSpent+=tempSkill.GetSP(tempSkill.currentRank);tempSkill.currentRank++;tempSkill.injectRightElement();}
else
{if(tempSkill.currentRank<tempSkill.skill.maxRank)
{this.pointsSpent+=tempSkill.GetSP(tempSkill.currentRank);tempSkill.currentRank++;}
else
return false;}
if((tempSkill.currentRank==tempSkill.skill.maxRank)||(tempSkill.GetLevelReq(tempSkill.currentRank))>60)
tempSkill.disposeElement();return true;}
Builder.prototype.RemoveActiveSkill=function(skillId)
{var foundPrereq=false,tempSkill=this.skillList.get(skillId);if(tempSkill===undefined)
return false;$each(this.skillList,function(skill,num){for(var i=0;i<skill.skill.prereq.length;i+=2)
{if((skill.skill.prereq[i]==skillId)&&(skill.skill.prereq[i+1]==tempSkill.currentRank)&&(skill.currentRank>0))
foundPrereq=true;}},this);if(foundPrereq)
return false;if(tempSkill.currentRank==1)
{if(this.IsGranted(skillId)||this.IsAwakeningGranted(skillId))
return false;this.pointsSpent-=tempSkill.GetSP(tempSkill.currentRank);tempSkill.currentRank--;tempSkill.disposeRightElement();tempSkill.injectElement();}
else if(tempSkill.currentRank>1)
{this.pointsSpent-=tempSkill.GetSP(tempSkill.currentRank);tempSkill.currentRank--}
else
return false;if(tempSkill.currentRank<tempSkill.skill.maxRank)
tempSkill.injectElement();return true;}
Builder.prototype.Awaken=function()
{if((this.hasAwakened===0)&&(this.skillsJs.AwakeningName!='none'))
{document.getElementById('levelcap').remove(0);var classList=document.getElementById('classList');var awakenClass=new Element('option',{'html':this.skillsJs.AwakeningName,'value':this.className});awakenClass.inject($('classList'),'top');classList.selectedIndex=0;this.hasAwakened=1;this.AddAwakenedSkills();this.UpdateAllSkillDisplay();this.UpdateHash();}}
Builder.prototype.RemoveSkill=function(skillId)
{while(this.RemoveActiveSkill(skillId))
{}}
Builder.prototype.MaxSkill=function(skillId)
{while(this.AddActiveSkill(skillId))
{}}
Builder.prototype.UpdateAllSkillDisplay=function()
{var spRemaining=this.GetSPCap(this.levelCap)-this.pointsSpent;$each(this.skillList,function(skill,num){skill.UpdateSkillDisplay();},this);$('currentsp').setProperty('html',spRemaining);$('totalsp').setProperty('html',this.GetSPForLevel(this.levelCap)+' + '+this.GetBookSPForLevel(this.levelCap)+'(unconfirmed)');if((this.hasAwakened===0)&&(this.skillsJs.AwakeningName!='none'))
{if(this.levelCap<51)
$('awakenbutton').set('styles',{'display':'none'});else
$('awakenbutton').set('styles',{'display':'inline'});}
else
$('awakenbutton').set('styles',{'display':'none'});var levelCapList=document.getElementById('levelcap');for(var i=0;i<levelCapList.length;i++)
{if(levelCapList.options[i].value==this.levelCap)
levelCapList.selectedIndex=i;if(this.GetSPCap(levelCapList.options[i].value)<this.pointsSpent)
document.getElementById('levelcap').remove(i);}
if((this.GetSPCap(50)>this.pointsSpent)&&(levelCapList.options[0].value!=50)&&(this.hasAwakened===0))
{var lvl50=new Element('option',{'html':'50','value':'50'});lvl50.inject($('levelcap'),'top');}}
Builder.prototype.EncodeSkillRank=function(rank,reverse)
{var letters="abcdefghijklmnopqrsut";if(!reverse)
return letters.charAt(rank);else
return letters.indexOf(rank);}
Builder.prototype.EncodeSkillId=function(id,reverse)
{var letters="ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678-=_[].=+";if(!reverse)
return letters.charAt(id);else
return letters.indexOf(id);}
Builder.prototype.ReduceSkillId=function(id,reverse)
{var tempId=id;if(reverse===undefined)
tempId=Math.floor(id/25);var letters="uvwxyz09";if(!reverse)
return letters.charAt(tempId);else
return letters.indexOf(tempId);}
Builder.prototype.UpdateHash=function()
{var hash='#'+this.hasAwakened+this.levelCap+':';$each(this.skillList,function(skill,num){if(skill.currentRank>0)
{if(this.IsGranted(skill.skill.id)||this.IsAwakeningGranted(skill.skill.id))
{if(skill.currentRank>1)
{var tempId=skill.skill.id%25;hash=hash+this.ReduceSkillId(skill.skill.id)+this.EncodeSkillId(tempId)+this.EncodeSkillRank(skill.currentRank-1);}}
else
{var tempId=skill.skill.id%25;hash=hash+this.ReduceSkillId(skill.skill.id)+this.EncodeSkillId(tempId)+this.EncodeSkillRank(skill.currentRank);}}},this);location.hash=hash;}
Builder.prototype.IsGranted=function(id)
{for(var i=0;i<this.skillsJs.Granted.length;i++)
{if(id==this.skillsJs.Granted[i])
return true;}
return false;}
Builder.prototype.IsAwakeningGranted=function(id)
{for(var i=0;i<this.skillsJs.AwakeningGranted.length;i++)
{if(id==this.skillsJs.AwakeningGranted[i])
return true;}
return false;}
Builder.prototype.LoadHash=function()
{var hash=location.hash;var split=hash.split(":");var colonIndex=hash.indexOf(':');if(colonIndex<0)
{location.hash='';return;}
var level=hash.substr(2,colonIndex-2);this.levelCap=level;if(this.levelCap==40)
this.levelCap=50;var levelList=document.getElementById('levelcap');var foundLevel=0;for(var i=0;i<levelList.length;i++)
{if(levelList.options[i].value==this.levelCap)
{levelList.selectedIndex=i;foundLevel=1;}}
if(foundLevel===0)
{location.hash='';return;}
if(hash.charAt(1)==1)
this.Awaken();var encode=split[1];var tempId=0;for(var j=0;j<encode.length;j++)
{var item=encode.charAt(j);if(this.ReduceSkillId(item,true)>=0)
tempId=this.ReduceSkillId(item,true)*25;else if(this.EncodeSkillId(item,true)>=0)
tempId+=this.EncodeSkillId(item,true);else
{var tempRank=this.EncodeSkillRank(item,true);for(i=0;i<tempRank;i++)
this.AddActiveSkill(tempId,false,true);tempId=0;}}
this.UpdateHash();this.UpdateAllSkillDisplay();}
Builder.prototype.LevelCapChange=function()
{var select=document.getElementById('levelcap');var newCap=select.options[select.selectedIndex].value;if(this.GetSPCap(newCap)<this.pointsSpent)
{for(var i=0;i<select.length;i++)
{if(select.options[i].value==build.levelCap)
select.selectedIndex=i;}
return;}
build.levelCap=select.options[select.selectedIndex].value;build.UpdateAllSkillDisplay();build.UpdateHash();}
Builder.prototype.HideHighLevels=function()
{var checkBox=document.getElementById('hidehigh');this.optionHideHighLevels=checkBox.checked;if(this.optionHideHighLevels==true)
{}
else
{}}
Builder.prototype.TogglePvpInfo=function()
{var checkBox=document.getElementById('pvpinfo');this.optionPvpInfo=checkBox.checked;this.UpdateAllSkillDisplay();}
function Skill(skill,skillPvp)
{this.currentRank=0;this.skill=skill;this.skillPvp=skillPvp;this.element=new Element('div',{'class':'skillareaitem','id':skill.id});this.element.inject($('tab'+skill.category),'bottom');if((this.skill.awaken!==undefined)&&build.hasAwakened==0)
this.element.set('styles',{'display':'none'});this.rightElement=new Element('div',{'class':this.GetIconClass()+' currentskillpadding currentskillskill','id':skill.id,'styles':{'background-position':'-'+this.GetIconOffset()+'px 0px','display':'none'}});this.rightElement.inject($('tab'+skill.category+'current'));this.rightAllElement=new Element('div',{'class':this.GetIconClass()+' currentskillpadding currentskillskill','id':skill.id,'styles':{'background-position':'-'+this.GetIconOffset()+'px 0px','display':'none'}});this.rightAllElement.inject($('alltabsub'+skill.category));}
Skill.prototype.injectElement=function()
{this.element.set('styles',{'display':'block'});}
Skill.prototype.disposeElement=function()
{this.element.set('styles',{'display':'none'});}
Skill.prototype.injectRightElement=function()
{this.rightElement.set('styles',{'background-position':'-'+this.GetIconOffset()+'px 0px','display':'inline-block'});this.rightAllElement.set('styles',{'background-position':'-'+this.GetIconOffset()+'px 0px','display':'inline-block'});}
Skill.prototype.disposeRightElement=function()
{this.rightElement.set('styles',{'display':'none'});this.rightAllElement.set('styles',{'display':'none'});}
Skill.prototype.GetIconOffset=function()
{var iconNum=this.skill.icon.substring(1);return 28*iconNum;}
Skill.prototype.GetIconClass=function()
{var out='';if(this.skill.icon.charAt(0)=="c")
out='commonskillicons';else if(this.skill.icon.charAt(0)=="f")
out='fighterskillicons';else if(this.skill.icon.charAt(0)=="g")
out='gunnerskillicons';else if(this.skill.icon.charAt(0)=="m")
out='mageskillicons';else if(this.skill.icon.charAt(0)=="p")
out='priestskillicons';else if(this.skill.icon.charAt(0)=="s")
out='swordmanskillicons';return out;}
Skill.prototype.GetIcon=function()
{var iconNum=this.skill.icon.substring(1);var out='<span class="'+this.GetIconClass();out=out+'" style="background-position: -'+this.GetIconOffset()+'px 0px;"><span class="lvicons" style="background-position: -'+this.currentRank*28+'px 0px;"></span></span>';return out;}
Skill.prototype.UpdateSkillDisplay=function()
{if(this.currentRank>0)
{this.rightElement.setProperty('html','<span class="lvicons" style="background-position: -'+(this.currentRank-1)*28+'px 0px;"></span>');this.rightElement.store('tip:title',this.skill.name+' &nbsp;&nbsp;Lv '+this.currentRank);this.rightElement.store('tip:text',this.BuildTooltip(this.currentRank)+'<br /><br /><b>Hold shift to remove</b>');this.rightAllElement.setProperty('html','<span class="lvicons" style="background-position: -'+(this.currentRank-1)*28+'px 0px;"></span>');this.rightAllElement.store('tip:title',this.skill.name+' &nbsp;&nbsp;Lv '+this.currentRank);this.rightAllElement.store('tip:text',this.BuildTooltip(this.currentRank)+'<br /><br /><b>Hold shift to remove</b>');}
var nextRank=this.currentRank;nextRank++;if((nextRank<=0)||(nextRank>=21))
return;var displayOut=this.GetIcon()+'<div class="skillareatitle">'+this.skill.name+'</div><div class="skillareaother">SP: ';displayOut=displayOut+this.GetSP(this.currentRank);displayOut=displayOut+' &nbsp;&nbsp;&nbsp;<span';if(this.GetLevelReq(this.currentRank)>build.levelCap)
displayOut=displayOut+' style="color:red; font-weight: bold;"';displayOut=displayOut+'>Level Required: '+this.GetLevelReq(this.currentRank)+'</span>';if(this.skill.prereq!=0)
{var metPrereq=true;for(i=0;i<this.skill.prereq.length;i+=2)
{if(build.skillList.get(this.skill.prereq[i]).currentRank<this.skill.prereq[i+1])
{metPrereq=false;break;}}
if(metPrereq==false)
displayOut=displayOut+'<span style="position:relative; font-weight:bold; top:-0px; left:75px; width:180px; color:red;">Prereq not met</span>';}
displayOut=displayOut+'</div>';this.element.setProperty('html',displayOut);this.element.store('tip:title',this.skill.name+' Lv '+nextRank);this.element.store('tip:text',this.BuildTooltip(nextRank)+'<br /><br /><b>Hold shift to max</b>');}
Skill.prototype.BuildTooltip=function(rankNum)
{rankNum--;var out='';if(this.GetLevelReq(rankNum)>0)
out=out+'Lvl '+this.GetLevelReq(rankNum)+'<br />';if(this.skill.prereq!=0)
{out=out+'<br />';for(i=0;i<this.skill.prereq.length;i+=2)
{out=out+'<span style="';if(build.skillList.get(this.skill.prereq[i]).currentRank<this.skill.prereq[i+1])
{out=out+'color:red;'}
out=out+'">Requires: '+build.skillList.get(this.skill.prereq[i]).skill.name+'(Lv '+this.skill.prereq[i+1]+')</span><br />';}
out=out+'<br />';}
out=out+this.GetCastTime(rankNum);if(!(this.skill.castTime<0))
{out=out+'<span class="tip-right">MP '+this.GetMpCost(rankNum)+'</span><br />Downtime: '+this.GetCooldown(rankNum)+'sec <br />';}
out=out+'<br />';var effectNum=0;var effectDesc=this.skill.effects.desc;if(this.skill.effects.desc!=undefined)
{while(this.skill.effects.desc.match('\\$'+effectNum))
{var effectValue;if(build.optionPvpInfo==false)
{effectValue=this.skill.effects.values[effectNum][rankNum];if(effectValue===undefined)
effectValue=this.skill.effects.values[effectNum][0];}
else
{effectValue=this.skillPvp.effects.values[effectNum][rankNum];if(effectValue===undefined)
effectValue=this.skillPvp.effects.values[effectNum][0];}
effectDesc=effectDesc.replace('$'+effectNum,effectValue);effectNum++;}
out=out+effectDesc;}
out=out+'<br /><br />'+this.skill.desc;return out;}
Skill.prototype.GetCastTime=function(rank)
{if(this.skill.castTime<0)
return'Passive<br />';else
{var compMax=this.skill.maxLevel-1,castTime=-1;if(build.optionPvpInfo==false)
castTime=new Number((this.skill.castTime[0]+rank*((this.skill.castTime[1]-this.skill.castTime[0])/compMax))/1000);else
castTime=new Number((this.skillPvp.castTime[0]+rank*((this.skillPvp.castTime[1]-this.skillPvp.castTime[0])/compMax))/1000);if(castTime==0)
return'Instant Cast';else
return'Casting Time: '+castTime.toPrecision(3)+'sec';}}
Skill.prototype.GetCooldown=function(rank)
{var cooldown=-1,compMax=this.skill.maxLevel-1;if(build.optionPvpInfo==false)
{if(this.skill.cooldown.length==2)
cooldown=new Number((this.skill.cooldown[0]+rank*((this.skill.cooldown[1]-this.skill.cooldown[0])/compMax))/1000);else
cooldown=this.skill.cooldown[0];return cooldown.toPrecision(3);}
else
{if(this.skillPvp.cooldown.length==2)
cooldown=new Number((this.skillPvp.cooldown[0]+rank*((this.skillPvp.cooldown[1]-this.skillPvp.cooldown[0])/compMax))/1000);else
cooldown=this.skillPvp.cooldown[0];return cooldown.toPrecision(3);}}
Skill.prototype.GetLevelReq=function(rank)
{if(this.skill.levelReqs.length==2)
return this.skill.levelReqs[0]+rank*this.skill.levelReqs[1];else
return this.skill.levelReqs[rank];}
Skill.prototype.GetMpCost=function(rank)
{var mpCost=-1,compMax=this.skill.maxLevel-1;if(build.optionPvpInfo==false)
{if(this.skill.mpCost.length==2)
mpCost=new Number(this.skill.mpCost[0]+rank*((this.skill.mpCost[1]-this.skill.mpCost[0])/compMax));else
mpCost=this.skill.mpCost[0];return Math.round(mpCost.toPrecision(5));}
else
{if(this.skillPvp.mpCost.length==2)
mpCost=new Number(this.skillPvp.mpCost[0]+rank*((this.skillPvp.mpCost[1]-this.skillPvp.mpCost[0])/compMax));else
mpCost=new Number(this.skillPvp.mpCost[0]);return Math.round(mpCost.toPrecision(5));}}
Skill.prototype.GetSP=function(rank)
{if(this.skill.spCost[rank])
return this.skill.spCost[rank];else
return this.skill.spCost[0];}
window.addEvent('domready',function(){build=new Builder(currentClass);build.Init();$$('.skillareaitem').addEvent('mousedown',function(e)
{e.preventDefault();this.oncontextmenu=function(){return false;}
switch(e.rightClick)
{case false:if(e.shift)
build.MaxSkill($(this).getProperty('id'));else
build.AddActiveSkill($(this).getProperty('id'));break;case true:if(e.shift)
build.RemoveSkill($(this).getProperty('id'));else
build.RemoveActiveSkill($(this).getProperty('id'));break;}
build.UpdateHash();build.UpdateAllSkillDisplay();leftTips.fill(leftTips['titleElement'],$(this).retrieve('tip:title'));leftTips.fill(leftTips['textElement'],$(this).retrieve('tip:text'));});$$('.currentskillskill').addEvent('mousedown',function(e)
{e.preventDefault();this.oncontextmenu=function(){return false;}
if(e.shift)
build.RemoveSkill($(this).getProperty('id'));else
build.RemoveActiveSkill($(this).getProperty('id'));build.UpdateHash();build.UpdateAllSkillDisplay();rightTips.fill(rightTips['titleElement'],$(this).retrieve('tip:title'));rightTips.fill(rightTips['textElement'],$(this).retrieve('tip:text'));});$('resetbuild').addEvent('mousedown',function(e)
{e.preventDefault();this.oncontextmenu=function(){return false;}
if(build.hasAwakened==1)
{var lvl50=new Element('option',{'html':'50','value':'50'});lvl50.inject($('levelcap'),'top');build.hasAwakened=0;var classList=document.getElementById('classList');classList.remove(0);for(var i=0;i<classList.length;i++)
{if(classList.options[i].value==currentClass)
classList.selectedIndex=i;}}
build.levelCap=50;$('awakenbutton').setProperty('styles',{'display':'inline'});$each(build.skillList,function(skill,i){if(skill.skill.awaken!==undefined)
skill.disposeElement();else
skill.injectElement();skill.currentRank=0;skill.disposeRightElement();});build.pointsSpent=0;build.AddGrantedSkills();build.UpdateAllSkillDisplay();build.UpdateHash();});$('awakenbutton').addEvent('mousedown',function(e)
{e.preventDefault();this.oncontextmenu=function(){return false;}
build.Awaken();});$('totalsp').store('tip:title','Level SP + Book SP');$('totalsp').store('tip:text','This is your total amount of SP available. The number on the left indicates the amount you get from leveling up to the level cap. The number on the right is the total amount of SP recieved from Skill Book quest rewards.<br /><br /><font color="red">The Book SP is currently an unconfirmed number, based off of what is available in kDNF.</font>');$('currentsp').store('tip:title','SP Remaining');$('currentsp').store('tip:text','This is your Total SP minus the amount used by skills. This indicates the amount of SP you have remaining and available to you.');leftTips=new Tips('.skillareaitem',{className:'tooltip'});rightTips=new Tips('.currentskillskill',{className:'tooltip'});var spTips=new Tips('.totalsp',{className:'tooltip'});var classList=document.getElementById('classList');for(var i=0;i<classList.length;i++)
{if(classList.options[i].value==currentClass)
classList.selectedIndex=i;}
if(location.hash)
build.LoadHash();build.TogglePvpInfo();build.UpdateAllSkillDisplay();});