//++++++++++++++++++++++++++++++++++++++++++++++++++
// Scrolling
//++++++++++++++++++++++++++++++++++++++++++++++++++
var clipLeft = 0;
var clipWidth = 370;
var clipBottom = 190;
var clipRight=370;
var topper = 0;
var lyrwidth=0 ;
var maxwidth= 0;
var time,amount,theTime,theHeight,DHTML;

function init() {
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('tbl-teaser-content');
                var y = new getObj('tbl-content');

	if (document.layers)
	{
		lyrwidth = y.style.clip.right;
		lyrwidth += 20;

		x.style.clip.top = 0;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{

		lyrwidth = y.obj.offsetWidth;
                                x.style.clip = 'rect( 0,'+clipWidth+'px,'+clipBottom+'px,'+clipLeft+'px)';
	} 
                scrollayer('tbl-teaser-content',10,100);
                scrollayer('tbl-teaser-content',-10,100);
               

}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function realscroll()
{

	if (!DHTML) return;
	clipLeft += amount;
	clipRight += amount;
	topper -= amount;

  if(clipLeft < 1 ) {      
   	  hidelayer('imgnavleft',0);
  }else {
      hidelayer('imgnavleft',1);
    }
  
  if(clipRight > lyrwidth-15) {
	  hidelayer('imgnavright',0);	  
  }else{
    hidelayer('imgnavright',1);
  }



	if (clipLeft < 0 || clipRight > lyrwidth)
	{
                clipLeft -= amount ;
	clipRight -= amount;
	topper += amount;
                return;
                }
	if (document.getElementById || document.all)
	{
		clipstring = 'rect(0,'+clipRight+'px,'+clipBottom+'px,'+clipLeft+'px)';
		thelayer.style.clip = clipstring;
		thelayer.style.left = topper + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.left = clipLeft;
		thelayer.style.clip.right = clipRight;
		thelayer.style.left = topper;
	}
	time = setTimeout('realscroll()',theTime);
}

function stopscroll()
{
	if (time) clearTimeout(time);
}

function vis(val)
{
	if (!DHTML) return;
	var f = new getObj('tbl-teaser-content');
	f.style.visibility = val;
}

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function findserien(el)
{
     obj=document.getElementById(el);
     window.location.href= obj.options[obj.selectedIndex].value;
}


function autoseldropdown() {
 var thisURL = location.href;
 if ( thisURL.indexOf("tx_mkanydropdownmenu_pi1=") == -1) {
    var currsel = document.glossarform.glossdropdown;
    var optrand = Math.round(currsel.length * Math.random());
    if (optrand == 0 ) {
        optrand=1;
     }
     document.glossarform.glossdropdown.selectedIndex = optrand;
      tx_mkanydropdownmenu_pi1_go('self',currsel,1);           
  }
}

function hidelayer(element,flgshow)
{
 switch (flgshow) {
   case 1:   
      if (document.getElementById || document.all)  {
         document.getElementById(element).style.visibility = "visible";     
         break;    
         }      
      
   case 0:   
      if (document.getElementById || document.all)  {
         document.getElementById(element).style.visibility = "hidden";    
         break;     
         }       
   }
}