﻿///////////////////////////////////////////////////////////
/// Magic Image Rotation								///
///	v 1.0.1												///
/// Copyright 2007, Loyce Bradley Petrey				///
///	All Rights Reserved.								///
/// http://www.EchoChrist.com/MagicImage				///
/// webmaster@EchoChrist.com							///
///														///
///	This script is free to use as long as this notice 	///
/// remains unchanged and intact.					 	///
///														///
/// This program is free software: you can redistribute ///
///	it and/or modify it under the terms of the GNU 		///
///	General Public License as published by the Free 	///
///	Software Foundation. 								///
///														///
/// This program is distributed in the hope that it 	///
/// will be useful, but WITHOUT ANY WARRANTY; without 	///
///	even the implied warranty of MERCHANTABILITY or 	///
///	FITNESS FOR A PARTICULAR PURPOSE.  					///
/// 													///
/// Be Imitators of God as dear children and walk		///
/// in love as Christ also loved us.					///
///	Ephesians 5:1-2										///
///////////////////////////////////////////////////////////

var ImageLoad1 = 
[
['http://marquisbuilders.com/', 	'graphics/Marquis.jpg', 	''			],		//  Add as many images as you like seperated by commmas					//
['http://www.bank-northwest.com/', 	'graphics/northwestbank.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://www.farmersagent.com/ljohnson/', 	'graphics/Farmersweb.jpg', 	''  		],		//  Almost ALL errors are caused by the url or path being wrong 	//	
['http://www.rbcfc.com/rooneylambgroup/', 	'graphics/rooney.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://www.fbfs.com/', 	'graphics/toddmiller.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://www.trashout.com/', 	'graphics/trashout.jpg', 	''			],		//  The LAST image declaration does NOT have a comma after it			//
['#', 	'graphics/americanrestoration.jpg', 	''			],		//  ['URL to linked page', 'URL to image', 'Caption under picture']	//
['http://www.fbfs.com/', 	'graphics/farbbureau.jpg', 	''		],		//  The caption is not required and may be left blank like this:		//
['http://jgwille.iowarealty.com/', 	'graphics/gratias.jpg', 	''	],		//  ['URL to linked page', 'URL to image', '']							//
['http://www.spiritboulevard.com/', 	'graphics/Spirit_Blvd.jpg', 	''				]		//  Almost ALL errors are caused by the url or path being wrong 	//
];

var ImageCount1		= 10;			//  *****  Change this to the total number of images loaded above  ***** 		//	
var ImageDelay1		= 5000;			//  *****  Set this to the delay interval desired.  5000 = 5 seconds.			// 
var LinkTarget1		= "_self"		//  *****  Defines where you want linked page to open. _self, _blank, _top, etc	//
var ImageIndex1		= 0;			//  DO NOT ALTER	//
var FirstLoad1		= 0;			//  DO NOT ALTER	//
var QuickStartID1 	= 0;  			//  DO NOT ALTER	//
var htmlString1 		= ""			//  DO NOT ALTER 	//

//  This function rotates the banner  //
function ImageChange1()

{		

htmlString1 = '<center>';
htmlString1 = htmlString1 + '<font face = "Verdana" size="2">';		//  Font and Font Size for caption may be changed here	//
htmlString1 = htmlString1 +'<a target="blank"';
htmlString1 = htmlString1 + LinkTarget1;
htmlString1 = htmlString1 + '" href="';
htmlString1 = htmlString1 + ImageLoad1[ImageIndex1][0];
htmlString1 = htmlString1 + '"><img border="0" src="';				//  Image border size may be changed here				//	
htmlString1 = htmlString1 + ImageLoad1[ImageIndex1][1];
htmlString1 = htmlString1 + '"></a><br>';
htmlString1 = htmlString1 + ImageLoad1[ImageIndex1][2];
htmlString1 = htmlString1 + '</font>';
htmlString1 = htmlString1 + '</center>';		

document.getElementById('MagicImage1').innerHTML = htmlString1 				

if(ImageIndex1 == ImageCount1 - 1)		//  This statement increments image displayed and resets if displaying last image  //
{										
ImageIndex1= 0;																				
}																								
else																							
{																								
ImageIndex1++;																					
}																										

if(FirstLoad1 == 0)						//  Determins if this is the first time function has run.   // 
{
SlowFinish1();
}

}
//  End Funtion  //

//  This function ensures first banner is displayted without a delay  //
function  QuickStart1()
{
QuickStartID1=setInterval("ImageChange1()", 1000);
}
//  End Funtion  //																		

//  This function sets display rate to user defined speed  //
function SlowFinish1()
{
clearInterval(QuickStartID1);
FirstLoad1 = 1;
setInterval("ImageChange1()", ImageDelay1);	 
}
//  End Funtion  //

QuickStart1()
