/*Copyright Bridgeline Software, Inc. An unpublished work created in 2009. All rights reserved. 
This software contains the confidential and trade secret information of Bridgeline Software, Inc. 
("Bridgeline").  Copying, distribution or disclosure without Bridgeline's express written permission is prohibited.*/


function controlCenter (btnId, evt) 
{   
    btn = document.getElementById(btnId);
    if (btn)
    {
        if (evt.keyCode == 13)
        {
            evt.returnValue = false;
            evt.cancel = true;
            btn.click();
            return false;
        } 
    } 
}

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}