

//

//
var memorialsList=new Array();
memorialsList[memorialsList.length]={
	id: '99',
	name: 'Tony McCreadie',
	birthdate: '6 Oct 1967',
	crash_date: '18 Oct 2003',
	icon: 'rose1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '751',
	name: 'Iain Stuart Macpherson',
	birthdate: '11 Oct 1974',
	crash_date: '29 May 2004',
	icon: 'none',
	photo: 'phpnsv4wm.jpg'
};

memorialsList[memorialsList.length]={
	id: '344',
	name: 'Ian David Phillips',
	birthdate: '',
	crash_date: '31 Oct 1994',
	icon: 'symbol_1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '1142',
	name: 'Paul David Andrews',
	birthdate: '8 May 1982',
	crash_date: '18 Aug 2000',
	icon: 'symbol_1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '1220',
	name: 'Stuart',
	birthdate: '17 Apr 1983',
	crash_date: '13 Sep 2003',
	icon: 'rose1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '1229',
	name: 'Andrew Martin',
	birthdate: '5 Dec 1965',
	crash_date: '11 Sep 1984',
	icon: 'symbol_1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '880',
	name: 'Sam Neal',
	birthdate: '13 Jan 1983',
	crash_date: '16 Aug 2003',
	icon: 'rose1.gif',
	photo: 'phpJoBwQL.jpg'
};

memorialsList[memorialsList.length]={
	id: '818',
	name: 'Stuart Styzaker',
	birthdate: '7 Jan 1983',
	crash_date: '2 Aug 2006',
	icon: 'bunch2.gif',
	photo: 'phpAiSd0M.jpg'
};

memorialsList[memorialsList.length]={
	id: '1383',
	name: 'gary wallace',
	birthdate: '29 Oct 1983',
	crash_date: '23 Aug 2003',
	icon: 'symbol_1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '296',
	name: 'Adam Palmer',
	birthdate: '',
	crash_date: '18 Oct 2003',
	icon: 'rose1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '1238',
	name: 'Emily Louise Johnson',
	birthdate: '28 Nov 1988',
	crash_date: '9 Apr 2007',
	icon: 'symbol_1.gif',
	photo: 'phpwWB2Bp.jpg'
};

memorialsList[memorialsList.length]={
	id: '1157',
	name: 'Michael Dunn',
	birthdate: '20 Dec 1974',
	crash_date: '2 Jan 2007',
	icon: 'rose1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '651',
	name: 'Louise Benn',
	birthdate: '18 May 1983',
	crash_date: '10 Apr 2006',
	icon: 'rose1.gif',
	photo: 'phpRfjirS.jpg'
};

memorialsList[memorialsList.length]={
	id: '1047',
	name: 'mark archbold',
	birthdate: '14 Jan 1981',
	crash_date: '30 Aug 2003',
	icon: 'symbol_1.gif',
	photo: ''
};

memorialsList[memorialsList.length]={
	id: '215',
	name: 'Graham Mayer Cooper',
	birthdate: '',
	crash_date: '19 Oct 2003',
	icon: 'symbol_1.gif',
	photo: 'phpDbRTuV'
};



if(document.write){
	document.open();
	document.write('<div id="memorialslidebanner"><div class="first">'+makeMarkup(memorialsList[0])+'</div><div>'+makeMarkup(memorialsList[1])+'</div></div>');
	document.close();
}else{ /* consider XHTML alternative here */ }

var imageIndex=2,slideShowBannerElements=[];


function imageChanger(){
      var interval;
      if(!slideShowBannerElements.length){
	slideShowBannerElements.push(document.getElementById('memorialslidebanner').childNodes[0]);
	slideShowBannerElements.push(document.getElementById('memorialslidebanner').childNodes[1]);
      }
      if(!slideShowBannerElements[0]){return;}
      slideShowBannerElements[0].style.opacity=1;
      var fadeDirection=0;
      var fader=function(){
		if( fadeDirection==0 && slideShowBannerElements[0].style.opacity<=0 ){ // finished fading out
			if(slideShowBannerElements[0].innerHTML){
				slideShowBannerElements[0].innerHTML=makeMarkup(memorialsList[imageIndex]);
			}else if(slideShowBannerElements[0].replaceChild){
				slideShowBannerElements[0].replaceChild( makeDOM(memorialsList[imageIndex]), slideShowBannerElements[0].childNodes[0] );
			}
			imageIndex++;
			fadeDirection=1;
		}else{ //still fading
			slideShowBannerElements[0].style.opacity = (fadeDirection==0) ? parseFloat(slideShowBannerElements[0].style.opacity)-.2 : parseFloat(slideShowBannerElements[0].style.opacity)+.2;
			if(document.body && document.body.filters){
				// width and height must be explicit
				slideShowBannerElements[0].style.height=slideShowBannerElements[0].offsetHeight+'px';
				slideShowBannerElements[0].style.width=slideShowBannerElements[0].offsetWidth+'px';
				slideShowBannerElements[0].style.filter = 'alpha(opacity='+(slideShowBannerElements[0].style.opacity*100)+');';
				//window.status='alpha(opacity='+(slideShowBannerElements[0].style.opacity*100)+');';
			}
			if( fadeDirection==1 && slideShowBannerElements[0].style.opacity>=.99 ){ // finished fading in
				fadeDirection=0;
				slideShowBannerElements.push(slideShowBannerElements.shift());
				clearInterval(interval);
				setTimeout(imageChanger, 2000);
			}
		}
	}
      var interval=setInterval( fader, 180 );
      if( imageIndex && imageIndex>memorialsList.length-1){imageIndex=0;}
}
  
  
if(document.createElement && document.getElementsByTagName){
	setTimeout(imageChanger, 1000);
}



function makeDOM( vObject ){
	var parent=document.createElement('div');
	//parent.appendChild(document.createTextNode('We remember...'))
	//parent.appendChild(document.createElement('br'));
	parent=parent.appendChild(document.createElement('a'));
	parent.href='http://www.roadpeace.org/internetmemorials/memorial.php?show='+vObject['id'];
	if(vObject['icon']&&vObject['icon']!='none'){
		parent.appendChild(document.createElement('img')).src='http://www.roadpeace.org/internetmemorials/symbols/'+vObject['icon'];
		parent.lastChild.align='left';
	}
	parent.appendChild(document.createElement('br'));
	parent.appendChild(document.createElement('b')).appendChild(document.createTextNode(vObject['name']+', '));
	parent.appendChild(document.createElement('br'));
/*	if(vObject['birthdate']){
		parent.appendChild(document.createTextNode('born '));
		parent.appendChild(document.createElement('b')).appendChild(document.createTextNode( vObject['birthdate'] +', '));
		parent.appendChild(document.createTextNode(', '));
	}*/
	parent.appendChild(document.createTextNode('victim of crash on '));
	parent.appendChild(document.createElement('b')).appendChild(document.createTextNode( vObject['crash_date'] +', '));
	return parent;
}
function makeMarkup( vObject ){
	var markup='<a href="http://www.roadpeace.org/internetmemorials/memorial.php?show='+vObject['id'] +'">';
	markup+=( vObject['icon'] &&vObject['icon']!='none'   ) ? '<img src="http://www.roadpeace.org/internetmemorials/symbols/'+vObject['icon']+'" alt="icon" border="0" align="left">' : '';
	markup+='<br><b>'+vObject['name'] +'</b>,<br> ';
//	markup+=(vObject['birthdate']) ? 'born <b>'+vObject['birthdate'] +'</b>, ' : '';
	markup+='victim of crash on <b>'+vObject['crash_date'] +'</b>';
	markup+='</a>';
	return markup;
}
