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) >= 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;
}
var win = null;
function hpo_toolbox_imprime(url){
	
	//var url = window.location ;

	//url += '&print=1';
	//alert(url);
	var win = open( url, 'plateform_preview','width=700,height=700,scrollbars=yes,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;
}

var hpo_toolbox_countchange = 0;
function hpo_toolbox_incdecsize(val) {
    
    if ( (hpo_toolbox_countchange <= -4 && val < 0) || 
         (hpo_toolbox_countchange >= 4 && val > 0) )
        return false;
        
    hpo_toolbox_countchange += val;
        
    hpo_toolbox_resizeText($("#RTE_CONTENT").find("H1,H2,H3,H4,H5,H6,P"), val);    
    hpo_toolbox_resizeText($("#RTE_CONTENT .sommaire").find("A"), val);
}

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);
        if (size<1)
            size = 1;
        new_size = eval(size + moveSize) +'px';
        $(this).css("font-size", new_size);
    });
}
