<!--

var tspeed=5;     // Versatz in Pixeln bei jedem "Ticken" (5)
var tmsec=40;     // Intervall in Millisekunden bis zum nächsten "Ticken"(40)
if (is.mac || is.ns5) tspeed*=2;

var imgbase = '../../img';

var scrollgifs = new Array();
scrollgifs[0] = imgbase + '/' + 'scroll_up.gif';  // nach oben
scrollgifs[1] = imgbase + '/' + 'scroll_down.gif'; // nach unten
scrollgifs[2] = 17;                                // Breite Image
scrollgifs[3] = 17;                                // Höhe Image
scrollgifs[4] = imgbase + '/' + 'scroll_fuell.gif'; // Hintergrund für Scrollbalken
scrollgifs[5] = imgbase + '/' + 'scroll_but.gif';  // Mittel-Button für Scrollbalken
scrollgifs[6] = 30;                                // Höhe Mittel-Button
var trand=1;                                       // Stärke des Rahmens in Pixeln
var scrollw = scrollgifs[2]+2*trand;   // Breite des Scrollelements in Pixeln (incl. Rahmen)
var scrollh = th;                      // Höhe des Scrollelements in Pixeln (incl. Rahmen)
var scrollx = tx + tw;
var scrolly = ty;
var butx = scrollx+trand;                     // Position Mittel-Button von links
var butystart = scrolly+scrollgifs[3]+2*trand // Position Mittel-Button von oben
var buty = butystart;

//----------------------------------------------------------------------------

var tick;
var y1=0;
var y2=th;

//----------------------------------------------------------------------------

function getDivHandle(ID)
{
 if (is.ie && is.mac) return eval("document.all."+ID);
 else if (document.getElementById) return document.getElementById(ID);
 else if (document.layers) return eval("document."+ID);
}

function getStyleHandle(ID)
{
 if (is.ie && is.mac) return eval("document.all."+ID+".style");
 else if (document.getElementById) return document.getElementById(ID).style;
 else if (document.layers) return eval("document."+ID);
}

//-----------------------------------------------------------------------------

function scroll_up(idnr)
{
 txtstyle=getStyleHandle("content"+idnr+"txt");
//  alert(txtstyle.top);
//  alert(scrollstop);
 if (parseInt(txtstyle.top) <= scrollstop) { clearInterval(tick); }
 else
 { 
  txtstyle.top = parseInt(txtstyle.top) - tspeed;
  y1 += tspeed; y2 += tspeed;
  if (document.layers) { txtstyle.clip.top=y1; txtstyle.clip.bottom=y2; }
  else { txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)'; }
  if (!is.ns4)
  {
  mbutposition=leseoben();
  mbutnew=parseInt(mbutposition);
  mbutnew+=(tspeed*scrh)/(ticktexth-scrollh);
  if (mbutnew <= butystart) {setzeoben(butystart);}
  else if (mbutnew >= butystart + scrh - scrollgifs[6]) {setzeoben(butystart + scrh - scrollgifs[6]);}
  else {setzeoben(mbutnew);}
  }
 }
 return;
}

function scroll_down(idnr)
{
 txtstyle=getStyleHandle("content"+idnr+"txt");
 // alert(txtstyle.top);
 if (parseInt(txtstyle.top) >= ty) { clearInterval(tick); }
 else
 { 
  txtstyle.top=parseInt(txtstyle.top) + tspeed;
  y1 -= tspeed; y2 -= tspeed;
  if (document.layers) { txtstyle.clip.top=y1; txtstyle.clip.bottom=y2; }
  else { txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)'; }
 if (!is.ns4)
 {
   mbutposition=leseoben();
   mbutnew=parseInt(mbutposition);
   mbutnew-=(tspeed*scrh)/(ticktexth-scrollh);
   if (mbutnew <= butystart) {setzeoben(butystart);}
   else if (mbutnew >= butystart + scrh - scrollgifs[6]) {setzeoben(butystart + scrh - scrollgifs[6]);}
   else {setzeoben(mbutnew);}
  }
 }
}

