// Debugging-Function. Only active in Browser who support it
function pr() {
	if (!window.console) {
		return;
	}
	if (typeof window.console !== 'undefined' && typeof window.console.log === 'function') {
		console.log(pr.arguments);
	}
}

(function($) {
	// Produces correct URLs relative to Router::url('/)
	$.url = function(url) {
	  return $('meta[name=identifier-url]').attr('content')+url.substr(1);
	}

	$(function() {
		//Take care about the non-js fallback-version of the site 
		$('body').addClass('js').removeClass('no-js');
 
		// Make external links open in a new window
		$('a[rel=external]').live('click', function() {
			window.open(this.href);
			return false;
		});

		// Fix Alpha-PNG's for IE6
		if ($.browser.msie && $.browser.version < 7) {
		 	$.ifixpng($.url('/js/jquery/ifixpng/pixel.gif'));
		 	$('img[src$=.png]').ifixpng();
		}
		pr('bla');
		$('img[title]').tooltip();

		$('a[rel*=lightbox]').lightBox();
		// And now all the project-specific stuff to be executed ON READY
		$.local.func();
	});

	// Generate namespace for project-specific functions encapsulated in the jQuery $-namespace
	$.local = function() {};
	// Definition of project-specific function
	$.local.func = function() {
		
	};
})(jQuery);

