
function buyIt(e) {
	myLightWindow.activateWindow({
		href: 'pages/purchase.html', 
		title: 'Purchase The Book', 
		width: '380px',
		height: '200px'
	});
	Event.stop(e);
}

Event.observe(window, 'load', function() {
	curpage = document.location.href.toQueryParams().page;
	if (curpage == undefined) { curpage = 'home'; }
	$$('#nav a img').each(function(el){
		Event.observe(el, 'mouseover', function(evt){
			Event.element(evt).src = Event.element(evt).src.replace('std', 'hov');
		});
		Event.observe(el, 'mouseout', function(evt){
			Event.element(evt).src = Event.element(evt).src.replace('hov', 'std');
		});
		if ('link_' + curpage == el.id) {
			el.setStyle({borderBottom:'2px solid #fc0', paddingBottom:'0px'});
		}
	});
	$$('.purchase').each(function(e){
		Event.observe(e, 'click', buyIt);
	});
	$$('.quote').each(function(e){
		Event.observe(e, 'click', function(){
			location.href='?page=press';
		});
	});
		
	
});