function createDivStart(idnr)
{
  if (document.layers)
  { 
    regener=setTimeout("window.onresize=regenerate",450); 
    document.writeln('<layer id="content'+idnr+'txt" class="trand" z-index="100"');
    document.writeln('left="'+tx+'" top="'+ty+'" width="'+tw+'" clip="'+tw+','+th+'">');
  }
  else
  {
    document.write('<div id="content'+idnr+'txt" class="trand" ');
    document.write('style="width:'+tw+'px;');
    document.writeln('position:absolute; left:'+tx+'px; top:'+ty+'px; z-index:100;">');
  }
 return 0;
}

function createScroller(idnr)
{
 if (document.layers)
 { 
  document.write('<layer id="scroller" left="'+scrollx+'" top="'+scrolly+'" ');
  document.writeln('width="'+scrollw+'" height="'+scrollh+'" z-index="200">');
 }
 else
 {
  document.write('<div id="scroller" style="position:absolute; left:'+scrollx+'px; top:'+scrolly+'px; ');
  document.writeln('width:'+scrollw+'px; height:'+scrollh+'px; z-index:200;">');
 }
  document.writeln('<TABLE WIDTH="'+scrollw+'" BORDER="0" CELLSPACING="0" CELLPADDING="0">');
  document.writeln('<TR>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+scrollgifs[2]+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('</TR>');
  document.writeln('<TR>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.write('<TD><A HREF="javascript:void(0);" ONMOUSEDOWN="down('+idnr+')"	ONMOUSEUP="stop()" ');
  document.write('ONMOUSEOVER="if(is.mac)down('+idnr+')" ONMOUSEOUT="if(is.mac)stop()"><IMG ');
  document.write('SRC="'+scrollgifs[0]+'" WIDTH="'+scrollgifs[2]+'" HEIGHT="'+scrollgifs[3]+'" BORDER="0"></A></TD>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('</TR>');
  scrh=scrollh-2*trand-2*scrollgifs[3];
  document.writeln('<TR>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('<TD BACKGROUND="'+scrollgifs[4]+'"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+scrollgifs[2]+'" HEIGHT="'+scrh+'"></TD>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('</TR>');
  document.writeln('<TR>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.write('<TD><A HREF="javascript:void(0);" ONMOUSEDOWN="up('+idnr+')"	ONMOUSEUP="stop()" ');
  document.write('ONMOUSEOVER="if(is.mac)up('+idnr+')" ONMOUSEOUT="if(is.mac)stop()"><IMG ');
  document.write('SRC="'+scrollgifs[1]+'" WIDTH="'+scrollgifs[2]+'" HEIGHT="'+scrollgifs[3]+'" BORDER="0"></A></TD>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('<TR>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+scrollgifs[2]+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('<TD CLASS="tscroll"><IMG SRC="'+imgbase+'/trans.gif" WIDTH="'+trand+'" HEIGHT="'+trand+'"></TD>');
  document.writeln('</TR>');
  document.writeln('</TABLE>');
  if (document.layers) document.writeln('</layer>');
  else  document.writeln('</DIV>');
}

function regenerate() { self.location.reload(); }

function tstart(idnr)
{
  txt=getDivHandle("content"+idnr+"txt");
  if (is.ie && is.mac)
  {
    if (txt.offsetHeight) ticktexth=parseInt(txt.offsetHeight);
    else { alert("mac(ie): ticker text height not defined"); return; }
  }
  else if (document.getElementById)
  {
    if (txt.offsetHeight)
    {
    ticktexth=parseInt(txt.offsetHeight);
    //alert(ticktexth);
    }
    else if(txt.firstChild.offsetHeight) ticktexth=parseInt(txt.firstChild.offsetHeight);
    else { alert("dom: ticker text height not defined"); return; }
  }
  else if (document.layers)
  { 
   if (txt.document.height) ticktexth=txt.document.height;
   else { alert("layers: ticker text height not defined"); return; }
  }
  txtstyle=getStyleHandle("content"+idnr+"txt");
  if (is.ie && is.mac) { txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)'; }
  else if (document.getElementById) { txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)'; }
  else if (document.layers) { txtstyle.clip.top=y1; txtstyle.clip.bottom=y2; }

  if (ticktexth <= scrollh)
  {
    scrollstyle=getStyleHandle("scroller");
    scrollstyle.visibility="hidden";
    mbutstyle=getStyleHandle("mbut");
    mbutstyle.visibility="hidden";
  }
// scrollstop = (ticktexth-ty-Math.floor(th/2));
  scrollstop = (ticktexth-ty-th)*-1;
}

function up(idnr)
{ 
  if (tick) { clearInterval(tick); }
  if (ticktexth) { tick=setInterval("scroll_up("+idnr+")",tmsec); }
}

function down(idnr)
{ 
 if (tick) { clearInterval(tick); }
 if (ticktexth) { tick=setInterval("scroll_down("+idnr+")",tmsec); }
}

function stop() { if (tick) clearInterval(tick); }
function tunload() 
{ 
 if (tick) clearInterval(tick);
 if (document.layers) clearTimeout(regener); 
}
// -------------- Drag&Drop-Button ----------------------------------------


function createButton()
{
 if (document.layers)
 {
//  document.write('<layer id="mbut" left="'+butx+'" top="'+buty+'" ');
//  document.writeln('width="'+scrollw+'" height="'+scrollgifs[6]+'" z-index="300">');
 }
 else
 {
  document.write('<div id="mbut" style="position:absolute; left:'+butx+'px; top:'+buty+'px; ');
  document.writeln('width:'+scrollw+'px; height:'+scrollgifs[6]+'px; z-index:300;">');
 }
 if (!is.ns4)
 {
 document.writeln('<IMG SRC="'+scrollgifs[5]+'" WIDTH="'+scrollgifs[2]+'" HEIGHT="'+scrollgifs[6]+'" BORDER="0" id="mbutton" name="mbutton">');
 }
if (document.layers)
{
//    document.writeln('</layer>');
}
 else  document.writeln('</DIV>');
}

function leseoben()
{
 if (document.all) {return document.all.mbut.style.posTop;}
// else if (document.layers) {return document.mbut.top;}
 else if (document.getElementById) {return document.getElementById('mbut').style.top;}
}

function setzeoben(n)
{
  if (document.all) {document.all.mbut.style.posTop = n;}
//  else if (document.layers) {document.mbut.top = n;}
  else if (document.getElementById) {document.getElementById('mbut').style.top = n;}
}

/*if (document.captureEvents)
  {
      document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
      document.onmousedown=pickBut;
      document.onmouseup=loseBut;
  } */
if (!is.ns4)
{
document.onmousedown=pickBut;
document.onmouseup=loseBut;
}

function ziel(e)
{
   if (window.Event) return e.target;
   else return event.srcElement;
}

function y_koord(e)
{
    if (window.Event) return e.pageY;
    else return event.clientY;
}
var aktuell_y;
var maus_y;
var dist_y;

function pickBut(e)
{
 var ev =(window.Event)? e : window.event;
 if (ev.type=="mousedown" && ziel(ev).name=="mbutton")
   {
       aktuell_y =leseoben();
       schritte = 0;
	   if (document.layers)
 		 {
          /*  	    maus_y = e.pageY;
            	    dist_y = maus_y-parseInt(aktuell_y);
             	    document.captureEvents(Event.MOUSEMOVE);
		    document.onmousemove = pickBut;			
		    return false;  */
		}
	   else if (document.all)
        	{
		    maus_y = window.event.y;
		    dist_y = maus_y-parseInt(aktuell_y);
            	    document.onmousemove = pickBut;			
		    return false;
		}
	   else if (document.getElementById)
        	{
		    maus_y = e.clientY;
		    dist_y = maus_y-parseInt(aktuell_y);
            	    document.onmousemove = pickBut;			
		    return false;
		}	
   }
 if (ev.type=="mousemove")
   {
	   if (document.layers)
 		 {
		/*	var obj = document.mbut;
			altobjtop =  obj.top;
			newobjtop = e.pageY - dist_y;
			if (newobjtop<butystart) obj.top=butystart;
			else if (newobjtop>butystart + scrh - scrollgifs[6]) obj.top=butystart + scrh - scrollgifs[6];
			else obj.top=newobjtop;
			txtstyle=getStyleHandle("content42txt");
			dist_obj = altobjtop - newobjtop;
            		tschritt=((ticktexth-scrollh)/(scrh-scrollgifs[6]))* Math.abs(dist_obj);
            		if (tschritt<1) { schritte+=tschritt; }
            		if ((schritte>=1) || (tschritt>=1))
            		{
                		if (tschritt>=1) schritte=tschritt;
                		schritte=parseInt(schritte);
                		if (altobjtop<obj.top)
                			{
                 			newtop = parseInt(txtstyle.top) - schritte;
                 			if (newtop>ty)
                 				{
                      				txtstyle.top = ty;
                      				y1 = 0; y2 = th;
						txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                 				}
                 			else if (newtop<ty-(ticktexth-scrollh))
                 				{
                      				txtstyle.top = ty-(ticktexth-scrollh);
                      				y1 = ticktexth-scrollh; y2 = th+ticktexth-scrollh;
						txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                 				}
                 			else
                 				{
                     				txtstyle.top = parseInt(txtstyle.top) - schritte;
                     				y1 += schritte; y2 += schritte;
						txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                 				}
                			}			
                		if (altobjtop>obj.top)
                			{
                 			newtop = parseInt(txtstyle.top) + schritte;
                 			if (newtop>ty)
                 				{
                      				txtstyle.top = ty;
                      				y1 = 0; y2 = th;
						txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                 				}
                 			else if (newtop<ty-(ticktexth-scrollh))
                 				{
                      				txtstyle.top = ty-(ticktexth-scrollh);
                      				y1 = ticktexth-scrollh; y2 = th+ticktexth-scrollh;
						txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                 				}
                 			else
                 				{
                     				txtstyle.top = parseInt(txtstyle.top) + schritte;
                     				y1 -= schritte; y2 -= schritte;
						txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                 				}
                			}
                		schritte=0;
            			}
			document.captureEvents(Event.MOUSEMOVE);
			document.onmousemove = pickBut;			
			return false;   */
			}
		if (document.all)
        		{
			var obj = document.all.mbut.style;
			altobjtop =  obj.pixelTop;
			newobjtop = window.event.y - dist_y;
			if (newobjtop<butystart) obj.pixelTop=butystart;
			else if (newobjtop>butystart + scrh - scrollgifs[6]) obj.pixelTop=butystart + scrh - scrollgifs[6];
			else obj.pixelTop=newobjtop;
			txtstyle=getStyleHandle("content42txt");
            		dist_obj = altobjtop - newobjtop;
            		tschritt=((ticktexth-scrollh)/(scrh-scrollgifs[6]))* Math.abs(dist_obj);
            		if (tschritt<1) { schritte+=tschritt; }
            		if ((schritte>=1) || (tschritt>=1))
            			{
                		if (tschritt>=1) schritte=tschritt;
                		schritte=parseInt(schritte);
                		if (altobjtop<newobjtop)
                			{
                 			newtop = parseInt(txtstyle.pixelTop) - schritte;
                 			if (newtop>ty)
                 				{
                      				txtstyle.pixelTop = ty;
                      				y1 = 0; y2 = th;
                 				}
                 			else if (newtop<ty-(ticktexth-scrollh))
                 				{
                      				txtstyle.pixelTop = ty-(ticktexth-scrollh);
                      				y1 = ticktexth-scrollh; y2 = th+ticktexth-scrollh;
                 				}
                 			else
                 				{
                     				txtstyle.pixelTop = newtop;
                     				y1 += schritte; y2 += schritte;
                 				}
                			}
                		else if (altobjtop>newobjtop)
                			{
                 			newtop = parseInt(txtstyle.pixelTop) + schritte;
                 			if (newtop>ty)
                 				{
                      				txtstyle.pixelTop = ty;
                      				y1 = 0; y2 = th;
                 				}
                 			else if (newtop<ty-(ticktexth-scrollh))
                 				{
                      				txtstyle.pixelTop = ty-(ticktexth-scrollh);
                      				y1 = ticktexth-scrollh; y2 = th+ticktexth-scrollh;
                 				}
                 			else
                 				{
                    		 		txtstyle.pixelTop = newtop;
                     				y1 -= schritte; y2 -= schritte;
                 				}
                			}
                			txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                			schritte=0;
            			}
				document.onmousemove = pickBut;			
				return false;
			}
		if (document.getElementById)
        		{
			var obj = document.getElementById('mbut').style;
			altobjtop = parseInt(obj.top);
			newobjtop = parseInt(e.clientY) - dist_y;		
			if (newobjtop<butystart)
				{
				document.getElementById('mbut').style.top=butystart;	
				}
			else if (newobjtop>butystart + scrh - scrollgifs[6])
				{
				document.getElementById('mbut').style.top=butystart + scrh - scrollgifs[6];		
				}
			else 
				{
                     		document.getElementById('mbut').style.top=newobjtop;
                    		}
			txtstyle = getStyleHandle("content42txt");
			dist_obj = altobjtop - newobjtop;
            		tschritt=((ticktexth-scrollh)/(scrh-scrollgifs[6]))* Math.abs(dist_obj);
            		if (tschritt<1) { schritte+=tschritt; }
            		if ((schritte>=1) || (tschritt>=1))
            			{
                		if (tschritt>=1) schritte=tschritt;
                		schritte=parseInt(schritte);
                		if (altobjtop<newobjtop)
                			{
                 			newtop = parseInt(txtstyle.top) - schritte;
                 			if (newtop>ty)
                 				{
                      				txtstyle.top = ty;
                      				y1 = 0; y2 = th;
                 				}
                 			else if (newtop<ty-(ticktexth-scrollh))
                 				{
                      				txtstyle.top = ty-(ticktexth-scrollh);
                      				y1 = ticktexth-scrollh; y2 = th+ticktexth-scrollh;
                 				}
                 			else
                 				{
                     				txtstyle.top = newtop;
                     				y1 += schritte; y2 += schritte;
                 				}
                			}
                		else if (altobjtop>newobjtop)
                			{
                 			newtop = parseInt(txtstyle.top) + parseInt(schritte);
                 			if (newtop>ty)
                 				{
                      				txtstyle.top = ty;
                      				y1 = 0; y2 = th;
                 				}
                 			else if (newtop<ty-(ticktexth-scrollh))
                 				{
                      				txtstyle.top = ty-(ticktexth-scrollh);
                      				y1 = ticktexth-scrollh; y2 = th+ticktexth-scrollh;
                 				}
                 			else
                 				{
                     				txtstyle.top = newtop;
                     				y1 -= schritte; y2 -= schritte;
                 				}
                			}
                		txtstyle.clip='rect('+y1+'px '+tw+'px '+y2+'px 0px)';
                		schritte=0;
            			} 		
		    document.onmousemove = pickBut;	
		    return false;
		    }
   	}
}

function loseBut(e)
{
    if (!is.ns4)
    {
      document.onmousemove = null;
	  return false;
    }
}

//-->
