
var speed=2;

function setNext(){
if(act <= bilder.length -2){
  newact = act +1;
}
else newact = 0;

setBig(newact);
act = newact;
}



function setBigTwolinks(num){

document.getElementById('imgbig').src = bilder[num][0];
if (bilder[num][4] != 0){
  document.getElementById('titleimg').firstChild.data = '';
  var newa = document.createElement("a");
  newa.setAttribute("href", bilder[num][3]);
  newa.setAttribute("target","_new");
  var newtext = document.createTextNode(bilder[num][1]);
  newa.appendChild(newtext);
  document.getElementById('titleimg').replaceChild(newa, document.getElementById('titleimg').firstChild);
  
   document.getElementById('subtitleimg').firstChild.data = '';
  var newa2 = document.createElement("a");
   newa2.setAttribute("href", bilder[num][4]);
  newa2.setAttribute("target","_new");
  var newtext2 = document.createTextNode(bilder[num][2]);
  newa2.appendChild(newtext2);
  document.getElementById('subtitleimg').replaceChild(newa2, document.getElementById('subtitleimg').firstChild);
   
  act = num;
}
else if (bilder[num][3] != 0){

  document.getElementById('titleimg').firstChild.data = '';
   document.getElementById('subtitleimg').firstChild.data = '';
    var newa = document.createElement("a");
  //var brtag = document.createElement("br");
  newa.setAttribute("href", bilder[num][3]);
  newa.setAttribute("target","_new");
  var newtext = document.createTextNode(bilder[num][1]);
  newa.appendChild(newtext);
  document.getElementById('titleimg').replaceChild(newa, document.getElementById('titleimg').firstChild);
 titel = document.createTextNode(bilder[num][2]);
	 document.getElementById('subtitleimg').replaceChild(titel, document.getElementById('subtitleimg').firstChild);
  act = num;
}
else {
	 titel = document.createTextNode(bilder[num][1]);
	 document.getElementById('titleimg').replaceChild(titel, document.getElementById('titleimg').firstChild);
	 titel2 = document.createTextNode(bilder[num][2]);
	 document.getElementById('subtitleimg').replaceChild(titel2, document.getElementById('subtitleimg').firstChild);
	 act = num;
}
}

function setNextNeu(){
if(act != 0){
  newact = act -1;
}
else newact = bilder.length -1;

setBig(newact);
act = newact;
}

function setNextNeuTwolinks(){
if(act != 0){
  newact = act -1;
}
else newact = bilder.length -1;

setBigTwolinks(newact);
act = newact;
}

function setBig(num){

document.getElementById('imgbig').src = bilder[num][0];
if (bilder[num][3] != 0){
  document.getElementById('titleimg').firstChild.data = '';
  var newa = document.createElement("a");
  //var brtag = document.createElement("br");
  newa.setAttribute("href", bilder[num][3]);
  newa.setAttribute("target","_new");
  var newtext = document.createTextNode(bilder[num][1]);
  newa.appendChild(newtext);
  document.getElementById('titleimg').replaceChild(newa, document.getElementById('titleimg').firstChild);
  document.getElementById('subtitleimg').firstChild.data = bilder[num][2];
  act = num;
}
else {
	 titel = document.createTextNode(bilder[num][1]);
	 document.getElementById('titleimg').replaceChild(titel, document.getElementById('titleimg').firstChild);
	 document.getElementById('subtitleimg').firstChild.data = bilder[num][2];
	 act = num;
}
}

function moveright(){
if (window.movedownvar) clearTimeout(movedownvar)
//alert (parseInt(crossobj.style.left));
//alert (contentwidth);
if (iens6&&parseInt(crossobj.style.left)<=0)

crossobj.style.left=parseInt(crossobj.style.left)+speed+"px"
else if (ns4&&crossobj.left<=0)
crossobj.left+=speed
moveupvar=setTimeout("moveright()",20)
}


function moveleft(){
if (window.moveupvar) clearTimeout(moveupvar)
//alert (parseInt(crossobj.style.left));
//alert (parseInt(crossobj.style.left));
if (iens6&&parseInt(crossobj.style.left)>=(contentwidth*(-1)+100))
crossobj.style.left=parseInt(crossobj.style.left)-speed+"px"
else if (ns4&&crossobj.left>=(contentwidth*(-1)+100))
crossobj.left-=speed
movedownvar=setTimeout("moveleft()",20)
}

function stop(){
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}


function getcontent_width(){
if (iens6)
contentheight=crossobj.offsetWidth
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}

// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)


function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;
function getFlashVersion() {
   var latestFlashVersion = 8;
   var agent = navigator.userAgent.toLowerCase(); 
   
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
   // NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
   if (navigator.plugins != null && navigator.plugins.length > 0) {
      var flashPlugin = navigator.plugins['Shockwave Flash'];
      if (typeof flashPlugin == 'object') { 
         for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
      }
   }

   // IE4+ Win32:  attempt to create an ActiveX object using VBScript
   else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
      var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }
      
   // WebTV 2.5 supports flash 3
   else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

   // older WebTV supports flash 2
   else if (agent.indexOf("webtv") != -1) flashVersion = 2;

   // Can't detect in all other cases
   else {
      flashVersion = flashVersion_DONTKNOW;
   }

   return flashVersion;
}

flashVersion_DONTKNOW = -1;
