$(document).ready(function() {

	// get page type
	var pageID = $("body").attr('id');

	if ($.browser.msie) {
		$("#nav-secondary li a.selected").append("<img src='../images/arrow.gif' align='absmiddle'/>");	
		$("#nav-secondary li a").hover(function(){
			if (!$(this).hasClass("selected")) {
				$(this).append("<img src='../images/arrow.gif' align='absmiddle'/>");
			}
		}, function(){
		    if (!$(this).hasClass("selected")) {
				$(this).find("img").remove();
			}
		});
	}	
	
	// single post - only show first image
	if (pageID == 'our-tribe') { 
		$("ul#nav-secondary li a").each(function () {	
			str = $(this).text();
			newstr = str.substring(0,str.indexOf("–"));
			$(this).text(newstr);			
		});
		$("#content h2").each(function () {	
			str = $(this).text();
			firstPart = str.substring(0,str.indexOf("–"));
			secondPart = str.substring(str.indexOf("–")+2);
			$(this).html(firstPart+" - <br/>"+secondPart);			
		});		
	}	
	
	// slideshows
	if (pageID == 'archive' || pageID == 'home') { 
		$('#showreel').cycle({ 
			fx: 'fade', 
			speed:  8000
		});
	}	
	
	
				
});

