var strWebsite = "http://www.4gloriousgifts.com";

var random_display = 1; // 0 = no, 1 = yes

//News Images
var image_index_news = 0;
image_list_news = new Array();

image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/1.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/2.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/3.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/4.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/5.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/6.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/7.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/8.jpg");
image_list_news[image_index_news++] = new imageItem(strWebsite+"/images/welcome_latestnews/9.jpg");

var number_of_image_news = image_list_news.length;

//Quotes Images
var image_index_quotes = 0;
image_list_quotes = new Array();

image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_always.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_angel.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_blessed.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_Bliss.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_circleoflove.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_creation.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_Discovery.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_faith.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_grace.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_healingtouch.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_heart.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_heaven.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_holyname.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_hope.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_joy.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_meditation.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_memories.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_MichaelDumlao.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_miracle.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_mylove.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_mystery.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_onepeace.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_paths.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_patience.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_peace.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_pilgrimage.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_praise.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_prayers.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_promises.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_serenity.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_smallgifts.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_tendergarden.gif")
image_list_quotes[image_index_quotes++] = new imageItem(strWebsite+"/images/welcome_quotes/quote_time.gif")

var number_of_image_quotes = image_list_quotes.length;

function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}

function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}

function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}

function getNextImageNews() {
if (random_display) {
image_index_news = generate(0, number_of_image_news-1);;
}
else {
image_index_news = (image_index_news+1) % number_of_image_news;
}
var new_image = get_ImageItemLocation(image_list_news[image_index_news]); 
return(new_image);
}

function rotateImageNews(place) {
var new_image = getNextImageNews();
document[place].src = new_image;
var recur_call = "rotateImageNews('"+place+"')";
}

function getNextImageQuotes() {
if (random_display) {
image_index_quotes = generate(0, number_of_image_quotes-1);
}
else {
image_index_quotes = (image_index_quotes+1) % number_of_image_quotes;
}
var new_image = get_ImageItemLocation(image_list_quotes[image_index_quotes]); 
return(new_image);
}

function rotateImageQuotes(place) {
var new_image = getNextImageQuotes();
document[place].src = new_image;
var recur_call = "rotateImageNews('"+place+"')";
}