Inconsistent variable output
<p>A few days ago I made a lord generator for a game called Broken History I play with my mates, I started the code myself but ended up getting help with the code to finish it. </p>

<p>I then set about making a char gen for the same game, using the exact same methods that worked before, everything was looking good every element did what it was supposed to. However, when I got the resulting text the first time the variable curFaction was called it read <code>undefined</code> the second time it read the faction the user chose in the select box i.e. <code>Saxathia</code>. The variable is assigned in the <code>$(document).ready()</code> function so in theory is should be assigned before it is called right?</p>

<p>I can't think why this happens, the variable is called as part of an array does that make any difference?</p>

<p><img src="http://i.stack.imgur.com/ecMLn.jpg" alt="enter image description here"></p>

<p>Here is the jsLint <a href="http://jsfiddle.net/CYe8J/31/" rel="nofollow">http://jsfiddle.net/CYe8J/31/</a></p>
