  $(document).ready(function() {  
  
    //get all link with class panel  
    $('a.panel').click(function () {  
  
                //reset and highlight the clicked link  
        $('a.panel').removeClass('programsSelected');  
        $(this).addClass('programsSelected');  
          
        //grab the current item, to be used in resize function  
        current = $(this);  
          
                //scroll it to the destination  
        $('#wrapper').scrollTo($(this).attr('href'), 880);        
          
                //cancel the link default behavior  
        return false;  
    });  
	
  
    //resize all the items according to the new browser size  
    $(window).resize(function () {  
          
        //call the resizePanel function  
        resizePanel();  
    });  
      
 
	var hash = window.location.hash.substr(1);
	var href = $('#ajax a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href)){
			var toLoad = '.html #profile1';
			$('#profile').load(toLoad)
		}											
	}); 

	$('#ajax a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #profile1';
		$('#profile').hide('slow',loadContent);
		$('#load').remove();
		$('#ajax a').addClass('active').not(this).removeClass('active');
		$('#loading').append('<span id="load">&nbsp;</span>');
		$('#load').fadeIn('normal');
		// window.location.hash = (this);
		function loadContent() {
			$('#profile').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#profile').delay(1200).show('slow',hideLoader());
		}
		function hideLoader() {
			$('#load').delay(2000).fadeOut('slow');
		}
		return false;
	});
});

var rand = Math.floor(Math.random()*5);

$(window).load(function() {
	$('#sliderNormal').nivoSlider({
		effect:'sliceDownLeft',
		slices:15,
	    startSlide:rand,
		animSpeed:500,
		pauseTime:5000,
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});	
	$('#sliderHome').nivoSlider({
		effect:'sliceDownLeft',
		slices:15,
		animSpeed:500,
		pauseTime:5000,
	    startSlide:0,
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});	
});


<!--
	var query = new Object();
	window.location.search.replace(
	new RegExp( "([^?=&]+)(=([^&]*))?", 'g' ),
		function( $0, $1, $2, $3 ){
			query[ $1 ] = $3;
		}
	);
	easing = query['e'] || 'Expo';
	
	function loadEasing(e) {
		location.href = location.pathname+'?e='+e;
	}
	
	function setEasing(e) {
		loadLamps(e);
	}
	
// jquery initialize:
	$(function() {
		$('#menu').lavaLamp({fx: 'swing', speed: 333});
		loadLamps(easing);
		
		$('select#easing option[value='+easing+']').attr('selected','selected');
		$('.easingLabel').text(easing);
	});
//console.log();
-->
    

