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;
}

function hpo_toolbox_imprime(url){
	
	//var url = window.location ;

	//url += '&print=1';
	//alert(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.print();
	}
	
	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;
		
    var container = $$('#CONTENT');
    hpo_toolbox_resizeText(container, val);
}

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();
                
                el.setStyle('fontSize', eval(size + moveSize) +'px');
        
                hpo_toolbox_resizeText(el, moveSize);
            });
        });
    }
}

