function Init()
{
	$(".smart > span.click, .smart > div.kv, .smart > div.kv_a").each(function(){this.onclick = function(){ShowSmart(this.parentNode.getAttribute("smart"));}});
	HideSmart();
	$("#SMfirst").attr("open", 1);
}

function HideSmart()
{
	$(".smart > div.hide").animate({opacity:"hide", height:"hide"}, 300, '');
	$(".smart").attr("open", 0);
}

function ShowSmart(SMART)
{	
	if($("div[@smart='"+SMART+"']").attr("open")==1)
		return false;
	$(".smart").find("div.show").attr("class", "hide");
	$(".smart > div.kv_a").attr("class", "kv");
	HideSmart();

 	$("div[@smart='"+SMART+"']").find("div.kv").attr("class", "kv_a").end().find("div.hide").attr("class", "show").animate({opacity:"show"}, 300, '');	
 	$("div[@smart='"+SMART+"']").attr("open", 1);
 	window.location = '#top';
}

$(document).ready(Init);