function rotatePhoto()
{	var myRequest = new Request({method:'get', url:'photo.cfc'});
	myRequest.send('method=rotatephoto');
	myRequest.addEvent('success', function(responseText)
	{	var ActionScriptQuery;
		var photo = $('photo');
		eval(responseText);
		photo.set('href','gallery.cfm?id='+ActionScriptQuery[0]['image_id']);
		photo.set('title',ActionScriptQuery[0]['caption']);
		photo.set('morph',{duration:1000});
		photo.morph(
		{	'background-image':'none',
			'opacity':[1,0]
		});
		photo.morph(
		{	'opacity':[0,1],
			'background-image':'url(images/gallery/400x300/'+escape(ActionScriptQuery[0]['filename'])+')'
		});
	});
	setTimeout('rotatePhoto()', 5000);
}

window.addEvent('domready', function()
{	var a = new Element('a',
	{	'id':'photo',
		'href':'gallery.cfm',
		'styles':
		{	'width':400,
			'height':300,
			'display':'block',
			'background-repeat':'no-repeat'
		}
	});
	a.inject($('photoframe'));
	rotatePhoto();
});
