2009-10-04 20:47:25 +00:00
|
|
|
// function GUP is taken from http://www.netlobo.com/url_query_string_javascript.html
|
|
|
|
// gup = get URL parameter
|
2009-10-03 05:54:40 +00:00
|
|
|
function gup( name )
|
|
|
|
{
|
2009-10-04 20:47:25 +00:00
|
|
|
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
|
|
|
var regexS = "[\\?&]"+name+"=([^&#]*)";
|
|
|
|
var regex = new RegExp( regexS );
|
|
|
|
var results = regex.exec( window.location.href );
|
|
|
|
if( results == null )
|
|
|
|
return "";
|
|
|
|
else
|
|
|
|
return results[1];
|
2009-10-03 05:54:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var put_locale = function(){
|
|
|
|
var lang_param = gup("lang");
|
2009-10-05 20:02:37 +00:00
|
|
|
if (lang_param == "")
|
2009-10-04 20:47:25 +00:00
|
|
|
return;
|
2009-10-03 05:54:40 +00:00
|
|
|
var url = "locale/lang." + lang_param + ".js";
|
2009-10-04 20:47:25 +00:00
|
|
|
$.get(url, function(data){
|
2009-10-03 05:54:40 +00:00
|
|
|
var LangData = eval(data);
|
|
|
|
for (var i=0;i<LangData.length;i++)
|
|
|
|
{
|
2009-10-04 20:47:25 +00:00
|
|
|
var elem = document.getElementById(LangData[i].id);
|
|
|
|
if(elem){
|
|
|
|
if(LangData[i].title)
|
|
|
|
elem.title = LangData[i].title;
|
|
|
|
if(LangData[i].textContent)
|
|
|
|
elem.textContent = LangData[i].textContent;
|
|
|
|
}
|
2009-10-03 05:54:40 +00:00
|
|
|
}
|
|
|
|
},"json");
|
2009-10-04 20:47:25 +00:00
|
|
|
};
|