// Title: Bari - javascript// Author: Kalon Edser, http://www.kalonedser.com/// Updated: 7 September 2010jQuery(document).ready(function() {	// Core	$('body').addClass('js');	$.preloadImages('../img/loader.gif');	var $loadIcon = $('<div>')		.addClass('load-icon')		.html('<img src="../img/loader.gif" alt="Loading..." />');	// Create ARIs columns	$('.aris li:gt(8)').addClass('col-2').appendTo('#aris').wrapAll('<ul class="aris"></ul>');	$('.aris li:first-child').addClass('first');	// Sprite Animations	$('#clouds').pan({fps: 30, speed: 0.7, dir: 'left', depth: 10});	$('.map-points li').sprite({fps: 15, no_of_frames: 30});	// Tooltips	$(".map-points li a.dot").tooltip({ relative: 'true', position: 'top right', offset: [18,-53], effect: 'slide', bounce: 'true', slideInSpeed: 200, slideOutSpeed: 100, predelay:100, delay:100 })		.dynamic({ left: { direction: 'up', bounce: true } });		// iOS fixes	$('#map').click(function() { });		$('.tooltip a').live('touchend', function() {		$(this).click();	});	// Indicate viewed locations	$(".map-points li a, .aris li a").click(function(){		var $thisID = $(this).parents('li').attr('id').split('_');		$('li[id$=_' + $thisID[1] + ']').addClass('viewed');	});	// Location box for non-ajax	$('.individual #viewer').hide().fadeIn();	$('.close a').click(function(){		$('#viewer').fadeOut();		return false;	});	// open new window for external links	var externalLinks = function(scope) {		$('A[rel="external"]', scope).click( function() {			window.open( $(this).attr('href') );			return false;		});	};	externalLinks(this);	// ajax viewer	$('a.inline').click(function() {		var $thislink = $(this),			$thisURL = $thislink.attr("href"),			$data = $thisURL + '?type=inline',			speed = 'fast';					$('.article').remove();		$('.map-points').addClass('disable').fadeOut('speed');		$('#viewer').prepend($loadIcon).fadeIn('speed', function() { 				$('#viewer').addClass('loaded');			})			.load($data, function() {				$('.article').hide().fadeIn('speed', function() {					$loadIcon.remove();				});							_gaq.push(["_trackPageview", $thisURL ]);			externalLinks(this);			// close ajax			$('.close a, #map').click(function(event){				if (event.target == this) {					$('#viewer').removeClass('loaded').fadeOut('speed', function() {						$('.article').remove();					});					$('.map-points').hide().fadeIn('speed', function() { $(this).removeClass('disable'); });					return false;				}				});		});		return false;	});	// scroll page	$('.aris a, .about a').click(function() {		$.scrollTo($('#viewer'), 'speed');		});});
