// 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 imgpreload=new Array()
for (i=0;i<=imgsname.length-1;i++) {
	imgpreload[i]=new Image()
	imgpreload[i].src=imgsname[i]
}
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_imgs=0
var i_loop=0
var thisurl=0
var timer
var coverwidth
var coverheight
standstill=standstill*1000

function init() {
    if (document.all) {
	    document.all.imgs.style.posTop=imgstop
        document.all.imgs.style.posLeft=imgsleft
        document.all.cover.style.posTop=imgstop
        document.all.cover.style.posLeft=imgsleft
		imgs.innerHTML="<img name='imgsback' src='"+imgsname[i_loop]+"' border=0>"
		coverwidth=imgs.offsetWidth
		coverheight=imgs.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.imgs.top=imgstop
        document.imgs.left=imgsleft
        document.cover.top=imgstop
        document.cover.left=imgsleft
		document.imgs.document.write("<img name='imgsback' src='"+imgsname[i_loop]+"' border=0>")
		document.imgs.document.close()
		coverwidth=document.imgs.document.width
		coverheight=document.imgs.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_imgs++
            
            if (i_imgs>=imgsname.length) {i_imgs=0}
                if (document.all) { 
                    imgsback.src=imgsname[i_imgs]
                }
                if (document.layers) {
                    document.imgs.document.imgsback.src=imgsname[i_imgs] 
                }
            timer= setTimeout("enlargehearts()",(4*pause))
        }
}

function gotourl() {
	document.location.href=imgslink[i_imgs]
}
window.onload=init