/*

  Author: Gabriele Maira (gambry) per Echidna SCARL (http://www.echidna.it)
  Thx to: Anti Avanti.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/
function scroll_box(id_parent,id_child,vers,h) {
				var mychild = document.getElementById(id_child);
				var myparent = document.getElementById(id_parent);
				var a = h;
				var y;

				if (window.getComputedStyle) {
					y = isNaN(parseInt(mychild.style.getPropertyValue('margin-top'))) ? 0 : parseInt(mychild.style.getPropertyValue('margin-top'));
				} else {
					y = isNaN(parseInt(mychild.currentStyle["marginTop"])) ? 0 : parseInt(mychild.currentStyle["marginTop"]);
				}
					
				var hmychild = parseInt(mychild.offsetHeight);
				var hmyparent = parseInt(myparent.offsetHeight);
				
				if (y < 0 && vers == 'up') {
					mychild.style.marginTop = mychild.style.styleMarginTop = ( y + a ) + 'px';
				}
				//if (y+a < parseInt(myparent.style.getPropertyValue('height')) && vers == 'down') {
				if (y > (hmyparent - hmychild) && vers == 'down') {
					mychild.style.marginTop = mychild.style.styleMarginTop = ( y - a ) + 'px';

				}
			}
