isLoading=false;								

function show_form(show,hide){
	Element.show(show);
	Element.hide(hide);					
}

function close_form(div){
	Element.hide(div);					
}


function update_div(name,game)
	{
	if (!isLoading){
		
		isLoading=true;
					Element.show('loading');
					new Ajax.Updater(
						'dynamic_form',
						'/category/'+name+'/'+game+'',
						{
								onSuccess:function(request){
									Element.hide('loading');
									Element.show('dynamic_form');
									isLoading=false;
								}, 
								asynchronous:true, 
								evalScripts:true, 
								requestHeaders:['X-Update', 'dynamic_form']
					 
					
				
			}
		)
	}	
}

function update_div2(name,game)
	{
	if (!isLoading){
		
		isLoading=true;
					Element.show('loading2');
					new Ajax.Updater(
						'dynamic_form2',
						'/category/'+name+'/'+game+'',
						{
								onSuccess:function(request){
									Element.hide('loading2');
									Element.show('dynamic_form2');
									isLoading=false;
								}, 
								asynchronous:true, 
								evalScripts:true, 
								requestHeaders:['X-Update', 'dynamic_form2']
					 
					
				
			}
		)
	}
}

function wyslij2() {
advAJAX.submit(document.getElementById("Formmularz2"),{
onSuccess : function(obj) {document.getElementById('dynamic_form2').innerHTML = obj.responseText;},
onError : function(obj) {alert("Nie można nawiązać połączenia z serwerem, spróbuj później.");}
});
}

function wyslij() {
advAJAX.submit(document.getElementById("Formmularz"),{
onSuccess : function(obj) {document.getElementById('dynamic_form').innerHTML = obj.responseText;},
onError : function(obj) {alert("Nie można nawiązać połączenia z serwerem, spróbuj później.");}
});
}

function sortuj() {
document.sortuj.submit();
}

