check if /en/ or /es/ in document.location
<p>i need to get the language that the user is using based on the document.location</p>

<p>urls are of the type:</p>

<pre><code>domain.com/en/blabla.html
domain.com/es/blabla.html
domain.com/it/blabla.html
</code></pre>

<p>so i was trying like this:</p>

<pre><code>function getLan(){
   var idioma = document.location;
   var idiomaTmp = idioma.split("/");
   return = idiomaTmp[1];
}
</code></pre>

<p>but (i don't understand but) i get this error at firebug</p>

<pre><code>idioma.split is not a function
[Detener en este error] var idiomaTmp = idioma.split("/"); 
</code></pre>

<p>any idea why? or maybe a better solution?</p>
