// global events
window.addEvent('domready', function(){

	/* ------ instantiate tooltips for items that have a class of 'tip' and a respective 'title' attribute ----- */
	var tip = new Tips($$('.tip'), {
		initialize:function() {
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 250, wait: false}).set(0);
		},
		onShow: function(toolTip) {
			this.fx.start(.9);
		},
		onHide: function(toolTip) {
			this.fx.start(0);
		},
		className: 'tooltip',
		offsets: {'x': 25, 'y': -22}
	});


	var photoSlide = new Fx.Slide('photo-drawer');
	
	photoSlide.slideIn();
			
	$E('#photo-nav a').addEvent('click', function(e) {
		e = new Event(e);
		
		photoSlide.toggle();
		
		if ($('drawer-wrap').getStyle('z-index').toInt() > 0) {
 			$('drawer-wrap').setStyle('z-index', '-1');
 		} else {
 			$('drawer-wrap').setStyle('z-index', '1');
 		}
 		
		e.stop();
	});
	
}); 

function loadrandomheader(divID) {
	
	var imgqty = 39; // quantity of header images
	var imgpath = "/bg-photos/"; // path to header photos
	var imgbase = "photo"; // base name of photos
	var imgnum = Math.round(Math.random()*(imgqty - 1)) + 1;
	var imgextension = ".jpg"; // file ext
	
	$(divID).setHTML('<img src="'+imgpath + imgbase + imgnum + imgextension+'" border="0" alt="spring hill">'); // spit out image into selected div

}