$(document).ready(function() {


$("#comment-form h3").addClass("hideul");
$("#comment-form").find("fieldset").hide().end();
$("#comment-form").find("h3").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
   }
});

	
$(".vftags h2").addClass("hideul");
$(".vftags").find("div").hide().end();
$(".vftags").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
   }
});

$(".vflinks h2").addClass("hideul");
$(".vflinks").find("div").hide().end();
$(".vflinks").find("h2").click(function() {
	var answer = $(this).next();
   if (answer.is(":visible")) {
   	answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
   } else {
      answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
   }
});

$(".selected h2").addClass("hideul");
$(".selected").find("ul").hide().end();
$(".selected").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
	   answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
	}
});

$(".syndicate h2").addClass("hideul");
$(".syndicate").find("ul").hide().end();
$(".syndicate").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
	}
});


$(".doTwit h2").addClass("hideul");
$(".doTwit").find("ul").hide().end();
$(".doTwit").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
	}
});


$("#visites h2").addClass("hideul");
$("#visites").find("p").hide().end();
$("#visites").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
	}
});

$(".lastposts h2").addClass("hideul");
$(".lastposts").find("ul").hide().end();
$(".lastposts").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
	}
});

$(".catimgs h2").addClass("hideul");
$(".catimgs").find(".catimgscontent").hide().end();
$(".catimgs").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
	}
});

$(".lastimages h2").addClass("hideul");
$(".lastimages").find("div").hide().end();
$(".lastimages").find("h2").click(function() {
	var answer = $(this).next();
	if (answer.is(":visible")) {
		answer.slideUp("fast");
		$(this).removeClass("showul");
		$(this).addClass("hideul");
	} else {
		answer.slideDown("slow");
		$(this).removeClass("hideul");
		$(this).addClass("showul");
	}
});


});

window.onload = function () { applesearch.init();}

