/* <![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;
				}
			}
		});


	// toggle


		$('li.togtog ul.blogroll').addClass('toggle');
		$('li.cloud ul.wp-tag-cloud').addClass('toggle');

		var toggle = function() {
			$(this).toggleClass('expanded').
				nextAll('.toggle').slideToggle('fast');
		};

		$('ul.toggle').hide();
		$('p.toggle').hide();
		$('div.toggle').hide();
		$('form.toggle').hide();
		$('h3.togme').click(toggle);
		$('h4.togme').click(toggle);


	// 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
		});


	// tabs

		$('ul.tabs').show();
		$('ul.boxed h3').hide();
		$('ul.boxed li.categories').hide();
		$('ul.boxed li.arcbox').hide();
		$('ul.tabs li.tab_a').addClass('tab-current');

		$('#sidebar li.tab_b').click(function(){
			$('#sidebar ul.boxed li.pagenav').hide();
			$('#sidebar ul.boxed li.arcbox').hide();
			$('#sidebar ul.boxed li.categories').show();
			$('#sidebar li.tab_a').removeClass('tab-current');
			$('#sidebar li.tab_c').removeClass('tab-current');
			$(this).addClass('tab-current');

		});

		$('#sidebar li.tab_a').click(function(){
			$('#sidebar ul.boxed li.categories').hide();
			$('#sidebar ul.boxed li.arcbox').hide();
			$('#sidebar ul.boxed li.pagenav').show();
			$('#sidebar li.tab_b').removeClass('tab-current');
			$('#sidebar li.tab_c').removeClass('tab-current');
			$(this).addClass('tab-current');

		});

		$('#sidebar li.tab_c').click(function(){
			$('#sidebar ul.boxed li.categories').hide();
			$('#sidebar ul.boxed li.pagenav').hide();
			$('#sidebar ul.boxed li.arcbox').show();
			$('#sidebar li.tab_a').removeClass('tab-current');
			$('#sidebar li.tab_b').removeClass('tab-current');
			$(this).addClass('tab-current');

		});

		$('#footer li.tab_b').click(function(){
			$('#footer ul.boxed li.pagenav').hide();
			$('#footer ul.boxed li.arcbox').hide();
			$('#footer ul.boxed li.categories').show();
			$('#footer li.tab_a').removeClass('tab-current');
			$('#footer li.tab_c').removeClass('tab-current');
			$(this).addClass('tab-current');

		});

		$('#footer li.tab_a').click(function(){
			$('#footer ul.boxed li.categories').hide();
			$('#footer ul.boxed li.arcbox').hide();
			$('#footer ul.boxed li.pagenav').show();
			$('#footer li.tab_b').removeClass('tab-current');
			$('#footer li.tab_c').removeClass('tab-current');
			$(this).addClass('tab-current');

		});

		$('#footer li.tab_c').click(function(){
			$('#footer ul.boxed li.categories').hide();
			$('#footer ul.boxed li.pagenav').hide();
			$('#footer ul.boxed li.arcbox').show();
			$('#footer li.tab_a').removeClass('tab-current');
			$('#footer li.tab_b').removeClass('tab-current');
			$(this).addClass('tab-current');

		});

	});


	// 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();})




	// social

	$(document).ready(function(){

		$("#header.gobar").prepend("<p id='media'></p>");

		$("#social.gosoc").hide();

		$("#media").text($(this).text() == '+' ? '-' : '+');

		$("#media").toggle(function(){

			$("#media").css({'padding-top' : '21px', 'padding-left' : '19px', 'width' : '18px', 'height' : '37px'});

			$("#social.gosoc").animate({height: 'toggle', opacity: 1}, {easing: 'bounceout', duration: 2000});

			$(this).text($(this).text() == '-' ? '+' : '-');

		},

		function() {

			$("#media").css({'padding-top' : '23px', 'padding-left' : '17px', 'width' : '20px', 'height' : '35px'});

			$("#social.gosoc").animate({height: 'toggle', opacity: 0.2}, {easing: 'linear', duration: 1000});

			$(this).text($(this).text() == '-' ? '+' : '-');

		});

	});


	// headsearch

	$(document).ready(function(){

		$("#searchpad.gofind").after("<p id='find'></p>");

		$("#searchpad.gofind").hide();

		$("#find").text($(this).text() == '+' ? '-' : '+');

		$("#find").toggle(function(){

			$("#find").css({'padding-top' : '19px', 'padding-left' : '7px', 'width' : '18px', 'height' : '37px'});

			$("#searchpad.gofind").slideToggle({easing: 'bounceout', duration: 1000});

			$(this).text($(this).text() == '-' ? '+' : '-');

		},

		function() {

			$("#find").css({'padding-top' : '21px', 'padding-left' : '5px', 'width' : '20px', 'height' : '35px'});

			$("#searchpad.gofind").slideToggle({easing: 'bounceout', duration: 1000});

			$(this).text($(this).text() == '-' ? '+' : '-');

		});

	});


	// 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);

/* ]]> */
