
$(function(){
var menu=$('#topmenu'),
pos=menu.offset();
$(window).scroll(function(){
if($(this).scrollTop()>pos.top+menu.height()&&menu.hasClass('default')){
menu.slideUp('fast',function(){
$(this).removeClass('default').addClass('fixed').slideDown('fast');
});
}else if($(this).scrollTop()<=pos.top&&menu.hasClass('fixed')){
menu.slideUp('fast',function(){
$(this).removeClass('fixed').addClass('default').slideDown('fast');
});
}
});
});
$(function scroll_to(){
$('a[href*=#]').click(function(){
if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')
&&location.hostname==this.hostname){
var $target=$(this.hash);
$target=$target.length&&$target
||$('[name='+this.hash.slice(1)+']');
if($target.length){
var targetOffset=$target.offset().top;
$('html,body')
.animate({scrollTop:targetOffset},400);
return false;
}
}
});
});
$(function() {
$(".carousel").jCarouselLite({
	btnNext: ".next",
	btnPrev: ".prev",
	auto: 4200,
	speed: 1000
});
});
