function isNumber(num){
    return !isNaN(num);
}
/**
* Trims all characters matching chr from the beginning and end of the string
*
* @param	str	 Type String - The string to trim
* @param    chr  Type char - The characters to remove - defaults to [space]
*/
function trim(str, chr){
    if(!chr){
        chr = " ";
    }
    if(!str.length || str == undefined){
        return "";
    }
    var tstr = str;
    var recurse = false;
    if(tstr.charAt(0) == chr.charAt(0)){
        recurse = true;
        tstr = tstr.substr(1);
    }
    if(tstr.charAt(tstr.length-1) == chr.charAt(0)){
        recurse = true;
        tstr = tstr.substr(0,tstr.length-1);
    }
    if(recurse){
        alert("recurst trim "+tstr)
        return trim(tstr, chr);
    }
    return tstr;
}

function openNewWindow(URLtoOpen, windowName, windowFeatures) {
  var newWindow=window.open(URLtoOpen, windowName, windowFeatures);
  return newWindow;
}

function focusOnElementID(elemID){
	var elem = document.getElementById(elemID);
	elem.focus();	
}