//init global vars
var maximg = 0;
var imgs = new Array();
var next = null;
var prev = null;
var home = null;

function setHome(targ){
    home = targ;		
}
function setNext(targ){
    next = targ;
}
function setPrev(targ){
    prev = targ;
}


function jumpto(targ){
    if (targ!=0) {
        window.location=targ;
        window.status=targ;
    }
    window.status=targ;
}
// jump to previous page 
function jumpBack(){
    if (prev!=null){
        jumpto(prev);	
    }	
}
// jump to next page 
function jumpNext(){
    if (prev!=null){
        jumpto(next);	
    }	
}
// jump to home page 
function jumpHome(){
    if (home!=null){
        jumpto(home);	
    }
}
// random background colors for the ameise matrix!
function chgcolor(cell){
    r=Math.round(Math.random()*255);
    b=Math.round(Math.random()*255);
    g=Math.round(Math.random()*255);
    document.getElementById("cell"+cell).style.backgroundColor = "rgb("+r+","+g+","+b+")";
    window.status="";
}
//desselbe in grau
function chgcolorbw(cell){
    g=Math.round(Math.random()*250);
    document.getElementById("cell"+cell).style.backgroundColor = "rgb("+g+","+g+","+g+")";
}

//popup images randomly
function showimg(img){
    n = Math.round(Math.random()*(maximg-1));
    document.images["img"+img].src = imgs[n].src;
    window.status=n;
}
//change big pic
function swapBigPic(img){
    document.images["stor_pic0"].src = imgs[img].src;
    window.status=img;		
}
function startAniMore(){
    document.images["more_pic"].src = imgs[1].src;
}
function stopAniMore(){
    document.images["more_pic"].src = imgs[0].src;
}

function startAniHome(){
    document.images["home_pic"].src = imgs[3].src;
}
function stopAniHome(){
    document.images["home_pic"].src = imgs[2].src;
}
function startAniStart(){
    document.images["start_pic"].src = imgs[5].src;
}
function stopAniStart(){
    document.images["start_pic"].src = imgs[4].src;
}

//put images in the list for the aktuelle seite
function pushimg(src){
    imgs[maximg] = new Image();
    imgs[maximg].src = src;
    maximg++;
    window.status=maximg;
}


