// **************************************************************************************
// www.teamhb.org
// --------------------------------------------------------------------------------------
// competitions.js
//
// [ Javascript used for competitions module ]
// last update : 18.04.2009
//
// + 18.04.2009 - File brought to life
// --------------------------------------------------------------------------------------
// (c)2009 www.teamhb.org
// **************************************************************************************

var selectorVisible = 0;

function division_changed()
{
	var did = document.getElementById('select_div').value;
	var sea = document.getElementById('select_season').value;
	
	document.location.href = 'index.php?page=home&subpage=competitions&div_id='+did+'&showseason='+sea;
}

function season_changed()
{
	var did = document.getElementById('select_div').value;
	var sea = document.getElementById('select_season').value;
	
	document.location.href = 'index.php?page=home&subpage=competitions&div_id='+did+'&showseason='+sea;
}

function fire_tab1()
{
	document.getElementById('tab2_fill').style.backgroundImage='url(images/tabs/tab1_off.gif)';
	document.getElementById('tab2_rside').style.backgroundImage='url(images/tabs/tab1_off_side.gif)';
	document.getElementById('tab2_div').style.top='2px';
	
	document.getElementById('tab1_fill').style.backgroundImage='url(images/tabs/tab1_on.gif)';
	document.getElementById('tab1_rside').style.backgroundImage='url(images/tabs/tab1_on_side.gif)';
	document.getElementById('tab1_lside').style.backgroundImage='url(images/tabs/tab1_on_side.gif)';
	document.getElementById('tab1_div').style.top='0px';
	
	document.getElementById('league_table').style.display = '';
	document.getElementById('regional_cup').style.display = 'none';
	document.getElementById('bookmark_ico').style.display = '';
}
function fire_tab2()
{
	document.getElementById('tab2_fill').style.backgroundImage='url(images/tabs/tab1_on.gif)';
	document.getElementById('tab2_rside').style.backgroundImage='url(images/tabs/tab1_on_side.gif)';
	document.getElementById('tab2_div').style.top='0px';
	
	document.getElementById('tab1_fill').style.backgroundImage='url(images/tabs/tab1_off.gif)';
	document.getElementById('tab1_rside').style.backgroundImage='url(images/tabs/tab1_on_side.gif)';
	document.getElementById('tab1_lside').style.backgroundImage='url(images/tabs/tab1_off_side.gif)';
	document.getElementById('tab1_div').style.top='2px';
	
	document.getElementById('league_table').style.display = 'none';
	document.getElementById('regional_cup').style.display = '';
	document.getElementById('bookmark_ico').style.display = '';
}

function switch_selector()
{
	if (selectorVisible == 0)
	{
		document.getElementById('competition_selector').style.display='';
		document.getElementById('arr_down').style.display='none';
		document.getElementById('arr_up').style.display='';
		selectorVisible = 1;
	}
	else
	{
		document.getElementById('competition_selector').style.display='none';
		document.getElementById('arr_down').style.display='';
		document.getElementById('arr_up').style.display='none';
		selectorVisible = 0;
	}
}

function go_bookmark(comp_id)
{
	if (document.getElementById('league_table').style.display != 'none')
	{
		// === We are bookmarking league division ===
		var div_id = document.getElementById('select_div').value;
		document.location.href = 'index.php?page=tools&subpage=bookmarks&section=3&addcomp='+comp_id+'&adddiv='+div_id;
	}
	else if (document.getElementById('regional_cup').style.display != 'none')
	{
		// === We are bookmarking league division ===
		var div_id = 0;
		document.location.href = 'index.php?page=tools&subpage=bookmarks&section=3&addcomp='+comp_id+'&adddiv='+div_id;
	}
	
}
