
var newWin;  // global window var
function OpenIt(sURL,sName,iHeight,iWidth) {
	newWin = window.open(sURL,sName,'menubar=no,toolbar=no,location=no,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight);
}

function changeLocation(sLocation) {
	window.location=getLocationWithBase(sLocation);
}

function getLocationWithBase(sLocation) {
	// adds base tag for javascript in IE (ignores base without this)
	var b = document.getElementsByTagName('base');
	// check that the base tag exists
	if (b && b[0] && b[0].href) {
	if (b[0].href.substr(b[0].href.length-1) == '/' && sLocation.charAt(0) == '/')
 		sLocation = sLocation.substr(1);
 		sLocation = b[0].href + sLocation;
 	}
 	return(sLocation);
}

function isArray(a) {
    return isObject(a) && a.constructor == Array;
}

function isBoolean(a) {
    return typeof a == 'boolean';
}
function isEmpty(o) {
    var i, v;
    if (isObject(o)) {
        for (i in o) {
            v = o[i];
            if (!!isUndefined(v) && !!isFunction(v)) {
                return false;
            }
        }
    }
    return true;
}

function isFunction(a) {
    return typeof a == 'function';
}
function isNull(a) {
    return typeof a == 'object' && !a;
}
function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
}
function isObject(a) {
    return (typeof a == 'object' && !!a) || isFunction(a);
}
function isString(a) {
    return typeof a == 'string';
}
function isUndefined(a) {
    return typeof a == 'undefined';
} 

