 /**
 * Event View Javascript
 * @author Scott Murphy
 * 
 * Copyright (c) 2008 Pictage Inc.
 * ALL RIGHTS RESERVED
 */

/* 
window.addEvent('domready', function() {
if ( !Browser.Engine.trident && !Browser.Engine.gecko ) {
	alert('You are using an unsupported browser '+Browser.Engine.name+'.\n'+
			'This version of the site currently supports:\n'+
			'Internet Explore 6 or greater\n'+
			'Mozilla Firefox (Any version)');
	window.location='/photodisplay/PHOTODISPLAY/get_event_info.xml?producer=photodisplay&event=EVV1:'+eventId+'&detail=minimal&xsl=/xsl/pdconsumer/event_frames.xsl&error_xsl=/xsl/pdconsumer/error.xsl&title='+eventTitle+'&realname='+userName;
}
});
*/

var contextMenu;
window.addEvent("domready", function() {
	contextMenu = new ContextMenu({
		selector : 'img.imgCover',
 		menu : [{text:'Photo available for purchase.', action: function() {} }]
	});
	rotate( 3000, $$('#adCanvasSingle a') );
});

function rotate( duration, list ) {
	if ( !$defined(list) || ( list.length == 0 ) )
		return;
	if ( list.length == 1 )
		list[0].setStyle('display','block');
	else
		rotateAds.periodical( duration, list);
}

function rotateAds() {
	if (!$defined(this.index))
		this.index = 0;
	this[this.index++].setStyle('display','none');
	if ( this.index >= this.length )
		this.index = 0;
	this[this.index].setStyle('display','block');
}
