
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];}
}

gSlideshowInterval = 14;
gNumberOfImages = 7;

gImages = new Array(gNumberOfImages);

gImages[1] = "images/heartquotepeople/Albert-Einstein.jpg";
gImages[4] = "images/frontpage_aristotole.jpg";
gImages[0] = "images/heartquotepeople/bob_hope.jpg";
gImages[2] = "images/heartquotepeople/shakespeare.jpg";
gImages[3] = "images/frontpage_freud.jpg";
gImages[5] = "images/frontpage_carljung.jpg";
gImages[6] = "images/frontpage_plato.jpg";

gText = new Array(gNumberOfImages);
gText[1] = "\" Few are those who can see with their own eyes and feel with their own hearts.<span style='margin-left:0.4em'>\"</span><br><br>~ Albert Einstein";
gText[4] = "\" Educating the mind without educating the heart is no education at all.<span style='margin-left:0.4em'>\"</span> <br><br>~ Aristotle";
gText[0] = "\" If you haven't any charity in your heart, you have the worst kind of heart trouble.<span style='margin-left:0.2em'>\"</span> <br><br>~ Bob Hope";
gText[2] = "\" Who could refrain that had a heart to love and in that heart courage to make love known?<span style='margin-left:0.4em'>\"</span> <br><br>~ William Shakespeare";
gText[3] = "\" In the small matters trust the mind, in the large ones the heart.<span style='margin-left:0.4em'>\"</span> <br><br>~ Sigmund Freud";  
gText[5] = "\" Your vision will become clear only when you look into your heart ... Who looks outside, dreams. Who looks inside, awakens.<span style='margin-left:0.4em'>\"</span><br>~ Carl Jung";
gText[6] = "\" Every heart sings a song, incomplete, until another heart whispers back. Those who wish to sing always find a song. At the touch of a lover, everyone becomes a poet.<span style='margin-left:0.4em'>\"</span>~ Plato";


function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}

function loadHTML(htmlquote){
    if (gImageCapableBrowser) {
		document.getElementById("quote").innerHTML = htmlquote;		
		return false;
	}
	else {
		return true;
	}
}

function loadSlide(imageURL) {
	if (gImageCapableBrowser) {
		document.slide.src = imageURL;
		return false;
	}
	else {
		return true;
	}
}
function nextSlide() {
	gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
	loadSlide(gImages[gCurrentImage]);
	loadHTML(gText[gCurrentImage]);
}
gImageCapableBrowser = canManipulateImages();
gCurrentImage = 0;
setInterval("nextSlide()",gSlideshowInterval * 1000);
