<!--

function openW(urlW, width_w, height_w, scroll_bar) {
	
	center_x = Math.round((window.screen.availWidth - width_w) / 2);
	center_y = Math.round((window.screen.availHeight - height_w) / 2);
	
	window.open(urlW,'_blank','top=' + center_y + ',left=' + center_x + ',width=' + width_w + ',height=' + height_w + ',status=no,titlebar=no,toolbar=no,menubar=no,location=no,resizable=no,directories=no,scrollbars=' + scroll_bar);
	
}

function openQuatro(urlW, width_w, height_w) {

	center_x = Math.round((window.screen.availWidth - width_w) / 2);
	center_y = Math.round((window.screen.availHeight - height_w) / 2);

	window.open(urlW,'_blank','top=' + center_y + ',left=' + center_x + ',width=' + width_w + ',height=' + height_w + ',status=yes,titlebar=no,toolbar=no,menubar=no,location=no,resizable=yes,directories=no,scrollbars=yes');

}

var browser = {
	dom:(document.getElementById != null),
	ie:(document.all && parseInt(navigator.appVersion) >= 4),
	ns:(document.layers && parseInt(navigator.appVersion) >= 4)
}

function getLayer(name) {
	if (browser.dom) return document.getElementById(name);
	else if (browser.ie) return document.all[name];
	else if (browser.ns) return document.layers[name];
}

_timer = null;
_active = null;

function menu_show(iarray, iname) {

    _active = iname;
    
	for (i = 0; i < iarray.length; i++) {
	
		_sub = getLayer("sub_" + iarray[i]);
		
		if (_sub != null) {
			if (iname == iarray[i]) _sub.style.display = "block";
				else _sub.style.display = "none";
		}
	
	}

	clearTimeout(_timer);
	
}

function menu_hide(iname) {

	_timer = setTimeout(_menu_hide, 1000);

}

function _menu_hide() {

	_msub = getLayer("sub_" + _active);
	_msub.style.display = "none";

}

function format_price(_price) {

	_price = parseFloat(_price);
	_price = Math.round(_price * 100) / 100;

	_return = _price + "";
	_counter = 0;
	
	_help = _return.split(".");
	if (_help.length < 2) _help[1] = "00";
	
	if (_return == "") {
		
		_return = "0";
		
	} else {
		
		_counter = 0;
		_formated = "";
		
		for ($i = _help[0].length; $i > 0; $i--) {
			
			if (_counter == 3) {
				_formated = " " + _formated;
				_counter = 0;
			}
			
			_formated = _return.substr($i - 1, 1) + _formated;
			_counter++;
			
		}

		if (_help[1].length < 2) _help[1] += "0";
		
		_return = _formated + "." + _help[1];
		
	}
	
	return _return;

}

function submit_form(_form, _action) {
	
	if (_form != "") {

		_form = eval("document." + _form);
		if (_action != "") _form.action.value = _action;
		_form.submit();
	
	}
	
	return false;

}

function show_office() {
    
    _delivery = getLayer("delivery");
    _office = getLayer("office-wrapper");
    
    if(_delivery.value == 1)
        _office.style.display = "block";
    else _office.style.display = "none";
    
}


//-->
