$(document).ready(function() {
	var speed = 400;
	$("#menu ul li span a").click(function() {
		if ($(this).attr('rel')!='nofollow' && $(this).attr('rel')!='_blank') {
			var $self = $(this);
			$("#content").animate({ opacity: '0', top: '30px' }, speed);
			$("#text").animate({ opacity: '0', top: '70px' }, speed, function() { document.location=$self.attr('href'); });
			$("#menu .highlight").removeClass("highlight");
			$(this).parent().parent().addClass("highlight");
			return false;
		}
	});
	$("#content").animate({ opacity: '0.75', top: '55px' }, speed);
	$("#text").animate({ opacity: '1', top: '50px' }, speed);
	$('#innertext').jScrollPane({ scrollbarWidth: 15 });
	$(".jScrollPaneContainer").click(function() { this.blur(); });
	$(".music li span").mouseover(function(){$(this).css({color: "#800080"})}).mouseout(function(){$(this).css({color: "#000000"})});
	$("span.contact").each(
		function() {
			var address = $(this).html().replace(/\//g,'.').split('\\').join('@');
			var p = new Array('ma','il','to').join('')
			$(this).html(address);
			$(this).click(function() { location.href = p + ':' + address; });
			$(this).css({color: 'blue', textDecoration: 'underline', cursor:'pointer'});
		}
	);


});
if (window!=top) top.location.href=location.href;
function popupWindows() {
	if(!document.getElementsByTagName) return;
	for (var i=0; i<document.getElementsByTagName("a").length; i++) if (document.getElementsByTagName("a")[i].getAttribute("rel")=='nofollow' || document.getElementsByTagName("a")[i].getAttribute("rel")=='_blank') document.getElementsByTagName("a")[i].target = '_blank'
}
window.onload = popupWindows
function play(sound,max,track) {
  if (track==undefined) track = sound;
  soundManager.destroySound('music');
  if ($("#sound"+sound).is(".playing")) {
    $(".playing").removeClass("playing");
  }
  else {
    soundManager.createSound('music','/music/'+(track<10?'0':'')+track+'.mp3');
    soundManager.setVolume('music',70);
    soundManager.play('music', { onfinish: function() { if (sound<max) { play(sound+1,max,track+1); } else { $(".playing").removeClass("playing"); soundManager.destroySound('music'); } } });
    $(".playing").removeClass("playing");
    $("#sound"+sound).addClass("playing");
  }
}