var aktImgDiv=1;
var maxImages=29;
var imgTimer=0;
var aktMarker=0;
var maxMarker=10;
var filtOk=true;
var ie=(document.all);

function change12(pIdx)
 {if(pIdx==2) return 1; 
  else return 2}

function gO(pObj)
 {return document.getElementById(pObj)}

function makeObj(pObj,pValue)
 {gO(pObj).innerHTML=pValue}

function ShowObj(pObj)
 {gO(pObj).style.visibility="visible"}

function HideObj(pObj)
 {gO(pObj).style.visibility="hidden"}

function showButton(pObj,pMode)
 {document.getElementById(pObj).src="img/men_"+pObj+pMode+".gif"}

function startShow()
 {stopShow();aktMarker=0;makeMarker(0);ShowObj("markerDiv");aktMarker=0;imgTimer=window.setInterval("nextMarker()",1000)}

function stopShow()
 {HideObj("markerDiv");window.clearInterval(imgTimer)}


function nextImg(pStopeMode)
 {if(pStopeMode==null)stopShow();
  aktImg++;if(aktImg>maxImages)aktImg=1;changeImg()}

function prevImg()
 {stopShow();aktImg--;if(aktImg<1)aktImg=maxImages;changeImg()}

function makeImg(pImg)
 {makeObj("imgDiv",'<IMG src=img/picintro'+pImg+'.jpg width=300 height=300 border=0 usemap="#blank">')}

function changeImg()
 {if(ie && filtOk)
   try
    {gO("imgDiv").filters[0].Apply();
     makeImg(aktImg);
     gO("imgDiv").filters[0].Play()}
    catch(ex)
     {filtOk=false}
  else
   makeImg(aktImg)}

function nextMarker()
 {aktMarker++;if(aktMarker<maxMarker)changeMarker();else{aktMarker=0;changeMarker();nextImg("init")}}

function makeMarker(pPos)
 {makeObj("markerDiv",'<IMG src=img/'+pPos+'.gif width=40 height=40>');}

function changeMarker()
 {if(ie && filtOk)
   try
    {gO("markerDiv").filters[0].Apply();
     makeMarker(aktMarker);
     gO("markerDiv").filters[0].Play()}
    catch(ex)
     {filtOk=false}
  else
   makeMarker(aktMarker)}

function startSite()
 {aktImg=Math.ceil(Math.random()*(24));makeImg(aktImg);makeMarker(0);startShow()}
