// --------> usefull Functions <--------
// copyright 2004 by Christopher Hubmann
//               ---><---

var browser;
var flash;

function checkBrowser()
{
 if(window.opera)
 {browser = "opera";}
 else if(document.all && !document.getElementById)
 {browser = "ie4";}
 if(navigator.userAgent.indexOf("MSIE 6")>-1)
 {browser = "ie6";}
 else if(navigator.userAgent.indexOf("MSIE 5")>-1)
 {browser = "ie5";}
 else if(navigator.userAgent.indexOf("MSIE")>-1)
 {browser = "ie";}
 else if(navigator.userAgent.indexOf("Mozilla")>-1)
 {browser = "moz";}
 else if(document.layers && !document.getElementById)
 {browser = "ns4";}
 else if(parseInt(navigator.appVersion)>= 5)
 {browser = "ns5";}
}

function checkFlash()
{
 flash=0;
 if (navigator.plugins)
 {
  for(i=0;i<navigator.plugins.length;i++)
  {
   if (navigator.plugins[i].name.indexOf('Flash') > -1)
   {
    for(j=0;j<20;j++)
    {
     if(navigator.plugins[i].description.indexOf(j + '.0') > -1) {flash = j;}
    }
    break;
   }
  }
 }
}

function isImage(obj, image)
{
 var compare = document.images[obj].src.indexOf(image);
 if(compare < 0)
 {return false;}
 else {return true;}
}

function setImage(obj, image)
{
 document.images[obj].src = image;
}

// --------> scrollable Frame <---------
// copyright 2004 by Christopher Hubmann
//               ---><---

var _y;
var _speed;
var _min;
var _max;
var _blank;
var _obj0;
var _n0;
var _h0;
var _obj1;
var _n1;
var _h1;
var _running;

function init(objName0,objName1,normal0,hover0,normal1,hover1,blankGif)
{
	_y = 0;
	_speed = 0;
	_obj0 = objName0;
	_n0 = normal0;
	_h0 = hover0;
	_obj1 = objName1;
	_n1 = normal1;
	_h1 = hover1;
	_blank = blankGif;

	checkBrowser();
	if(browser == "ie5" || browser == "ie6"|| browser == "ie" || browser == "moz")
	{
		_min = - parseInt(document.getElementById('inlineText').offsetHeight);
		_max = parseInt(document.getElementById('container_content').offsetHeight);
	}
	else if(browser == "ie4")
	{
		_min = -document.all['inlineText'].offsetHeight;
		_max = document.all['container_content'].offsetHeight;      
	}
	else if(browser == "ns5" || browser == "ns4")
	{
		_min = - parseInt(document.inlineText.style.clip.offsetHeight);
		_max = parseInt(document.container_content.style.clip.offsetHeight);      
	}

	if(-_min> _max)
	{
		deHover(_obj0, 1);
		deHover(_obj1, 1);
		if(!_running)
		{
			_running = true;
			autoScroll();
		}
	}
	else
	{
		_running = false;
		setImage(_obj0,_blank);
		setImage(_obj1,_blank);
	}
}

function update()
{
	init(_obj0,_obj1,_n0,_h0,_n1,_h1,_blank)
}

function hover(obj)
{
	var isBlank = isImage(obj,_blank);
	if(!isBlank)
	{
		if(obj == _obj0)
		{
			setImage(obj, _h0);
			_speed = 4;
		}
		else
		{
			setImage(obj, _h1);
			_speed = -4;
		}
	}
}

function deHover(obj, force)
{
	var isBlank = isImage(obj,_blank);
	if(!isBlank || force)
	{
		if(obj == _obj0)
		{
			setImage(obj, _n0);
		}
		else
		{
			setImage(obj, _n1);
		}
		_speed = 0;
	}
}

function autoScroll()
{
	if(_running)
	{
		scroll();
		setTimeout("autoScroll()",20);
	}
}

function addScroll(amount)
{
	_speed += amount;
}

function scroll()
{
	if(_speed != 0)
	{
		_y = parseInt(_y + _speed);
		if(_y < parseInt(_min + _max))
	 	{
			_y = parseInt(_min + _max);
			_speed = 0;
		}
		else if(_y> 0)
		{
			_y = 0
			_speed = 0;
		}

		if(browser == "ie5" || browser == "ie6"|| browser == "ie" || browser == "moz")
		{
			document.getElementById('inlineText').style.top = _y +'px';
		}
		else if(browser == "ie4")
		{
			document.all['inlineText'].style.top = _y;     
		}
		else if(browser == "ns5" || browser == "ns4")
		{
			document.inlineText.top = _y;
		}
	}
}