String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/, '');
};

function HTML_AJAX_LOADING_afficher() {
        var element = document.getElementById('HTML_AJAX_LOADING') ;
        if ( element ) element.style.display = 'block';

}
function HTML_AJAX_LOADING_masquer() {
        var element = document.getElementById('HTML_AJAX_LOADING') ;
        if ( element ) element.style.display = 'none';
}


function isString(o) { 
	return (typeof(o)=="string");
}

function isFunction(a) {
	return typeof a == 'function';
}

function isObject(a) {
	return (a && typeof a == 'object') || isFunction(a);
}

function isArray(a) {
	return isObject(a) && a.constructor == Array;
}




function is_IE6() {

var strChUserAgent = navigator.userAgent;
var intSplitStart = strChUserAgent.indexOf("(",0);
var intSplitEnd = strChUserAgent.indexOf(")",0);
var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

	return (strChMid.indexOf("MSIE 6") != -1);
}

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter() {
	if (document.getElementById) {
//		var windowHeight = getWindowHeight();
//		if (windowHeight > 0) {
			var footerElement = document.getElementById('block_footer');
			var footerHeight  = footerElement.offsetHeight;
			var contentHeight = 160 + document.getElementById('block_center').offsetHeight;
			footerElement.style.top = ( contentHeight + 50 ) + 'px';
/*			if ( windowHeight < ( contentHeight + footerHeight ) ) {
				footerElement.style.top = ( contentHeight + footerHeight ) + 'px';
			} else {
				footerElement.style.top = ( windowHeight - footerHeight ) + 'px';
			}
		}
*/	}
}

/**
 * enables highlight and marking of rows in data tables
 *
 */
function PMA_markRowsInit() {

	// only for IE6, other browsers are handled by :hover in css
    if ( ! is_IE6() ) return true ;
    
    // for every table row ...
    var rows = document.getElementsByTagName('tr');
    for ( var i = 0; i < rows.length; i++ ) {
        // ... with the class 'odd' or 'tableau1' ...
        if ( 'tableau0' != rows[i].className.substr(0,8) && 'tableau1' != rows[i].className.substr(0,8) ) {
            continue;
        }
        // ... add tableau1t listeners ...
        // ... to highlight the row on mouseover ...
        rows[i].onmouseover = function() {
            this.className += ' tableau';
        }
        rows[i].onmouseout = function() {
            this.className = this.className.replace( ' tableau', '' );
        }
    }
}

/**
 * Disable highlight
 *
 */
function DisableStyle() {

    var rows = document.getElementsByTagName('tr');
    
    for ( var i = 0; i < rows.length; i++ ) {
        if ( 'tableau0' != rows[i].className.substr(0,8) && 'tableau1' != rows[i].className.substr(0,8) ) {
            continue;
        }
        rows[i].style.background = '';
    }
}

