function hpo_toolbox_checkBrowser(){
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver, 10) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
	return this;
}

var bw=new hpo_toolbox_checkBrowser();

function hpo_toolbox_gotoUrl(url) {
	document.tx_hpotool_form_lstpages.action = url;
	document.tx_hpotool_form_lstpages.submit();
	return false;
}

function hpo_toolbox_imprime(url){
	var win = open( url, 'plateform_preview','directories=no,location=no,menubar=no,status=no,toolbar=no');

	if (win) {
		if (!bw.ns5) {
			win.resizeTo(700, 600);
		}
		win.focus();
		win.setTimeout('print()', 5000);
	}

	return false;
}

function hpo_toolbox_resizeText(element, moveSize)
{
    $(element).each( function() {
        var size = $(this).css("font-size");
        
        // suppression du px
        var pos = size.indexOf('px');
        if (pos != -1) {
            size = size.substring(0, pos);
				}
        // inc/dec val
        size = parseInt(size, 10);
        if (size<1) {
            size = 1;}
        new_size = eval(size + moveSize) +'px';
        $(this).css("font-size", new_size);
    });
}

var hpo_toolbox_countchange = 0;
function hpo_toolbox_incdecsize(val) {
    
    if ( (hpo_toolbox_countchange <= -3 && val < 0) || 
         (hpo_toolbox_countchange >= 6 && val > 0) ) {
        return false;}
        
    hpo_toolbox_countchange += val;
        
    hpo_toolbox_resizeText($("#CONTENT").find("*"), val);
    // hpo_toolbox_resizeText($("#RTE_CONTENT").find("*"), val);
}


