$(function() {

		   

		var path = location.pathname.substring(1);

		if ( path )

		$('#main_nav a[@href$="' + path + '"]').attr('class', 'selected');

		

		var subpath = location.pathname.substring(1);

		if ( subpath )

		$('#sub_nav a[@href$="' + subpath + '"]').attr('class', 'selected');

		$('a.new_win').click(function(){
			window.open(this.href);
			return false;
		});

		var curr_num = 1;

		var txts = 2;

		$('.txt_02').hide();
		
		$('#overlay').fadeOut();

			

		$('#txt_fwd').click(function(){

		var next_num = curr_num+1;

		if(curr_num < txts){

			$('#overlay').fadeIn(function(){

				$('.txt_0'+curr_num).hide();

				$('.txt_0'+next_num).show(function(){

					$('#overlay').fadeOut('slow');

					$('#txt_num').html(next_num);

					curr_num = next_num;

					});

				});

			};

		});

		

		$('#txt_bck').click(function(){

		var next_num = curr_num-1;

		if(curr_num > 1){

			$('#overlay').fadeIn(function(){

				$('.txt_0'+curr_num).hide();

				$('.txt_0'+next_num).show(function(){

					$('#overlay').fadeOut('slow');

					$('#txt_num').html(next_num);

					curr_num = next_num;

					});

				});


			};

		});

		

		$('.slideshow').slideshow({

			timeout: '4000',

			pauselink: 'pause'});

		

		$('.slideshow').Tooltip({

			delay: 500,

			event: "mouseover",

			track: true});

});