function $(o) {
    return document.getElementById(o)
}
function $$(o) {
	return document.getElementById(o)
}
function gup(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null) return "";
    else return results[1];
}
/**
 * Toggle display of some obj or ID obj
 */
function toggleDisplay(obj) {
    obj = (typeof obj == 'string') ? document.getElementById(obj) : obj;
    obj.style.display = obj.style.display == 'none' || !obj.style.display ? 'block' : 'none';
}
function checkKey(e, code) {
	if (e && e.which) {
		e = e
		characterCode = e.which
	} else {
		e = event
		characterCode = e.keyCode
	}
	if (characterCode == code)
		return true
	else
		return false
}
function checkKey(e, keycode) {
	if (e && e.which) {
		e = e
		characterCode = e.which
	} else {
		e = event
		characterCode = e.keyCode
	}
	return characterCode == keycode
}