		function createOpt(list,select)
		{
			
			
			if(select=='marka')
			{
				var s=$("select[name='silnik']");
				$(s[0]).children().remove();
				$(s[1]).children().remove();
				var m=$("select[name='model']");
				
				$(m[0]).children().remove();
				$(m[1]).children().remove();
				
				var sel=$("select[name='marka']")	;
				
			}
			else if(select=='model')
			{
				$("select[name='silnik']").children().remove();
				$("select[name='model']").children().remove();
				var sel=$("select[name='model']")	;
			}
			else if(select=='silnik')
			{
				$("select[name='silnik']").children().remove();
				var sel=$("select[name='silnik']")	;
			}
			
			var opt = $(document.createElement('option')).text('--wybierz--');
			$(opt).attr('value', '');
			$(sel).append(opt);
			for (var index in list)
			{		
			
				var opt = $(document.createElement('option')).text(list[index]['nazwa']);
				$(opt).attr('value', list[index]['id']);
				$(sel).append(opt);
			}
		}
		
function getNode(id,select)
{
	
$.getJSON('produkty,node,'+id, function(data) 
{
//var tab=eval(data);
createOpt(data,select);	
});
}

