﻿var i = 0; 
var slideSpeed = 7777;
var banners = new Array();
var cnCaptions = new Array();
var enCaptions = new Array(); 
var prefix = '<span style="color:#FF0">&#171;'; 
banners[0] = 'Images/bamboo.jpg';
banners[1] = 'Images/girls.jpg';
banners[2] = 'Images/lily.jpg';
banners[3] = 'Images/pull.jpg';
banners[4] = 'Images/congregation.jpg';

cnCaptions[0] = prefix + '罗马书一章廿节&#187;</span> 自从造天地以来，神的永能和神性是明明可知的，虽是眼不能见，但藉着所造之物，就可以晓得，叫人无可推诿';
cnCaptions[1] = prefix + '诗篇一百篇一二节&#187;</span> 普天下当向耶和华欢呼！你们当乐意事奉耶和华，当来向他歌唱！';
cnCaptions[2] = prefix + '雅歌二章一节&#187;</span> 我是沙仑的玫瑰花，是谷中的百合花';
cnCaptions[3] = prefix + '路加福音十八章十六节&#187;</span> 让小孩子到我这里来，不要禁止他们, 因为在神国的正是这样的人';
cnCaptions[4] = prefix + '约翰福音四章廿三节&#187;</span> 那真正拜父的，要用心灵和诚实拜他， 因为父要这样的人拜他';

enCaptions[0] = prefix + 'Romans 1:20&#187;</span> For since the creation of the world God\'s invisible qualities—his eternal power and divine nature—have been clearly seen, being understood from what has been made, so that men are without excuse';
enCaptions[1] = prefix + 'Psalms 100:1-2&#187;</span> Shout for joy to the Lord, all the earth. Worship the Lord with gladness; come before him with joyful songs.';
enCaptions[2] = prefix + 'Song of Solomon 2:1 11:9&#187;</span> I am a rose of Sharon, a lily of the valleys';
enCaptions[3] = prefix + 'Luke 18:16&#187;</span> Let the children come to me. Don’t stop them! For the Kingdom of God belongs to those who are like these children.';
enCaptions[4] = prefix + 'John 4:23&#187;</span> True worshipers will worship the Father in spirit and truth, for they are the kind of worshipers the Father seeks';

function loadBanner (){
	document.images.bannerContainer.src = banners[i];
	if (typeof langPref != undefined && langPref == "English") {
		document.getElementById('bannerCaption').innerHTML = enCaptions[i];
	} else {
	 document.getElementById('bannerCaption').innerHTML = cnCaptions[i];
	}
}

function slideBanner() {
	if (document.getElementById('bannerContainer')) {
		loadBanner();
		if (++i >= banners.length) {
			i = 0;
		}
	} else {
	 slideSpeed = 7777777;
	}
	setTimeout('slideBanner()', slideSpeed);
}

function prev() {
 stop();
 if (i-- <= 0) {
  i = banners.length - 1;
 }
 loadBanner(); 
}

function stop() {
 slideSpeed = 7777777; 
 setTimeout('slideBanner()', slideSpeed);
}

function next() {
 stop();
 if (++i >= banners.length) {
  i = 0;
 }
 loadBanner(); 
}