﻿/*
Preload Image With Update Bar Script (By Marcin Wojtowicz [one_spook@hotmail.com])
Submitted to and permission granted to Dynamicdrive.com to feature script in it's archive
For full source code to this script and 100's more, visit http://dynamicdrive.com
*/

// You may modify the following:
	var locationAfterPreload = "http://www.fairskye.com" //URL of the page after preload finishes
	var lengthOfPreloadBar = 150 // Length of preload bar (in pixels)
	var heightOfPreloadBar = 15 // Height of preload bar (in pixels)
	// Put the URLs of images that you want to preload below (as many as you want)
	var yourImages = new Array("http://yourdomain.com/test1.gif","http://yourdomain.com/test2.gif")

// Do not modify anything beyond this point!
if (document.images) {
	var dots = new Array() 
	dots[0] = new Image(1,1)
	dots[0].src = "black.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size)
	dots[1] = new Image(1,1)
	dots[1].src = "blue.gif" // color of bar as preloading progresses (same note as above)
	var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0
	var loaded = new Array(),i,covered,timerID
	var leftOverWidth = lengthOfPreloadBar%coverage
}
function loadImages() { 
	for (i = 0; i < yourImages.length; i++) { 
		preImages[i] = new Image()
		preImages[i].src = yourImages[i]
	}
	for (i = 0; i < preImages.length; i++) { 
		loaded[i] = false
	}
	checkLoad()
}
function checkLoad() {
	if (currCount == preImages.length) { 
		location.replace(locationAfterPreload)
		return
	}
	for (i = 0; i <= preImages.length; i++) {
		if (loaded[i] == false && preImages[i].complete) {
			loaded[i] = true
			eval("document.img" + currCount + ".src=dots[1].src")
			currCount++
		}
	}
	timerID = setTimeout("checkLoad()",10) 
}
// end hiding -->
/***********************************************
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimages=new Array() //SET IMAGE PATHS. Extend or contract array as needed

fadeimages[0]=["images/front_page/002_install.jpg", "", ""]
fadeimages[1]=["images/front_page/003_install.jpg", "", ""]
fadeimages[2]=["images/front_page/004_install.jpg", "", ""]
fadeimages[3]=["images/front_page/005_install.jpg", "", ""]
fadeimages[4]=["images/front_page/006_install.jpg", "", ""]
fadeimages[5]=["images/front_page/007_install.jpg", "", ""]
fadeimages[6]=["images/front_page/008_install.jpg", "", ""]
fadeimages[7]=["images/front_page/009_install.jpg", "", ""]
fadeimages[8]=["images/front_page/010_install.jpg", "", ""]

var fadeimages1=new Array() 

fadeimages1[0]=["images/connected/001_connect.jpg", "", ""]
fadeimages1[1]=["images/connected/002_connect.jpg", "", ""]
fadeimages1[2]=["images/connected/003_connect.jpg", "", ""]
fadeimages1[3]=["images/connected/004_connect.jpg", "", ""]
fadeimages1[4]=["images/connected/005_connect.jpg", "", ""]
fadeimages1[5]=["images/connected/006_connect.jpg", "", ""]
fadeimages1[6]=["images/connected/007_connect.jpg", "", ""]
fadeimages1[7]=["images/connected/008_connect.jpg", "", ""]
fadeimages1[8]=["images/connected/009_connect.jpg", "", ""]

//2nd array set example. Remove or add more sets as needed.
//var fadeimages6=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
//fadeimages6[0]=["photo1.jpg", "", ""] //plain image syntax
//fadeimages6[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
//fadeimages6[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax

var fadeimages2=new Array() //SET IMAGE PATHS. Extend or contract array as needed

fadeimages2[0]=["images/double_exposure/jackie.jpg", "", ""] 
fadeimages2[1]=["images/double_exposure/jim.jpg", "", ""]
fadeimages2[2]=["images/double_exposure/louise.jpg", "", ""]
fadeimages2[3]=["images/double_exposure/michiel.jpg", "", ""]
fadeimages2[4]=["images/double_exposure/ognian.jpg", "", ""]


var fadeimages3=new Array() //SET IMAGE PATHS. Extend or contract array as needed

fadeimages3[0]=["images/material_world/01_earth.jpg", "", ""] //plain image syntax
fadeimages3[1]=["images/material_world/02_fire.jpg", "", ""]
fadeimages3[2]=["images/material_world/03_air.jpg", "", ""]
fadeimages3[3]=["images/material_world/04_sea.jpg", "", ""]

var fadeimages4=new Array() //SET IMAGE PATHS. Extend or contract array as needed

fadeimages4[0]=["images/eye_contact/hiromi.jpg", "", ""] //plain image syntax
fadeimages4[1]=["images/eye_contact/jimmy.jpg", "", ""]
fadeimages4[2]=["images/eye_contact/kim.jpg", "", ""]
fadeimages4[3]=["images/eye_contact/michael.jpg", "", ""]
fadeimages4[4]=["images/eye_contact/stefka.jpg", "", ""]
fadeimages4[5]=["images/eye_contact/tracey.jpg", "", ""]
fadeimages4[6]=["images/eye_contact/tania.jpg", "", ""]

var fadeimages5=new Array()


fadeimages5[0]=["images/connected_exhibition/02_x.jpg", "", ""]
fadeimages5[1]=["images/connected_exhibition/03_x.jpg", "", ""]
fadeimages5[2]=["images/connected_exhibition/04_x.jpg", "", ""]
fadeimages5[3]=["images/connected_exhibition/05_x.jpg", "", ""]
fadeimages5[4]=["images/connected_exhibition/06_x.jpg", "", ""]
fadeimages5[5]=["images/connected_exhibition/07_x.jpg", "", ""]
fadeimages5[6]=["images/connected_exhibition/08_x.jpg", "", ""]
fadeimages5[7]=["images/connected_exhibition/09_x.jpg", "", ""]

var fadeimages6=new Array() //SET IMAGE PATHS. Extend or contract array as needed

fadeimages6[0]=["images/show_05/stati_0001.jpg", "", ""] 
fadeimages6[1]=["images/show_05/stati_secs_001.jpg", "", ""]
fadeimages6[2]=["images/show_05/stati_secs_002.jpg", "", ""]
fadeimages6[3]=["images/show_05/stati_secs_003.jpg", "", ""]
fadeimages6[4]=["images/show_05/stati_secs_004.jpg", "", ""]
fadeimages6[5]=["images/show_05/stati_secs_005.jpg", "", ""]
fadeimages6[6]=["images/show_05/stati_secs_006.jpg", "", ""]
fadeimages6[7]=["images/show_05/stati_secs_007.jpg", "", ""]
fadeimages6[8]=["images/show_05/stati_secs_008.jpg", "", ""]
fadeimages6[9]=["images/show_05/stati_secs_009.jpg", "", ""]
fadeimages6[10]=["images/show_05/stati_secs_010.jpg", "", ""]
fadeimages6[11]=["images/show_05/stati_secs_011.jpg", "", ""]
fadeimages6[12]=["images/show_05/stati_secs_012.jpg", "", ""]
fadeimages6[13]=["images/show_05/stati_secs_013.jpg", "", ""]
fadeimages6[14]=["images/show_05/stati_secs_014.jpg", "", ""]
fadeimages6[15]=["images/show_05/stati_secs_015.jpg", "", ""]
fadeimages6[16]=["images/show_05/stati_secs_016.jpg", "", ""]
fadeimages6[17]=["images/show_05/stati_secs_017.jpg", "", ""]
fadeimages6[18]=["images/show_05/stati_secs_018.jpg", "", ""]
fadeimages6[19]=["images/show_05/stati_secs_019.jpg", "", ""]
fadeimages6[20]=["images/show_05/stati_secs_020.jpg", "", ""]
fadeimages6[21]=["images/show_05/stati_secs_021.jpg", "", ""]
fadeimages6[22]=["images/show_05/stati_secs_022.jpg", "", ""]
fadeimages6[23]=["images/show_05/stati_secs_023.jpg", "", ""]
fadeimages6[24]=["images/show_05/stati_secs_024.jpg", "", ""]
fadeimages6[25]=["images/show_05/stati_secs_025.jpg", "", ""]
fadeimages6[26]=["images/show_05/stati_secs_026.jpg", "", ""]
fadeimages6[27]=["images/show_05/stati_secs_027.jpg", "", ""]
fadeimages6[28]=["images/show_05/stati_secs_028.jpg", "", ""]
fadeimages6[29]=["images/show_05/stati_secs_029.jpg", "", ""]
fadeimages6[30]=["images/show_05/stati_secs_030.jpg", "", ""]
fadeimages6[31]=["images/show_05/stati_secs_031.jpg", "", ""]
fadeimages6[32]=["images/show_05/90X_stati_50.jpg", "", ""]
fadeimages6[33]=["images/show_05/901_stati_50.jpg", "", ""]
fadeimages6[34]=["images/show_05/902_stati_50.jpg", "", ""]
fadeimages6[35]=["images/show_05/903_stati_50.jpg", "", ""]
fadeimages6[36]=["images/show_05/904_stati_50.jpg", "", ""]
fadeimages6[37]=["images/show_05/905_stati_50.jpg", "", ""]
fadeimages6[38]=["images/show_05/906_stati_50.jpg", "", ""]

var fadeimages7=new Array()

fadeimages7[0]=["images/sea_sky/01_sky_lp.jpg", "", ""]
fadeimages7[1]=["images/sea_sky/02_sea_k.jpg", "", ""]
fadeimages7[2]=["images/sea_sky/03_sky_nh.jpg", "", ""]
fadeimages7[3]=["images/sea_sky/04_sea_gap.jpg", "", ""]
fadeimages7[4]=["images/sea_sky/05_sea_sky.jpg", "", ""]
fadeimages7[5]=["images/sea_sky/06_sea_sky.jpg", "", ""]
fadeimages7[6]=["images/sea_sky/07_sea_sky.jpg", "", ""]
fadeimages7[7]=["images/sea_sky/08_sea_sky.jpg", "", ""]

var fadeimages8=new Array()

fadeimages8[0]=["images/light/001_light.jpg", "", ""]
fadeimages8[1]=["images/light/002_light.jpg", "", ""]
fadeimages8[2]=["images/light/003_light.jpg", "", ""]
fadeimages8[3]=["images/light/004_light.jpg", "", ""]
fadeimages8[4]=["images/light/005_light.jpg", "", ""]
fadeimages8[5]=["images/light/006_light.jpg", "", ""]
fadeimages8[6]=["images/light/007_light.jpg", "", ""]
fadeimages8[7]=["images/light/008_light.jpg", "", ""]
fadeimages8[8]=["images/light/009_light.jpg", "", ""]

var fadeimages9=new Array()

fadeimages9[0]=["images/tide/001_tide.jpg", "", ""]
fadeimages9[1]=["images/tide/002_tide.jpg", "", ""]
fadeimages9[2]=["images/tide/003_tide.jpg", "", ""]
fadeimages9[3]=["images/tide/004_tide.jpg", "", ""]

var fadeimages10=new Array()

fadeimages10[0]=["images/railway/001_tunnel.jpg", "", ""]
fadeimages10[1]=["images/railway/002_tunnel.jpg", "", ""]
fadeimages10[2]=["images/railway/003_tunnel.jpg", "", ""]
fadeimages10[3]=["images/railway/004_windscreen.jpg", "", ""]
fadeimages10[4]=["images/railway/005_windscreen.jpg", "", ""]
fadeimages10[5]=["images/railway/006_windscreen.jpg", "", ""]
fadeimages10[6]=["images/railway/007_windscreen.jpg", "", ""]
fadeimages10[7]=["images/railway/008_windscreen.jpg", "", ""]
fadeimages10[8]=["images/railway/009_ribbons.jpg", "", ""]

var fadeimages11=new Array()

fadeimages11[0]=["images/grid/001_air_space.jpg", "", ""]
fadeimages11[1]=["images/grid/002_air_space.jpg", "", ""]
fadeimages11[2]=["images/grid/003_air_space.jpg", "", ""]
fadeimages11[3]=["images/grid/004_air_space.jpg", "", ""]
fadeimages11[4]=["images/grid/005_air_space.jpg", "", ""]
fadeimages11[5]=["images/grid/006_air_space.jpg", "", ""]

var fadeimages12=new Array()

fadeimages12[0]=["images/sea/01_airport.jpg", "", ""]
fadeimages12[1]=["images/sea/02_airport.jpg", "", ""]
fadeimages12[2]=["images/sea/03_airport.jpg", "", ""]

var fadeimages13=new Array()

fadeimages13[0]=["images/murals/01_murals.jpg", "", ""]
fadeimages13[1]=["images/murals/02_murals.jpg", "", ""]
fadeimages13[2]=["images/murals/03_murals.jpg", "", ""]
fadeimages13[3]=["images/murals/04_murals.jpg", "", ""]
fadeimages13[4]=["images/murals/05_murals.jpg", "", ""]
fadeimages13[5]=["images/murals/06_murals.jpg", "", ""]

var fadeimages14=new Array()

fadeimages14[0]=["images/after_image/andrew.jpg", "", ""]
fadeimages14[1]=["images/after_image/judy.jpg", "", ""]
fadeimages14[2]=["images/after_image/marina.jpg", "", ""]
fadeimages14[3]=["images/after_image/ouliana.jpg", "", ""]
fadeimages14[4]=["images/after_image/yvonne.jpg", "", ""]

var fadeimages15=new Array()

fadeimages15[0]=["images/columns/Boris.jpg", "", ""]
fadeimages15[1]=["images/columns/FreudA.jpg", "", ""]
fadeimages15[2]=["images/columns/FreudB.jpg", "", ""]
fadeimages15[3]=["images/columns/Valerie.jpg", "", ""]

var fadeimages16=new Array()

fadeimages16[0]=["images/aqua/aqua_bay/aqua_bay_01.jpg", "", ""]
fadeimages16[1]=["images/aqua/aqua_bay/aqua_bay_02.jpg", "", ""]
fadeimages16[2]=["images/aqua/aqua_pool/aqua_pool_01.jpg", "", ""]
fadeimages16[3]=["images/aqua/aqua_pool/aqua_pool_02.jpg", "", ""]
fadeimages16[4]=["images/aqua/aqua_pool/aqua_pool_03.jpg", "", ""]
fadeimages16[5]=["images/aqua/aqua_pool/aqua_pool_04.jpg", "", ""]

var fadebgcolor="white"
 
////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;opacity:.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;opacity:.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.opacity)
obj.tempobj.style.opacity=obj.degree/100
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.opacity)
crossobj.style.opacity=this.degree/100
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}// JScript File

