// select new photo at top of page with each page load
var arrPhotos = new Array('lightbulb.jpg','pic01.jpg','pic08.jpg','pic11.jpg','pic02.jpg','pic03.jpg','pic05.jpg','pic12.jpg','pic07.jpg','pic10.jpg','pic13.jpg');
var arrCaptions = new Array('At The Event Planning Group, our bright ideas help shape your event for success.',
							'2006 Symposium on Cocoa for the University of California, Davis and Mars, Inc.',
							'Our professional purpose is entirely geared toward making your event the best it can be.',
							'We can provide key services to make your event unlock its full potential.',
							'Employee ROI Executive Symposium for Women Business Leaders',
							'Putting together memorable events, from start to finish',
							'The Event Planning Group oversees every detail of your event.',
							'We do the research and planning that will guarantee quality use of the time spent at your next event.',
							'The Event Planning Group ensures your experiences are memorable ones.',
							'Our partnership will help make a big splash with your clients and smooth the ripples of their projects.',
							'We can help turn your special event into a golden one that will not be forgotten.');
var imagePath = "/_assets/images/header_photos/";
var nextNumber = readCookie('nextNumber');

if (nextNumber == null){
	nextNumber = 0;
} else {
	nextNumber++;
	if (nextNumber >= arrPhotos.length) {
		nextNumber = 0;
	}
}

createCookie('nextNumber', nextNumber,0);

var imgTag = '<img src="'+imagePath+arrPhotos[nextNumber]+'" width="588" height="105" alt="Photo: '+arrCaptions[nextNumber]+'" />'

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}