/* <![CDATA[ */

(function($) {

	$(document).ready(function(){

	$('dl.col-4 a, dl.col-5 a, dl.col-6 a, dl.col-7 a, dl.col-8 a, dl.col-9 a').addClass('vtip');


	// caption slider

		$(".gallery dd.gallery-caption").css({'height' : '0', 'position' : 'absolute', 'top' : '0', 'left' : '0', 'background' : '#000', 'opacity' : '0.1'});

		$("dl.col-2 dd.gallery-caption").css({'width' : '220px'});

		$("dl.col-3 dd.gallery-caption").css({'width' : '140px'});

		$("dl.col-2 dd p").css({'padding' : '3px 5px 0 5px', 'width' : '210px'});

		$("dl.col-3 dd p").css({'padding' : '3px 0 0 7px', 'width' : '123px'});

		$("dl.col-2, dl.col-3").hover(function() {

			$(this).find('dd').stop().animate({height: '67px', opacity: 0.8}, {easing: 'bounceout', duration: 800});

		}, function() {

			$(this).find('dd').stop().animate({height: '0', opacity: 0.1}, {easing: 'bounceout', duration: 800});

		});


	// xtip (jquerytools)

		$(".post-edit-link").tooltip({ position: "top center", opacity: 0.8, effect: 'slide', slideOffset: [10, 0]});
		$(".xtip").tooltip({ position: "center center", opacity: 0.8, effect: 'slide', slideOffset: [10, 0]});


	// smooth scroll

		$('span 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},{duration: 700});
					return false;
				}
			}
		});


	// list scroll

		$("#scr").prepend("<p id='up'>" + "</p>" + "<p id='down'>" + "</p>");

		$("#moveme").jCarouselLite({
			btnNext: ".teaseme #down",
			btnPrev: ".teaseme #up",
			vertical: true,
			easing: "linear",
			visible: 3,
			scroll: 1,
			auto: 3000,
			circular: true,
			speed: 1000
		});

	});


	// vtip

		this.vtip = function() {    

			this.xOffset = -50; // x from mouse
			this.yOffset = -70; // y from mouse       

			$(".vtip").hover(    

				function(e) {
					this.t = this.title;
					this.title = ''; 
					this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);
					$('body').append( '<p id="vtip">' + this.t + '</p>' );
					$('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("slow");
				},

				function() {
					this.title = this.t;
					$("p#vtip").fadeOut("slow").remove();
				}

			).mousemove(
				function(e) {
					this.top = (e.pageY + yOffset);
					this.left = (e.pageX + xOffset);
					$("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
				}
			);
		};

	$(document).ready(function($){vtip();})


	// sidesearch

	$(document).ready(function(){

		$("#searchbox.gotog").after("<p id='click'></p>");

		$("#searchbox.gotog").hide(); 

		$("#click").text($(this).text() == '+' ? '-' : '+');

		$("#click").click(function(){

			$("#searchbox.gotog").slideToggle(1000);

			$(this).text($(this).text() == '+' ? '-' : '+');

			return false;

		});

		$("#click").toggle(function(){

			$("#click").css({'padding-top' : '0px', 'padding-left' : '10px', 'width' : '40px', 'height' : '32px'});

		},

		function() {

			$("#click").css({'padding-top' : '1px', 'padding-left' : '8px', 'width' : '42px', 'height' : '31px'});

		});

	});


})(jQuery);

/* ]]> */
