

function showB(){
	//alert('11');
	document.getElementById('element1').style.display='none';
	document.getElementById('element2').style.display='block';
}
function hideB(){
	//alert('11');
	document.getElementById('element1').style.display='block';
	document.getElementById('element2').style.display='none';
}

function showPop(id){
	$("#pop_"+id).fadeIn();
}
function hidePop(id){
	$("#pop_"+id).fadeOut();
}

 $(document).ready(function() {
	$("#element1").mouseover(function(){
		$("#element1").fadeOut(function(){
			$("#element2").fadeIn();
		});
		
	});

	$("#element2").mouseout(function(){
		$("#element2").fadeOut(function(){
			$("#element1").fadeIn();		
		});
		
	});


	$('#sel1').change(function() {
		id = $('#sel1').val();
		document.getElementById("sel2").length = 0;
		$.getJSON('/ajax.php?a=drop&id='+id,{tags: "cat",tagmode: "any",format: "json"},
		function(data) {
			$.each(data, function(i,item){
				var anOption = document.createElement("OPTION");
				document.getElementById("sel2").options.add(anOption);
				anOption.innerText = item.title;
				//alert(item.parent+'/'+item.id_url+'.html');
				anOption.value = item.url+item.lang+'/'+item.parent+'/'+item.id_url+'.html';
			});
		});
	});
	
	$('#sel2').change(function() {
		id = $('#sel2').val();
		window.location = id;
	});
	
	
	
	
 });
