
// JavaScript Document

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 



var c=0
var s
function photoGallery()
{
if (c%6==0){
c=0;
document.getElementById('photo-gallery').src = "images/home 1.jpg";
}
if (c%6==1){
document.getElementById('photo-gallery').src = "images/home 2.jpg";
}
if (c%6==2){
document.getElementById('photo-gallery').src = "images/home 3.jpg";
}
if (c%6==3){
document.getElementById('photo-gallery').src = "images/home 4.jpg";
}
if (c%6==4){
document.getElementById('photo-gallery').src = "images/home 5.jpg";
}
if (c%6==5){
document.getElementById('photo-gallery').src = "images/home 6.jpg";
}
c=c+1;
opacity('photo-gallery',100,50,1500);
s=setTimeout("photoGallery()",3000);
opacity('photo-gallery',50,100,1500);

}
function start() {
  photoGallery();
}
window.onload = start;
