function loadPage(category,page,image) {
	var page = (page == null) ? "1" : page;
	var image = (image == null) ? "1" : image;
	window.location = 'index.php?category=' + category + '&page=' + page + '&photo=' + image;
}

var myrules = {
	'#travel' : function(el){
		el.onclick = function(){
			loadPage("travel",1,1);
		}
	},
	
	'#editorial' : function(el){
		el.onclick = function(){
			loadPage("editorial",1,1);
		}
	},
	
	'#personal' : function(el){
		el.onclick = function(){
			loadPage("personal",1,1);
		}
	},
	
	'#about_me' : function(el){
		el.onclick = function(){
			Effect.BlindDown('about_me_div');
		}
	},
	
	'#contact' : function(el){
		el.onclick = function(){
			Effect.BlindDown('contact_div');
		}
	},
	
	'#contact_closer' : function(el){
		el.onclick = function(){
			Effect.BlindUp('contact_div');
		}
	},
	
	'#about_me_close' : function(el){
		el.onclick = function(){
			Effect.BlindUp('about_me_div');
		}
	},
	
	'.thumb_clickable' : function(el){
		el.onclick = function(){
			var imageLoader = new gImageLoader({
			image_path: el.id,
			target_thumb_element: 'thumb_navigation',
			target_main_element: 'main_image',
			count: 7,
			page: 1
			});
		}
	}
};

Behaviour.register(myrules);

function doAjax() {
	$('submit_button').disabled = true;
	var theContent = $('content').value;
	pars = 'email=' + $('email').value + '&content=' + escape(theContent);
	new Ajax.Request( '/sendEmail.php', { method: 'post', parameters: pars, onComplete: closeWindow});	
}

function closeWindow() {
	Effect.BlindUp('contact_div');
	$('submit_button').disabled = false;
}