var current = 0;

function visible_lm(id)
{
 document.getElementById(id).style.display = (document.getElementById(id).style.display == "none") ? "block" : "none";
}


function show_hide_div(id) 	{
	document.getElementById(id).style.display = (document.getElementById(id).style.display == "none") ? "block" : "none";
	}
	
function hide_div(id) 	{
	document.getElementById(id).style.display = "none";
	}	
	
function hide_all_div_table(id) 	{
	var hide_all = document.getElementById(id);
	var hide_all_div = hide_all.getElementsByTagName('div');
	for (var n = 0; n < hide_all_div.length; n++) 
		hide_all_div[n].style.display = 'none';
	}	
		
function hide_all_tables(name) 	{
	var hide_all_tables = document.getElementsByName(name);
	for (var p = 0; p < hide_all_tables.length; p++) 
		hide_all_tables[p].style.display = 'none';
	}	
	
function show_all_div_table(id) 	{
	var show_all = document.getElementById(id);
	var show_all_div = show_all.getElementsByTagName('div');
	for (var m = 0; m < show_all_div.length; m++) 
		show_all_div[m].style.display = 'block';
	}
	
	
function show_all_list_div_table(id) 	{
	var show_all_list = document.getElementById(id);
	var show_all_list_div = show_all_list.getElementsByTagName('div');
	for (var x = 0; x < show_all_list_div.length; x++) 
		show_all_list_div[x].style.display = ' list-item';
	}
	
function tables_all_headers_unselect(id) 	{
	var tables_all_headers = document.getElementById(id);
	var tables_all_headers_unselect = tables_all_headers.getElementsByTagName('div');
	for (var s = 0; s < tables_all_headers_unselect.length; s++) 
		tables_all_headers_unselect[s].className = 'tables_header_content_title';
	}

function show_div(id) 	{
	document.getElementById(id).style.display = "block";
	}	
	
function hide_other_comments(id) 	{
	document.getElementById(id).style.display = "none";
	}
	
function show_other_comments(id) 	{
	document.getElementById(id).style.display = "block";
	}	
	
function hide_form_comments(id) 	{
	document.getElementById(id).style.display = "none";
	}

function show_form_comments(id) 	{
	document.getElementById(id).style.display = "block";
	}

function comments_header_select(id) 	{
	document.getElementById(id).className = "comments_header_content_title comments_header_content_selected_title comments_header_content_triangle";
	}	

function comments_header_unselect(id) 	{
	document.getElementById(id).className = "comments_header_content_title";
	}	
	
function hide_commnets_form(id) 	{
	document.getElementById(id).className = "none";
	}
	
// nie uzywaene
function hide_submenu(id) 	{
	var submenu = document.getElementById(id);
	var submenu_div = submenu.getElementsByTagName('div');
	for (var k = 0; k < submenu_div.length; k++) 
		submenu_div[k].style.display = 'none';
	}
		
// nie uzywaene
function show_submenu(id) 	{
	if(document.getElementById(id))
		document.getElementById(id).style.display = "block";
	}
	
// nie uzywaene	
function show_hide_submenu(id_submenu, id_div) 	{
	hide_submenu(id_submenu);
	document.getElementById(id_div).style.display = "block";
	}



function clearField(field) {
	if (field.value == field.defaultValue) {
		field.value = "";
		}
	}

function checkField(field) {
	if (field.value == "") {
		field.value = field.defaultValue;
		}
	}
// arek


function light_menu(id) {
	var el = document.getElementById('menu_'+id);
	if(current > 0)	{
		document.getElementById('menu_'+current).style.color='#000000';
		document.getElementById('menu_'+current).style.backgroundImage='none';
		}
		el.style.color='#FFFFFF';
		el.style.backgroundImage="url('http://www-1.sport1.pl/templates/Sport1/images/menu2_level1_arrow.gif')";
		el.style.backgroundPosition="top center";
		el.style.backgroundRepeat="no-repeat";
	current = id;
	}

	

function hide_tables(id) 	{
	document.getElementById(id).style.display = "none";
	}
	
function show_tables(id) 	{
	document.getElementById(id).style.display = "block";
	}

function tables_header_select(id) 	{
	document.getElementById(id).className = "tables_header_content_title tables_header_content_selected_title tables_header_content_triangle";
	}	

function tables_header_unselect(id) 	{
	document.getElementById(id).className = "tables_header_content_title";
	}	
		
	
	function send_report_ajax(team_name) {
		if(team_name != 0)
		{
			if (document.getElementById) {
				advAJAX.get({
					url: "./includes/ajax/a_send_reports.php?team_name="+team_name,
					onLoading : function(obj) { document.getElementById('reports_send').innerHTML = 'Trwa ładowanie'; },
					onSuccess : function(obj) { document.getElementById('reports_send').innerHTML = obj.responseText },
					onError : function(obj) { alert("Przepraszam ale coś nie działa"); }
				});
			} else alert("Twioja przeglądarka nie obsluguje tej wersji JavaSctipt");
		}
	}
	