$(document).ready(function() {
	/* FULLSCREEN BACKGROUND */
	$(function(){
		$.fn.supersized.options = {
			startwidth: 1280,
			startheight: 850,
			minsize: .5,
			slideshow: 0,
			slideinterval: 5000
		};
			$('#fullscreen').supersized();
	});

	/* MENU HIGHLIGHT */
	$(function() {
		if (location.pathname.substring(1))
			$('#menu a[@href*="' + location.pathname.substring(1,location.pathname.indexOf("/",1)) + '"]').css({backgroundPosition: '0 100%'});
		if (location.pathname.substring(1))
			$('#menu-en a[@href*="' + location.pathname.substring(2,location.pathname.indexOf("/",5)) + '/"]').css({backgroundPosition: '0 100%'});	
	});

	/* MAILTO SCRIPT
	Syntax: <a href="#youremail(at)yourdomain.com" rel="email">youremail(at)yourdomain.com</a>
	*/

	$('a[rel=email]').each(function() {
		var email = this.innerHTML;
		var email = email.split('\(at\)');

		$(this).click(function () {       
			document.location = "mailto:" + email[0] + "@" + email[1];     
			return false;
		});
	});

	/* IMAGE CYCLE */
	$("#right-photoslide").cycle({
		timeout: 5000,
		speed: 2000
	});
});