var h=1;
function hoverImg (t, h2)
{
	var str = $(t).attr("src").toString();
	if(h2 && str.substr(str.length-6, 2)=='-h') h=0;
	if(h && h2) $(t).attr("src", str.substr(0, str.length-4)+"-h.jpg" );
	else if(!h2 && h) $(t).attr("src", str.substr(0, str.length-6)+".jpg");
	if(!h2 && str.substr(str.length-6, 2)=='-h') h=1;
}
$(document).ready(function(){
	$("#body #search-line .link-search a").click(function () { $("#body #search-line .search #search-q").val($(this).html()); return false;	});
	$("#header #header-left a img").bind("mouseenter",function(){
		hoverImg(this,1);
		$("#h-l-title").html($(this).attr("alt"));
		var offset = $(this).offset();
		offset.top += 35;
		offset.left += $(this).width()-($("#h-l-title").width()/2)-10;
		$("#h-l-title").css({"top":offset.top, "left":offset.left}).show();
	}).bind("mouseleave",function(){ hoverImg(this,0); $("#h-l-title").hide(); });
	$("#message img.message-exit").click(function () { $("#message").hide(); });
});
