window.addEvent('domready', function() {
        $$('div.event_content_go_to_0').each(function(element) {
                var effect = new Fx.Slide(element).hide();
                element.style.display = 'block';        
        });     
});


function add_event_user(Bid,srv,module_name) 
{
	get_page(srv+'modules/mod_events/mod_events_add_event_user.php?event_id='+Bid+'&module_name='+module_name+'', function() { add_event_user_post(Bid); }); 
}


function add_event_user_post(Bid)
{
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
	{
      var window1 = document.getElementById("add_user_event_"+Bid);
	  var window2 = document.getElementById("add_user_event_"+Bid+"_txt");
	  window1.style.display = 'block';
      window2.innerHTML = xmlhttp.responseText;
	}
}


function event_add_succes_hidden(Bid)
{
      var window1 = document.getElementById("add_user_event_"+Bid);	
	  window1.style.display = 'none';	
}


function open_windows_event_users(Bid)
{
      var window1 = document.getElementById("event_users_"+Bid);
	  var elm = new Fx.Slide(window1).slideIn();	
}

function close_windows_event_users(Bid)
{
      var window1 = document.getElementById("event_users_"+Bid);
	  var elm = new Fx.Slide(window1).slideOut();	
}

function mod_events_country(srv,module_name) 
{
	var country_name = document.forms["events_country"].country_name.value;
	
	get_page(srv+'modules/mod_events/mod_events_country.php?module_name='+module_name+'&country_name='+country_name+'', function() { mod_events_country_update(srv,country_name); }); 
}

function mod_events_country_update(srv,country_name)
{
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
	{	
	var window1 = document.getElementById("normal_list");	
	window1.style.display = 'none';	
    var window2 = document.getElementById("static_list");
    window2.style.display = 'block';	    
    window2.innerHTML = xmlhttp.responseText;   
    var window3 = document.getElementById("land_vlag");
    window3.style.background = "url('"+srv+"images/language/"+country_name+".gif')";	
                $$('div.event_content_go_to_0').each(function(element) {
                        var effect = new Fx.Slide(element).hide();
                        element.style.display = 'block';        
                });      	
	}

	
}


function mod_events_search(srv,module_name) 
{
	var search_live = document.forms["search_on_list"].search_live.value;
	
	get_page(srv+'modules/mod_events/mod_events_search.php?module_name='+module_name+'&search_live='+search_live+'', function() { mod_events_search_update(); });
}

function mod_events_search_update()
{
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
	{
		if(document.forms["search_on_list"].search_live.value==""){
		document.getElementById("normal_list").style.display = 'block'; 
		document.getElementById("static_list").style.display = 'none';
		}else{
		document.getElementById("normal_list").style.display = 'none'; 
		document.getElementById("static_list").style.display = 'block';
		document.getElementById("static_list").innerHTML = xmlhttp.responseText;
		$$('div.event_content_go_to_0').each(function(element) {
			var effect = new Fx.Slide(element).hide();
			element.style.display = 'block';	
		});	 		
		}
	}
}

function event_add_succes_hidden_search(Bid)
{
	var window1 = document.getElementById("add_user_event_country_"+Bid);	
	window1.style.display = 'none';	
}

function open_windows_event_users_search(Bid)
{
      var window1 = document.getElementById("event_users_search_"+Bid);
	  var elm = new Fx.Slide(window1).slideIn();	
}

function close_windows_event_users_search(Bid)
{
      var window1 = document.getElementById("event_users_search_"+Bid);
	  var elm = new Fx.Slide(window1).slideOut();	
}

function add_event_user_country(Bid,srv,module_name) 
{
	get_page(srv+'modules/mod_events/mod_events_add_event_user_2.php?event_id='+Bid+'&module_name='+module_name+'', function() { add_event_user_country_post(Bid); }); 
}


function add_event_user_country_post(Bid)
{
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
	{
      var window1 = document.getElementById("add_user_event_country_"+Bid);
	  var window2 = document.getElementById("add_user_event_country_"+Bid+"_txt");
	  window1.style.display = 'block';
      window2.innerHTML = xmlhttp.responseText;
	}
}


function event_add_succes_hidden_country(Bid)
{
	var window1 = document.getElementById("add_user_event_country_"+Bid);	
	window1.style.display = 'none';	
}

function open_windows_event_users_country(Bid)
{
      var window1 = document.getElementById("event_users_country_"+Bid);
	  var elm = new Fx.Slide(window1).slideIn();	
}

function close_windows_event_users_country(Bid)
{
      var window1 = document.getElementById("event_users_country_"+Bid);
	  var elm = new Fx.Slide(window1).slideOut();	
}


function add_event_user_search(Bid,srv,module_name) 
{
	get_page(srv+'modules/mod_events/mod_events_add_event_user_3.php?event_id='+Bid+'&module_name='+module_name+'', function() { add_event_user_search_post(Bid); }); 
}



function add_event_user_search_post(Bid)
{
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200))
	{
      var window1 = document.getElementById("add_user_event_search_"+Bid);
	  var window2 = document.getElementById("add_user_event_search_"+Bid+"_txt");
	  window1.style.display = 'block';
      window2.innerHTML = xmlhttp.responseText;
	}
}


function event_add_succes_hidden_search(Bid)
{
	var window1 = document.getElementById("add_user_event_search_"+Bid);	
	window1.style.display = 'none';	
}
