/*
 * funckce pro orez retezcu
 */
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,'');
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,'');
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,'');
}
String.prototype.replaceAll = function(strTarget, strSubString) {
//  strTarget, // The substring you want to replace
//  strSubString // The string you want to replace in.
	var strText = this;
	var intIndexOfMatch = strText.indexOf(strTarget);

	// Keep looping while an instance of the target string
	// still exists in the string.
	while(intIndexOfMatch != -1) {
		// Relace out the current instance.
		strText = strText.replace(strTarget, strSubString);

		// Get the index of any next matching substring.
		intIndexOfMatch = strText.indexOf(strTarget);
	}

	// Return the updated string with ALL the target strings
	// replaced out with the new substring.
	return(strText);
}

function strtr(str, table_or_from, to){   
	if((typeof(table_or_from) == 'object') && (table_or_from.length)){
		for(i in table_or_from) {
			str = str.replaceAll(table_or_from[i][0], table_or_from[i][1]);
		}
		return str;
	} else {
		for(i = 0; i < table_or_from.length; i++) {
			str = str.replaceAll(table_or_from.substr(i,1), to.substr(i,1));
		}
		return str;
	}
}
/*
//tablica = [['á','a'],['e','e'],['š','s'],['c','c'],['r','r'],['ž','z'],['ý','y'],['á','a'],['í','i'],['é','e']];
//tablica = [[".","-"],["?","-"],["!","-"],[";","-"],["\"","-"],["'","-"],["\\","-"],["/","-"],["_","-"]];

txt=".?!A.?! běží 49°43'27.54\"";
//efekt3 = strtr(txt, tablica);
efekt3 = strtr(txt, "°'\"ěží", "dmsezi");
document.write(efekt3);
*/
