// CREDITS:
// Simple Slideshow with striped transition effect by Urs Dudli and Peter Gehrig 
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com.
// info@24fun.ch
// 3/25/2000

// IMPORTANT: 
// If you add this script to a script-library or a script-archive 
// you have to insert a link to http://www.24fun.com right into the webpage where the script
// will be displayed.

var coverimage = new Array()
coverimage[0]="stripes0.gif"
coverimage[1]="stripes1.gif"
coverimage[2]="stripes2.gif"
coverimage[3]="stripes3.gif"
coverimage[4]="stripes4.gif"
coverimage[5]="stripes5.gif"
coverimage[6]="stripes6.gif"
coverimage[7]="stripes7.gif"

var covimgpreload=new Array()
for (i=0;i<=coverimage.length-1;i++) {
	covimgpreload[i]=new Image()
	covimgpreload[i].src=coverimage[i]
}
var i_messages=0
var i_loop=0
var thisurl=0
var timer
var coverwidth
var coverheight
standstill=standstill*1000

var content
if (fontweight=="yes") {
    fontweight="<b>"
} 
else {fontweight=""}

function init() {
	 content="<table width='"+messagewidth+"' height='"+messageheight+"' border='"+borderwidth+"'>"
    content+="<tr valign='"+messagevalign+"'><td align='"+messagealign+"' bgcolor='"+backgroundcolor+"'>"
    content+="<font size='"+fntsize+"' face='"+fntface+"'  color='"+fntcolor+"'>"
    content+=fontweight
    content+=message[i_messages]
    content+="</font></td></tr></table>"
    if (document.all) {
	    document.all.messagebox.style.posTop=messages_top
        document.all.messagebox.style.posLeft=messages_left
        document.all.cover.style.posTop=messages_top
        document.all.cover.style.posLeft=messages_left
		messagebox.innerHTML=content
		coverwidth=messagebox.offsetWidth
		coverheight=messagebox.offsetHeight
		cover.innerHTML="<a href='javascript:gotourl()'><img width="+coverwidth+" height="+coverheight+" name='imgcover' src='"+coverimage[i_loop]+"' border=0></a>"
		
        enlargehearts()
    }
	
	if (document.layers) {
	    document.messagebox.top=messages_top
        document.messagebox.left=messages_left
        document.cover.top=messages_top
        document.cover.left=messages_left
		document.messagebox.document.write(content)
		document.messagebox.document.close()
		coverwidth=document.messagebox.document.width
		coverheight=document.messagebox.document.height
		document.cover.document.write("<a href='javascript:gotourl()'><img width="+coverwidth+" height="+coverheight+" name='imgcover' src='"+coverimage[i_loop]+"' border=0></a>")
		document.cover.document.close()
		
        enlargehearts()
    }
}

function enlargehearts() {
        if (i_loop<=coverimage.length-1) {   
            if (document.all) {
                imgcover.src=coverimage[i_loop]
            }
            if (document.layers) {
                document.cover.document.imgcover.src=coverimage[i_loop]
            }
            i_loop++
            timer= setTimeout("enlargehearts()",pause)  
        }
        else {
            clearTimeout(timer)
            i_loop--
            timer= setTimeout("shrinkhearts()",standstill)
       }
}

function shrinkhearts() {
        if (i_loop>=0) {  
            if (document.all) { 
                imgcover.src=coverimage[i_loop]
            }
            if (document.layers) {
                document.cover.document.imgcover.src=coverimage[i_loop]
            }
            i_loop--
            timer= setTimeout("shrinkhearts()",pause)
        }
        else {
            clearTimeout(timer)
            i_loop=0
            i_messages++
            
            if (i_messages>=message.length) {i_messages=0}
				 content="<table width='"+messagewidth+"' height='"+messageheight+"' border='"+borderwidth+"'>"
                content+="<tr valign='"+messagevalign+"'><td align='"+messagealign+"' bgcolor='"+backgroundcolor+"'>"
                content+="<font size='"+fntsize+"' face='"+fntface+"'  color='"+fntcolor+"'>"
                content+=fontweight
                content+=message[i_messages]
                content+="</font></td></tr></table>"
                if (document.all) { 
                    messagebox.innerHTML=content
                }
                if (document.layers) {
                    document.messagebox.document.write(content)
                    document.messagebox.document.close()
                }
            timer= setTimeout("enlargehearts()",(4*pause))
        }
}

function gotourl() {
	document.location.href=messageboxlink[i_messages]
}
window.onload=init