$(window).load(function() {	
	var sPath = window.location.pathname;	
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	var pages = sPath.split('/') ;
	var directory = pages[1]	
	if(directory != null && directory != ""){
		$('#' + directory).css("color","#ffcc33");
		$('#' + directory +'_items').show();
		$('a[href=' + sPath + ']').css("color","#ffcc33");
	}
	$('#logo_container').click(function (){window.location = "/" })
	
	if(directory != "repertoire" && directory != "support"){
		var content = $("#main_content").html();
		if(content.length > 1200){
			var agent=navigator.userAgent.toLowerCase();
			var is_iphone = agent.indexOf('iphone') != -1;
			if(is_iphone)
			{
				$("#container").css({"height": "1200px"});
			}
			else
			{
				$("#main_content").css({"overflow": "scroll","width": "410px", "height": "370px"});
			}
		}
	}
	
	$("#main_content").show();
});

function slideSwitch() {
	$("#slideshow > img").first().show();
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next(): $('#slideshow IMG:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
