
// --- Scrolling ---


function init()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('content');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		var clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		x.style.clip = clipstring;
	}
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function stopScroll()
{
	if (time) clearTimeout(time);
}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)'
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);
}

function getObj(id)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(id);
	  this.style = document.getElementById(id).style;
  }
  else if (document.all)
  {
    this.obj = document.all[id];
	  this.style = document.all[id].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[id];
   	this.style = document.layers[id];
  }
}



// --- Dropdown Menu ---

var timeout;
var menuIDs;

function setMenuIDs(id_array) {
  menuIDs = id_array;
}  

function hideAll() {
  var menu;
  
  for (i=0; i<menuIDs.length; i++) {
    menu = new getObj(menuIDs[i]);
    menu.obj.className = "subsubmenu";  
  }  
}  

function menuOver(id) {
  hideAll();
  clearTimeout(timeout);
  var menu = new getObj(id);
  menu.obj.className = "subsubmenu_selected";
}  

function menuOut(id) {
  timeout = setTimeout("hideAll()", 200);
}

function itemOver(td) {
  var a = td.getElementsByTagName("a").item(0);
  td.className = "subsubmenu_selected";
  a.className = "subsubmenu_selected";
}  

function itemOut(td, nr) {
  var a = td.getElementsByTagName("a").item(0);
  td.className = "subsubmenu_" + nr;
  a.className = "subsubmenu_" + nr;
}  

function linkClass(tag, css_class) {
  tag.className = css_class; 
  tag.getElementsByTagName("a").item(0).className = css_class;
}  

function follow_inner_anker(tag) {
  window.location.href = tag.getElementsByTagName("a").item(0).getAttribute("href", 0);
  
}	
	
	
