var last_selected="#philosophy_c"
var new_selected=" "
var interim=" "
$(document).ready(function() {
  scroller2  = new Scrolling.Scroller(document.getElementById("Scroller-1"), 450, 10);
  scrollbar2 = new Scrolling.Scrollbar(document.getElementById("Scrollbar-Container"), scroller2, new Scrolling.ScrollTween());
  down('philosophy')

  $('#integration_c').fadeOut();
  $('#hvhf_c').fadeOut();
  $('#usability_c').fadeOut();
  $('#contacts_c').fadeOut();





  $('a#philosophy').click(function() {
	

	new_selected="#philosophy_c"
    	$(last_selected).fadeOut('slow',callback);
	return false;
  });
  $('a#home').click(function() {
	

	new_selected="#philosophy_c"
    	$(last_selected).fadeOut('slow',callback);
	return false;
  });

  $('a#return').click(function() {
	

	new_selected="#philosophy_c"
    	$(last_selected).fadeOut('slow',callback);
	return false;
  });

  $('a#integration').click(function() {
	

 	new_selected="#integration_c"
    	$(last_selected).fadeOut('slow',callback);
	return false;
  });

  $('a#usability').click(function() {
	
    	new_selected="#usability_c"
    	$(last_selected).fadeOut('slow',callback);
	return false;
  });

  $('a#hvhf').click(function() {
	
    	new_selected="#hvhf_c"
    	$(last_selected).fadeOut('slow',callback);
	return false;
  });
  $('a#contacts').click(function() {

PlayFlashMovie();
	$('#newsR').fadeOut();
	$('#Scrollbar-Container').fadeOut();
    	new_selected="#contacts_c"
    	$(last_selected).fadeOut('slow',callback);
	 $('#flashcontent').fadeOut();

	return false;
  });

});

function callback(targs) {

$("#Scrollbar-Track").css("top","0");

$(".Scrollbar-Handle").css("top","0");
$(".Scroller-Container").css("top","0");


	if(new_selected!="#contacts_c"){
		$('#flashcontent').fadeIn();
		$('#newsR').fadeIn();
		$('#Scrollbar-Container').fadeIn();
	}else{
		$('#newsR').fadeOut();
		$('#Scrollbar-Container').fadeOut();
	}



      	$(new_selected).fadeIn('slow');
	interim=last_selected

	last_selected=new_selected
if(interim=="#contacts_c"){
	PlayFlashMovie();
}





	}
