


var sl_zeit=6000;
var fullpath='../sl/';



if( typeof XMLHttpRequest == "undefined" ) XMLHttpRequest = function() {
  try { return new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch(e) {}
  try { return new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch(e) {}
  try { return new ActiveXObject("Msxml2.XMLHTTP") } catch(e) {}
  try { return new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {}
  throw new Error( "This browser does not support XMLHttpRequest." )
};

var slHTTP = new XMLHttpRequest();
var sl_current=1;



function klick_slideshow(i)
    {
    var c = document.getElementById("sl_menu_"+(sl_current-1));
    if(c!=null)c.style.background='url(\''+fullpath+'bt.png\')';


    sl_current=i;
    do_slideshow();
    }


function bt_exists(url)
    {
    slHTTP.open('POST',url,false);
    slHTTP.send(null);

    if(slHTTP.status==200)return slHTTP.responseText;
    else return false;
    }


function init_slideshow()
    {
    var i=1;
    var m = document.getElementById("sl_menu");

    var bt='';

    while(bt=bt_exists(fullpath+i+'_bt.htm'))
	{
	m.innerHTML += '<div style="background: url(\''+fullpath+'bt.png\')" id="sl_menu_'+i+'" onclick="klick_slideshow('+i+');">'+bt+'</div>';
	i++;
	}
    }

function do_slideshow()
    {
    var c = document.getElementById("sl_menu_"+(sl_current-1));
    if(c!=null)c.style.background='url(\''+fullpath+'bt.png\')';

    slHTTP.open("POST",fullpath+(sl_current++)+".htm");
    slHTTP.onreadystatechange = get_slideshow;
    slHTTP.send(null)


    }



function get_slideshow()
{
    if(slHTTP.readyState == 4)     {
    if(slHTTP.status!=200)
	{
	sl_current=1;
	do_slideshow();
	}
    else
	{
	var c = document.getElementById("sl_menu_"+(sl_current-1));
	if(c!=null)c.style.background='url(\''+fullpath+'bt_hover.png\')';


        var n = document.getElementById("sl_box");
        n.innerHTML = slHTTP.responseText;

	}
    }// state 4
}



document.write("<div  onmouseover=\"window.clearInterval(inta);\" onmouseout=\"inta=window.setInterval('do_slideshow()',"+sl_zeit+");\"><div id=sl_box></div><div id=sl_menu></div></div>");
init_slideshow();
do_slideshow();
inta=window.setInterval('do_slideshow()',sl_zeit);


