
function toggleButton(btn) {
	window.sliding = window.sliding ? true : false;
	var fn, minWidth=72, maxWidth=443, idL='quotation_button_l', idR='quotation_button_r', idT='quotation_text';

	// Falls der Button bereits am öffnen oder schliessen ist: abbrechen
	if (window.sliding) return;
	
	window.sliding = true;
	
	if (document.getElementById(idL).style.display != 'block') {
		document.getElementById(idL).style.display = 'block';
		document.getElementById(idR).style.display = 'block';
		fn = "document.getElementById('"+idT+"').style.display='block';";
		fn+= "window.sliding=false;";
		slide(idR, 50, 100, 1, minWidth, maxWidth, fn);
	} else if (true) {
		document.getElementById(idT).style.display = 'none';
		fn = "document.getElementById('"+idL+"').style.display='none';";
		fn+= "document.getElementById('"+idR+"').style.display='none';";
		fn+= "window.sliding=false;";
		slide(idR, 50, 100, 0, minWidth, maxWidth, fn);
	}
}

function slide(elId, step, intervall, out, minWidth, maxWidth, fn){
	var el = document.getElementById(elId);
	var curVal = (el.offsetWidth) ? el.offsetWidth : (out ? minWidth : maxWidth);
	if (out&&curVal<maxWidth || !out&&curVal>minWidth) {
		if (out) {
			curVal+=step;
			if (curVal > maxWidth) curVal = maxWidth;
		} else {
			curVal-=step;
			if (curVal < minWidth) curVal = minWidth;
		}
		el.style.width = curVal+"px";

		window.setTimeout("slide('"+elId+"',"+step+","+intervall+","+out+","+minWidth+","+maxWidth+",\""+fn+"\")", intervall);
	} else {
		if (fn) eval(fn);
	}
}
