// JavaScript Document

function newWindow(myWindow) {
	window.open(myWindow);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000

// Duration of crossfade (seconds)
var crossFadeDuration = 1

// Specify the image files
// =======================================
// Duplicate This Part For New Slice

var Pic = new Array() // don't touch this

Pic[0] = 'img/imageswap1.jpg'
Pic[1] = 'img/imageswap2.jpg'
Pic[2] = 'img/imageswap3.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}

function runSlideShow(){
if (document.all){
document.SlideShow.style.filter="blendTrans(duration=2)"
document.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.SlideShow.filters.blendTrans.Apply() 
}
document.SlideShow.src = preLoad[j].src
if (document.all){
document.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)

}

// Set slideShowSpeed (milliseconds)
var slideShowSpeed2 = 3000

// Duration of crossfade (seconds)
var crossFadeDuration2 = 1

// Specify the image files
// =======================================
// Duplicate This Part For New Slice

var Pic2 = new Array() // don't touch this

Pic2[0] = 'img/top-left1.jpg'
Pic2[1] = 'img/top-left2.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t2
var j2 = 0
var p2 = Pic2.length

var preLoad2 = new Array()
for (i = 0; i < p2; i++){
preLoad2[i] = new Image()
preLoad2[i].src = Pic2[i]
}

function runSlideShow2(){
if (document.all){
document.SlideShow2.style.filter="blendTrans(duration=2)"
document.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration2)"
document.SlideShow2.filters.blendTrans.Apply() 
}
document.SlideShow2.src = preLoad2[j2].src
if (document.all){
document.SlideShow2.filters.blendTrans.Play()
}
j2 = j2 + 1
if (j2 > (p2-1)) j2=0
t2 = setTimeout('runSlideShow2()', slideShowSpeed2)

}


////////////// slideshow 3 tri-img left ///////////////

// Set slideShowSpeed (milliseconds)
var slideShowSpeed3 = 3500

// Duration of crossfade (seconds)
var crossFadeDuration3 = 1

// Specify the image files
// =======================================
// Duplicate This Part For New Slice

var Pic3 = new Array() // don't touch this

Pic3[0] = 'img/tri-img-left1.jpg'
Pic3[1] = 'img/tri-img-left2.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t3
var j3 = 0
var p3 = Pic3.length

var preLoad3 = new Array()
for (i = 0; i < p3; i++){
preLoad3[i] = new Image()
preLoad3[i].src = Pic3[i]
}

function runSlideShow3(){
if (document.all){
document.SlideShow3.style.filter="blendTrans(duration=2)"
document.SlideShow3.style.filter="blendTrans(duration=crossFadeDuration3)"
document.SlideShow3.filters.blendTrans.Apply() 
}
document.SlideShow3.src = preLoad3[j3].src
if (document.all){
document.SlideShow3.filters.blendTrans.Play()
}
j3 = j3 + 1
if (j3 > (p3-1)) j3=0
t3 = setTimeout('runSlideShow3()', slideShowSpeed3)

}


////////////// slideshow 4 tri-img centre ///////////////

// Set slideShowSpeed (milliseconds)
var slideShowSpeed4 = 3500

// Duration of crossfade (seconds)
var crossFadeDuration4 = 1

// Specify the image files
// =======================================
// Duplicate This Part For New Slice

var Pic4 = new Array() // don't touch this

Pic4[0] = 'img/tri-img-centre1.jpg'
Pic4[1] = 'img/tri-img-centre2.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t4
var j4 = 0
var p4 = Pic4.length

var preLoad4 = new Array()
for (i = 0; i < p4; i++){
preLoad4[i] = new Image()
preLoad4[i].src = Pic4[i]
}

function runSlideShow4(){
if (document.all){
document.SlideShow4.style.filter="blendTrans(duration=2)"
document.SlideShow4.style.filter="blendTrans(duration=crossFadeDuration4)"
document.SlideShow4.filters.blendTrans.Apply() 
}
document.SlideShow4.src = preLoad4[j4].src
if (document.all){
document.SlideShow4.filters.blendTrans.Play()
}
j4 = j4 + 1
if (j4 > (p4-1)) j4=0
t4 = setTimeout('runSlideShow4()', slideShowSpeed4)

}

////////////// slideshow 5 tri-img right ///////////////

// Set slideShowSpeed (milliseconds)
var slideShowSpeed5 = 3500

// Duration of crossfade (seconds)
var crossFadeDuration5 = 1

// Specify the image files
// =======================================
// Duplicate This Part For New Slice

var Pic5 = new Array() // don't touch this

Pic5[0] = 'img/tri-img-right1.jpg'
Pic5[1] = 'img/tri-img-right2.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t5
var j5 = 0
var p5 = Pic5.length

var preLoad5 = new Array()
for (i = 0; i < p5; i++){
preLoad5[i] = new Image()
preLoad5[i].src = Pic5[i]
}

function runSlideShow5(){
if (document.all){
document.SlideShow5.style.filter="blendTrans(duration=2)"
document.SlideShow5.style.filter="blendTrans(duration=crossFadeDuration5)"
document.SlideShow5.filters.blendTrans.Apply() 
}
document.SlideShow5.src = preLoad5[j5].src
if (document.all){
document.SlideShow5.filters.blendTrans.Play()
}
j5 = j5 + 1
if (j5 > (p5-1)) j5=0
t5 = setTimeout('runSlideShow5()', slideShowSpeed5)

}

/////  Gallery Page ///////

function showCaption(ImgName){
	clearCaption();
	
	if (ImgName == "img1") {
		document.getElementById("caption1").style.display = "block";
	}else if (ImgName == "img2") { 
		document.getElementById("caption2").style.display = "block";
	}else if (ImgName == "img3") {
		document.getElementById("caption3").style.display = "block";
	}else if (ImgName == "img4") {
		document.getElementById("caption4").style.display = "block";
	}else if (ImgName == "img5") {
		document.getElementById("caption5").style.display = "block";
	}else if (ImgName == "img6") {
		document.getElementById("caption6").style.display = "block";
	}else if (ImgName == "img7") {
		document.getElementById("caption7").style.display = "block";
	}else if (ImgName == "img8") {
		document.getElementById("caption8").style.display = "block";
	}
}

function clearCaption() {
	document.getElementById("caption1").style.display = "none";
	document.getElementById("caption2").style.display = "none";
	document.getElementById("caption3").style.display = "none";
	document.getElementById("caption4").style.display = "none";
	document.getElementById("caption5").style.display = "none";
	document.getElementById("caption6").style.display = "none";
	document.getElementById("caption7").style.display = "none";
	document.getElementById("caption8").style.display = "none";
}