function explode(inputstring, separators, includeEmpties) {
	var elem;
	inputstring = new String(inputstring);
	separators = new String(separators);
		
	if(separators == "undefined") { 
		separators = " :;";
	}
		
	fixedExplode = new Array();
	currentElement = "";
	count = 0;
		
	for(x=0; x < inputstring.length; x++) {
		elem = inputstring.charAt(x);
		if(separators.indexOf(elem) != -1) {
			if ( ( (includeEmpties <= 0) || (includeEmpties == false)) && (currentElement == "")) { }
			else {
				fixedExplode[count] = currentElement;
				count++;
				currentElement = "";
			}
		}
		else { currentElement += elem; }
	}
		
	if (( ! (includeEmpties <= 0) && (includeEmpties != false)) || (currentElement != "")) {
		fixedExplode[count] = currentElement;
	}
	return fixedExplode;
}

function implode(separators, inputarray) {
	outputstring = new String();

	for (i = 0 ; i < inputarray.length ; i++) {
		outputstring += inputarray[i] + separators;
	}
	return outputstring.substring(0, outputstring.length-1);
}

function addtoarray(valuetoadd, arraysrc, doublon) {
	var i; var arraydest = new Array();
	
	arraydest = arraysrc;
	if (doublon == false) {
		for (i = 0 ; i < arraydest.length ; i++) {
			if (valuetoadd == arraydest[i]) break;
		}
		if (valuetoadd != arraydest[i]) arraydest[i] = valuetoadd;
	} else arraydest[j] = valuetoadd;
	return(arraydest);
}

function removefromarray(valuetoremove, arraysrc) {
	var k = 0; var i; var arraydest = new Array();
	
	for (i = 0 ; i < arraysrc.length ; i++) {
		if (valuetoremove != arraysrc[i]) { arraydest[k] = arraysrc[i]; k++; }
	}
	
	return(arraydest);
}