/*
This code is from Dynamic Web Coding
at http://www.dyn-web.com/
Copyright 2002 by Sharon Paine
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Permission granted to use this code
as long as this entire notice is included.
*/

var origWidth, origHeight;
if (document.layers) {
  origWidth = window.innerWidth;
  origHeight = window.innerHeight;
}

// If your wipe series includes images, put them in this array for preload.
var wipe_imgs=new Array("images/enter.jpg");
if (document.images) {
        var theImgs=new Array();
        for (var i=0;i<wipe_imgs.length;i++) {
                theImgs[i]=new Image();
                theImgs[i].src=wipe_imgs[i];
        }
}

// put your items here
// content, wipe-in duration, wipe-in effect, wipe-out effect, wipe-out delay
// put empty string in 4th slot if no wipe-out desired (last item)
var wipe_array=new Array(
    'Servus, i bin der Toni Tornado aus der Lolabar.',1000,'in top','out top',100,
    'G\'freit mi, daß ihr bei mir reischauts. Ein Klick und drin seids ihr. Wünsche euch viel Spaß auf meiner Seitn, die euch \'nen kleinen Vorgeschmack auf meine Bar geben soll.',2500,'in corner','out corner',3000,
    'Wenns mehr haben wollts, schauts einfach live vorbei. Aber denkts dran:',1100,'in corner','out corner',500,
    '<div class="wipe2"><a href="pages/home.html"><img src="images/noschickimicki.jpg" width="300" height="75" border="0" alt=""></a></div>',1500,'in center','',500
);

var dest_delay = 3000; // delay before going to destination url
// destination url, where to go at end of wipes
function setDest() {
        window.location = "#";
}

function to_do_onresize() {
        if (document.layers) {
         if (window.innerWidth != origWidth || window.innerHeight != origHeight)
            window.location.reload();
        } else {
                if (wipeLyr1) wipeLyr1.centerIn(window);
        }
}
window.onresize = to_do_onresize;

var wipeLyr1;
function initDynLyrs() {
        // args: id,top,left,width
        wipeLyr1 = new dynObj('wipeDiv1',0,0,400);

        // send non-capable browsers to destination url now
        if (!wipeLyr1 || !document.layers && typeof wipeLyr1.doc.innerHTML == "undefined"){
                setDest();
                return;
        }
        wipeLyr1.centerIn(window);
        doWipes();
}
window.onload=initDynLyrs;

// prepare for wipe in (called from doWipes fn)
function wipePrep(obj,cntnt,id) {
        obj.hide();
        // restore, for ns4, or new content is visible...
        obj.clipTo(0,obj.width,obj.height,0);
        obj.writeLyr(cntnt);
        obj.width=getWidth(obj.el,id);
        obj.height=getHeight(obj.el,id);
}

var wipe_count=0;        // to keep track
function doWipes() {
        if (wipe_count<wipe_array.length) {
        // in table so width/height of content can be obtained
                var cntnt = '<table id="w1" width="'+wipeLyr1.width+'" border="0" cellpadding="0" cellspacing="0"><tr><td class="wipe">'+  wipe_array[wipe_count] +'</td></tr></table>';

                wipePrep(wipeLyr1,cntnt,'w1');
                wipeLyr1.centerIn(window);

                // args: which wipe, delay, wipeTime, what next
                wipeLyr1.wipe(wipe_array[wipe_count+2],1000, wipe_array[wipe_count+1],"wipeOuts()");
  } else {
                // What to do when all your array elements have been wiped.
                setTimeout('setDest()',dest_delay);
        }
}

function wipeOuts() {
        var dv = 4;
        if (wipe_array[wipe_count+3])
                wipeLyr1.wipe(wipe_array[wipe_count+3], wipe_array[wipe_count+4], wipe_array[wipe_count+1]/dv,"doWipes()");
        else setTimeout("doWipes()",wipe_array[wipe_count+4]);
        wipe_count+=5;
}
