$(document).ready(function() {

    if( $(location).attr('href').indexOf('#') == -1) {
        $('#wrapper').delay(4000).scrollTo($('#about-downie-design-canberra'), 3000);
    }

    $('a.panel').click(function () { 
								 
								 
		$('a.panel').removeClass('selected');
		$(this).addClass('selected');
		current = $(this);
		$('#wrapper').scrollTo($(this).attr('href'), 1200);		
		return false;
	});
	$(window).resize(function () {
		resizePanel();
	});
});

function resizePanel() {  
     //get the browser width and height  
     width = $(window).width();  
     height = $(window).height();  
     //get the mask width: width * total of items  
     mask_width = width * $('.item').length;  
     //set the dimension   
     $('#wrapper, .item').css({width: width, height: height});  
     $('#mask').css({width: mask_width, height: height});  
     //if the item is displayed incorrectly, set it to the corrent pos  
     $('#wrapper').scrollTo($('a.selected').attr('href'), 0);  
}  

