/*ü*/
var openrow = null;
function rowmouseover()
{
		var itemid = $(this).find("span.itemid").html();
		
		/*$(this).find("span.capables").show(100);
		$("#itemlist tr td span.capables[id!='capables_" + itemid + "']:visible").hide(250);*/
		$(this).find("span.capables").stop(true,true).show(100);
		$("#itemlist tr td span.capables[id!='capables_" + itemid + "']:visible").stop(true,true).hide(250);		
}

function loadtt(tid)
{
	if (tid && (typeof (tid) == "number"))
	{
/*		$.ajax({
			   url: "/shopncraft.php",
			   cache: false,
			   data: { tid: tid },
			   dataType: "html",
			   timeout: 3,
			   error: function() { },
			   success: function() { },
			   complete: function(){ },
			   });
		$("#ttbox").html(data);*/
		$("#ttbox").load("/shopncraft.php?tid="+tid);
	}
}
function loadttjson(tid)
{
	if (tid && (typeof (tid) == "number"))
	{
/*		$.ajax({
			   url: "/shopncraft.php",
			   cache: false,
			   data: { tid: tid },
			   dataType: "html",
			   timeout: 3,
			   error: function() { },
			   success: function() { },
			   complete: function(){ },
			   });
		$("#ttbox").html(data);*/
		$.getJSON(
			"/shopncraft.php?tjid="+tid,
			function(data){
				$("#ttbox").html(data.tooltip);
				$(".tooltip_info #ttid").text('Item ID: ' + data.id);
				$(".tooltip_info #ttlink").attr("href",data.link);
				$(".tooltip_info #ttlink").text('Weitere Infos: ' + data.link);
			}
		);
	}
}


$(document).ready(function(){
	$("#itemlist tr td a.itemlink").mouseover(rowmouseover);
	//$("#itemlist td a.itemlink").click(function() { loadtt( parseInt($(this).find("span.itemid").html()) ); return false; });
	$("#itemlist td a.itemlink").click(function()
		{
			var thisone = parseInt( $(this).find("span.itemid").html() );
			loadttjson( thisone );
			return false; 
		}
	);
	
	$("#selector #c, #selector #sc").change(function()
		{
			$("#browseform").submit()
		}
	);
});
