function mail(u, s, d, img)
{
var l="ilto";
	if (img == "txt")
		{document.write("<a"+" href="+"ma"+l+":"+u+"&#64;"+s+ "." +d+">"+u+"&#64;"+s+ "." +d+"</a>");}
	else
		{document.write("<a id=\"ico_m\""+" href="+"ma"+l+":"+u+"&#64;"+s+ "." +d+">"+"<img src=\"/pi/design/spacer.gif\" alt=\"E-mail\" /></a>");}
}

$(document).ready(function(){
  $('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}, 500);
       return false;
      }
    }
  });
});

$(function()
{
	$("#bm1").click(function()
	{
		$('#bm1').addClass('active');
		$('#bm2').removeClass('active');
		$('#bm3').removeClass('active');
		$('#bm4').removeClass('active');
		$('#bm5').removeClass('active');
	});
});	

$(function()
{
	$("#bm2").click(function()
	{
		$('#bm1').removeClass('active');
		$('#bm2').addClass('active');
		$('#bm3').removeClass('active');
		$('#bm4').removeClass('active');
		$('#bm5').removeClass('active');
	});
});

$(function()
{
	$("#bm3").click(function()
	{
		$('#bm1').removeClass('active');
		$('#bm2').removeClass('active');
		$('#bm3').addClass('active');
		$('#bm4').removeClass('active');
		$('#bm5').removeClass('active');
	});
});

$(function()
{
	$("#bm4").click(function()
	{
		$('#bm1').removeClass('active');
		$('#bm2').removeClass('active');
		$('#bm3').removeClass('active');
		$('#bm4').addClass('active');
		$('#bm5').removeClass('active');
	});
});

$(function()
{
	$("#bm5").click(function()
	{
		$('#bm1').removeClass('active');
		$('#bm2').removeClass('active');
		$('#bm3').removeClass('active');
		$('#bm4').removeClass('active');
		$('#bm5').addClass('active');
	});
});