///////////////////////////////////////////////////////////
/// 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 ImageLoad = 
[
['http://texassurfers.com/surf-articles/surfing/a-christmas-swell-for-galveston-tx/', 	'http://www.texassurfers.com/i/rotation/a-christmas-swell-for-galveston-texas.gif', 	''			],
['http://texassurfers.com/surf-articles/surfing/what-to-wear-during-winter-surfing/', 	'http://www.texassurfers.com/i/rotation/winter-surfing-wear.gif', 	''			],					//
['http://texassurfers.com/surf-articles/surf-wax/sex-wax-sculptures/', 	'http://www.texassurfers.com/i/rotation/sex-wax-sculptures.gif', 	''			],					//
// ['http://texassurfers.com/surf-articles/surfing/texas-tanker-surfing/', 	'http://www.texassurfers.com/i/rotation/3.jpg', 	''			],					//
['http://texassurfers.com/surf-articles/surfing/surf-while-talking-on-your-waterproof-cell-phone/', 	'http://www.texassurfers.com/i/rotation/8.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
// ['http://texassurfers.com/surf-articles/surf-comedy/surfing-dogs/', 	'http://www.texassurfers.com/i/rotation/1.gif', 	''		],	
// ['http://texassurfers.com/surf-articles/surfing/surfer-survives-14-hours-at-sea-surfside-tx/', 	'http://www.texassurfers.com/i/rotation/2.gif', 	''	],							
// ['http://texassurfers.com/surf-articles/surfing/how-surfboard-shaping-machines-work/', 	'http://www.texassurfers.com/i/rotation/4.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
// ['http://texassurfers.com/surf-articles/surfing/vodka-and-jelly-fish-sounds-good-to-me/', 	'http://www.texassurfers.com/i/rotation/5.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/shark-attacks/send-a-sandcastle/', 	'http://www.texassurfers.com/i/rotation/6.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
// ['http://texassurfers.com/surf-articles/surfing/clay-marzo-surfing-with-aspergers-syndrome/', 	'http://www.texassurfers.com/i/rotation/7.gif', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/surfer-catches-on-fire/', 	'http://www.texassurfers.com/i/rotation/surfer-on-fire.gif', 	''			],		//  ['URL to linked page', 'URL to image', 'Caption under picture']	//
['http://texassurfers.com/surf-articles/surfing/sell-stuff-on-the-beach-life-for-sale-board/', 	'http://www.texassurfers.com/i/rotation/9.gif', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/dynamite-surfing-quicksilver-stunt/', 	'http://www.texassurfers.com/i/rotation/10.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing-records/worlds-longest-surfboard/', 	'http://www.texassurfers.com/i/rotation/11.jpg.', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/50-foot-waves-cause-big-wipeouts/', 	'http://www.texassurfers.com/i/rotation/12.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/surfer-pegs-carry-surfboards-on-motorcyles/', 	'http://www.texassurfers.com/i/rotation/13.gif', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/check-out-this-surfboard-fence/', 	'http://www.texassurfers.com/i/rotation/14.gif', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/surfer-with-no-legs/', 	'http://www.texassurfers.com/i/rotation/15.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/talk-about-consistency-where-the-surf-never-stops/', 	'http://www.texassurfers.com/i/rotation/16.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/pulling-out-a-shark-tooth-hurts/', 	'http://www.texassurfers.com/i/rotation/17.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surf-comedy/talk-about-a-major-surf-rat/', 	'http://www.texassurfers.com/i/rotation/18.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfboard-care/poor-dude-crushes-all-his-surfboards/', 	'http://www.texassurfers.com/i/rotation/19.jpg', 	''				],		//  Almost ALL errors are caused by the url or path being wrong 		//
['http://texassurfers.com/surf-articles/surfing/surfer-riding-a-tsunami/', 	'http://www.texassurfers.com/i/rotation/20.jpg', 	''			]		//  The LAST image declaration does NOT have a comma after it			//
];


var ImageCount		= 22;			//  *****  Change this to the total number of images loaded above  ***** 		//	
var ImageDelay		= 30000;			//  *****  Set this to the delay interval desired.  5000 = 5 seconds.			// 
var LinkTarget		= "_self"		//  *****  Defines where you want linked page to open. _self, _blank, _top, etc	//
var ImageIndex		= 0;			//  DO NOT ALTER	//
var FirstLoad 		= 0;			//  DO NOT ALTER	//
var QuickStartID 	= 0;  			//  DO NOT ALTER	//
var htmlString 		= ""			//  DO NOT ALTER 	//
var randomnumber	= 0;			//  DO NOT ALTER	//

//  This function rotates the banner  //
function ImageChange()

{		

htmlString = '<center>';
htmlString = htmlString + '<font face = "Verdana" size="2">';		//  Font and Font Size for caption may be changed here	//
htmlString = htmlString +'<a target="';
htmlString = htmlString + LinkTarget;
htmlString = htmlString + '" href="';
htmlString = htmlString + ImageLoad[ImageIndex][0];
htmlString = htmlString + '"><img border="0" src="';				//  Image border size may be changed here				//	
htmlString = htmlString + ImageLoad[ImageIndex][1];
htmlString = htmlString + '"></a><br>';
htmlString = htmlString + ImageLoad[ImageIndex][2];
htmlString = htmlString + '</font>';
htmlString = htmlString + '</center>';		

document.getElementById('MagicImage').innerHTML = htmlString; 				

ImageIndex = Math.floor(Math.random()*ImageCount);																				

if(FirstLoad == 0)						//  Determins if this is the first time function has run.   // 
{
SlowFinish();
}

}
//  End Funtion  //

//  This function ensures first banner is displayted without a delay  //
function  QuickStart()
{
QuickStartID=setInterval("ImageChange()", 1000);
}
//  End Funtion  //																		

//  This function sets display rate to user defined speed  //
function SlowFinish()
{
clearInterval(QuickStartID);
FirstLoad = 1;
setInterval("ImageChange()", ImageDelay);	 
}
//  End Funtion  //

QuickStart()