$(document).ready(f_init);

function f_init() {
	var ss = document.getElementById("searchsend");
	var cs = document.getElementById("commentsend");
	if(ss) ss.onclick = function() {
		document.getElementById("searchform").submit();
		return false;
	}
	if(cs) cs.onclick = function() {
		document.getElementById("commentform").submit();
		return false;
	}
	$(".imghide").each(function(iter, elm) {
		var img = document.createElement("img");
		img.src = "wp-content/themes/albinworld/images/icoImage.jpg";
		elm.parentNode.appendChild(img);
		img.changeNode = elm;
		elm.changeNode = img;
		$(img).click(f_show).css("cursor", "pointer");
		$(elm).click(f_hide).css("cursor", "pointer");
	});
}

function f_show() {
	var i = this.changeNode;
	$(this).css("display", "none");
	$(i).css({
		display: "block",
		width: "52px"
	}).animate({
		width: "100%"
	}, "slow");
}

function f_hide() {
	var i = this.changeNode;
	$(this).animate({
		width: "52px"
	}, "slow", function() {
		$(this).css("display", "none");
		$(i).css("display", "block");
	});
}

