
moverFunc = function() {
	this.style.cursor = 'pointer';
};
moutFunc = function() {
	this.style.cursor = 'default';
};
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); }; 
stripMarkup = function( src ) { return src.toString().replace( /(<([^>]+)>)/gi, '' ); };
hideElement = function() {
		this.style.display = 'none';
};
showElement = function() {
		this.style.display = '';
};
visible = function() {
	try {
		return( this.style.display == '' );
	} catch (e) {
		return false;
	}
};
addFunctions = function( elem ) {
	if ( elem == null ) return;
	elem.hideElement = hideElement;
	elem.showElement = showElement;
	elem.visible = visible;
};
dbPath = function() {
	var path = location.pathname.split( '/' );
	
	for ( var i = path.length; i > 0; --i ) {
		if ( path[i-1].toLowerCase().indexOf( '.nsf' ) != -1 ) return path.join( '/' );  
		path.pop();
	}			
	
	var ret = path.join( '/' ); 
	return ret != '' ? ret : '/gsonline/globalws.nsf';
};
queryParam = function( key ) {
	var search = location.search.split( '&' );
	
	for ( var i = 0 ; i < search.length; ++i ) {
		if ( search[i] != null ) {
			var kvpair = search[i].split( '=' );
			if ( kvpair.length == 2 ) {
				if ( kvpair[0].toLowerCase() == key.toLowerCase() ) return kvpair[1];
			}
		}
	}
	return '';
}
CommaFormatted = function(amount) {
	var delimiter = ","; // replace comma if desired
	var a = amount.split('.',2)
	var d = a[1];
	var i = parseInt(a[0]);
	if(isNaN(i)) { return ''; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	var n = new String(i);
	var a = [];
	while(n.length > 3)
	{
		var nn = n.substr(n.length-3);
		a.unshift(nn);
		n = n.substr(0,n.length-3);
	}
	if(n.length > 0) { a.unshift(n); }
	n = a.join(delimiter);
	if(d.length < 1) { amount = n; }
	else { amount = n + '.' + d; }
	amount = minus + amount;
	return amount;
}
doLogoout = function() {
	location.href = siteSettings.logoutTarget();
}
goFAQ = function() {
	location.href = dbPath() + '/0/9D8068A2EF235E24CC2574CB00121B68?openDocument';
};
goGenHelp = function() {
	location.href = dbPath() + '/0/02B3E62FB8557596CC2574CB0011DCAE?openDocument';
};
goBO = function() {
	location.href = dbPath() + '/0/886065D78D475243CC25749A000BEFD5?openDocument';
};
goLast30 = function() {};
goStatement = function() {};
goTT = function() {
location.href = dbPath() + '/0/2C505F6982C3367FCC2574CB00835C1E?openDocument';
};
enumerateProperties = function( src, sort ) {    
    var keys = [];
    if ( src != null ) {
	    for ( s in src ) {
	        keys.push( s );
	    }
	}
	
	if ( sort != null ) {
	    if ( sort && ( keys.length > 0 ) ) {
	        keys.sort();
	    }
	}
	
	return keys;
}
