String.prototype.trim = function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");}
String.prototype.capitalize = function(){
    return this.substring(0,1).toUpperCase() + this.substring(1,this.length);
}
String.prototype.flatten = function(){ return this.replace(/\r\n/ig, ""); }
String.prototype.replaceSpaces = function(){ return this.replace(/\s/ig, ""); }
            
            
function CMS_SetLangURL(anchor)
{
	var lswitch = "";

	if(typeof(CMS_TransUrl)!="undefined" && CMS_TransUrl!="") lswitch = CMS_TransUrl;
	else if (typeof(CMS_TransUrlDefault)!="undefined" && CMS_TransUrlDefault!="") lswitch = CMS_TransUrlDefault;

	if(lswitch != "") {
		lswitch = (lswitch.indexOf("//")==-1 ? "//" : "") + lswitch;
		anchor.href = lswitch + document.location.search;
	}	
}

