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 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();
	}
	
	return false;
}

var hpo_toolbox_countchange = 0;
var hpo_toolbox_items_nr = 0;
var hpo_toolbox_items = new Array();
function hpo_toolbox_incdecsize(val) {
    
	if ( (hpo_toolbox_countchange <= -4 && val < 0) || 
		 (hpo_toolbox_countchange >= 4 && val > 0) )
		return false;
		
	hpo_toolbox_countchange += val;
		
    var container = $$('#CONTENT');
    hpo_toolbox_resizeText(container, val);
    
    hpo_toolbox_items.each(function (item, key)
    {
    	if ( item[1] > 0 )
    		item[0].setStyle('fontSize', item[1] +'px');
    		
    	hpo_toolbox_items[key] = null;
    });
    hpo_toolbox_items_nr = 0;
}

function hpo_toolbox_resizeText(element, moveSize)
{
    element = $$(element);
    elementList = element.getChildren();
    if ( elementList.length > 0 )
    {
        elementList.each(function(item) 
        {
            item.each(function(el) 
            {
                size = el.getStyle('fontSize').toInt();
                newSize = eval(size + moveSize);
        
        		hpo_toolbox_items[hpo_toolbox_items_nr] = new Array();
        		hpo_toolbox_items[hpo_toolbox_items_nr][0] = el;
        		hpo_toolbox_items[hpo_toolbox_items_nr][1] = newSize;
        		++ hpo_toolbox_items_nr;
        		
                hpo_toolbox_resizeText(el, moveSize);
            });
        });
    }
}