function explode(inputstring, separators, includeEmpties) {
inputstring = new String(inputstring);
separators = new String(separators);

if(separators == "undefined") {
separators = " :;";
}

fixedExplode = new Array(1);
currentElement = "";
count = 0;

for(x=0; x < inputstring.length; x++) {
char = inputstring.charAt(x);
if(separators.indexOf(char) != -1) {
if ( ( (includeEmpties <= 0) || (includeEmpties == false)) && (currentElement == "")) { }
else {
fixedExplode[count] = currentElement;
count++;
currentElement = ""; } }
else { currentElement += char; }
}

if (( ! (includeEmpties <= 0) && (includeEmpties != false)) || (currentElement != "")) {
fixedExplode[count] = currentElement; }
return fixedExplode;
}

function change(lang){

	var getParams = location.search.substring(1);
	if (getParams == '')
		getParams = 'magic=0.0.0.0.' + lang;

	var _stack = explode(getParams, ".");

	cntVars = _stack.length;
	if (cntVars < 5) {
		if (cntVars == 4) {
		   	_stack[cntVars] = lang;
		}else{
			while(cntVars < 4) {
			   	_stack[cntVars] = 0;
                cntVars = _stack.length;
			}
   		   	_stack[cntVars] = lang;
		}
	}
    if (_stack[1] == 11){
    	_stack[1] = 61;
        }
    if (_stack[1] == 1){
    	_stack[1] = 2;
        }
     if (_stack[1] == 13){
    	_stack[1] = 7;
        }
     if (_stack[1] == 63){
    	_stack[1] = 35;
        }
     if (_stack[1] == 65){
    	_stack[1] = 37;
        }
     if (_stack[1] == 64){
    	_stack[1] = 46;
        }
     if (_stack[1] == 66){
    	_stack[1] = 38;
        }
     if (_stack[1] != 56){
    	_stack[2] = 0;
    	_stack[3] = 0;
    	}
    _stack[4] = lang;
	newParams = _stack.join('.');//  alert(newParams);
	document.location = "index.php?" + newParams;

}