function init() {

	if($.browser.msie && $.browser.version < 7) ie6 = true; else ie6 = false;
	var base_title = ' « Transmediale Kunst';
	
	function setTitle(page_id){
		page_title = $('#'+page_id+' div.page_body div.submenu h2 a').text();
		subpage_title = $('#'+page_id+' div.page_body div.five h2:first').text();
		if (subpage_title != '') page_title = subpage_title + ' « ' + page_title;
		document.title = page_title + base_title;	
	}
	
	
	function loadPage(page) {
	
		if(page=='/') page_id = "homepage"
		else {
			page_id = '';
			slugs = page.split('/');
			while(page_id == '') page_id = slugs.pop(); // get the last slug
		} 
		
		if($('#'+page_id).css('display')) {
			// it exists, scroll there
			$.scrollTo('#'+page_id, { duration: 300 });
			// set page title
			setTitle(page_id);
		} else {
			// call content via ajax
			// add loading graphic here?
			$.get(page, function(data){ // no need to filter last slug out for page here
  				page_content = data;
				// remove too old divs here?
				// remove loading graphic here
  				$('#container').append(page_content); // should prob add age class so we can remove > x divs
  				$('#'+page_id).children('div.page_body').hide(); // hide for callback fade in
  				theCallback = function() { $('#'+page_id).children('div.page_body').fadeIn(300); }
  				$('#'+page_id).show();
  				$.scrollTo('#'+page_id, { duration: 300, onAfter: theCallback });
  				// set page title
				setTitle(page_id);
			});
		}	
	
	}
	
	if(!ie6) {
		// catch internal links
		$('a[href^="/"]').live('click',function(){
			var page = $(this).attr('href');
			parent.location.hash = page; // add to page url for bookmarking/refresh - read this on load and load the appropriate page!
			loadPage(page);
			return false;
		});
	}	

}