// JavaScript Document

// When loaded, get ready for events.
document.observe('dom:loaded', function() {
	$('cms_intro').observe('click', showIntro);
	$('cms_news').observe('click', showNews);
	$('cms_commission').observe('click', showCommission);
	$('cms_contact').observe('click', showContact);
});


// CMS Functions (Show Edit Boxes)
function showIntro(event) {
	Event.stop(event);
	Lightview.show({
		href: 'app/cms.php?id=1',
		rel: 'iframe',
		options: {
			autosize: true,
			topclose: true,
			ajax: {
				onComplete: function(){
				// once the request is complete we observe the form for a submit
				$('ajaxForm').observe('submit', submitStuff);
				}
			}
		}
	});
}

function showNews(event) {
	Event.stop(event);
	Lightview.show({
		href: 'app/cms.php?id=2',
		rel: 'iframe',
		options: {
			autosize: true,
			topclose: true,
			ajax: {
				onComplete: function(){
				// once the request is complete we observe the form for a submit
				$('ajaxForm').observe('submit', submitStuff);
				}
			}
		}
	});
}

function showCommission(event) {
	Event.stop(event);
	Lightview.show({
		href: 'ajax/cms.php?id=3',
		rel: 'iframe',
		options: {
			autosize: true,
			topclose: true,
			ajax: {
				onComplete: function(){
				// once the request is complete we observe the form for a submit
				$('ajaxForm').observe('submit', submitStuff);
				}
			}
		}
	});
}

function showContact(event) {
	Event.stop(event);
	Lightview.show({
		href: 'ajax/cms.php?id=4',
		rel: 'iframe',
		options: {
			autosize: true,
			topclose: true,
			ajax: {
				onComplete: function(){
				// once the request is complete we observe the form for a submit
				$('ajaxForm').observe('submit', submitStuff);
				}
			}
		}
	});
}