var photo_div = new Array("photoframe1", "photoframe2", "photoframe3", "photoframe4", "photoframe5" ,"photoframe6") ;
var photo_num = 1 ;
var last = 0;
var u ;
var duration = 5 ;

function control() {

if (photo_num < photo_div.length) 
{
showphoto(photo_div[photo_num]);
last = photo_num;
photo_num++ ;
u = setTimeout("control()", duration * 1000) ;
} else {
photo_num=0 ;
control();}
}


var lastelement;
lastelement = "none";

function showphoto(elmnt) {

  if (lastelement == elmnt) {} else

        {
        if (lastelement == "none") {
	fadeout.fade("photoframe1");
	document.getElementById(elmnt).style.opacity="0";
        document.getElementById(elmnt).style.filter="alpha(opacity:0)";
        document.getElementById(elmnt).style.visibility="visible";
        fadein.fade(elmnt);
        lastelement = elmnt;
        } else {
        fadeout.fade(lastelement);
        document.getElementById(elmnt).style.opacity="0";
        document.getElementById(elmnt).style.filter="alpha(opacity:0)";
        document.getElementById(elmnt).style.visibility="visible";
        fadein.fade(elmnt);
        lastelement = elmnt;
        }
        }
  }
