	function preload_img(path)
	{
		var img = new Image;
		img.src = path;
	}

	ticker_right_cur = 'matches';
	ticker_right_cur_i = 1;
	
	function ticker_right_change (tab, pos)
	{
		if (ticker_right_cur != tab)
		{
			$('right_ticker_head').addClass('right_ticker_head'+pos);
			$('right_ticker_head').removeClass('right_ticker_head'+ticker_right_cur_i);
			
			$('right_ticker_head_'+ticker_right_cur_i).removeClass('right_ticker_head_'+ticker_right_cur_i+'_active');
			$('right_ticker_head_'+pos).addClass('right_ticker_head_'+pos+'_active');
	
			document.getElementById('ticker_main_'+ticker_right_cur).style.display = 'none';
			document.getElementById('ticker_main_'+tab).style.display = '';
			$('ticker_main_'+tab).fade('hide');
			$('ticker_main_'+tab).fade('in');
	
			ticker_right_cur = tab;
			ticker_right_cur_i = pos;
		}
	}
	
	ticker_left_cur = 'headlines';
	ticker_left_cur_i = 1;
	if (Cookie.read('mysc_ticker_left_tabpos'))
	{
		ticker_left_cur = Cookie.read('mysc_ticker_left_tabtit');
		ticker_left_cur_i = Cookie.read('mysc_ticker_left_tabpos');
	}
	
	function ticker_left_change (tab, pos)
	{
		if (ticker_left_cur != tab)
		{
			$('box_left_top').addClass('box_left_top'+pos);
			$('box_left_top').removeClass('box_left_top'+ticker_left_cur_i);
			
			$('box_left_tab_'+ticker_left_cur_i).removeClass('box_left_tab_'+ticker_left_cur_i+'_active');
			$('box_left_tab_'+pos).addClass('box_left_tab_'+pos+'_active');
			
			document.getElementById('box_left_send_'+ticker_left_cur).style.display = 'none';
			document.getElementById('box_left_send_'+tab).style.display = '';
	
			document.getElementById('box_left_'+ticker_left_cur).style.display = 'none';
			document.getElementById('box_left_'+tab).style.display = '';
			$('box_left_'+tab).fade('hide');
			$('box_left_'+tab).fade('in');
	
			ticker_left_cur = tab;
			ticker_left_cur_i = pos;
			
			// set cookie
			Cookie.write('mysc_ticker_left_tabtit', ticker_left_cur, {path: '/'});
			Cookie.write('mysc_ticker_left_tabpos', ticker_left_cur_i, {path: '/'});
		}
	}
	
	function swap (id)
	{
		swap_close = 'http://www.gs-media.de/img/themes/mystarcraft/swap_close.gif';
		swap_open = 'http://www.gs-media.de/img/themes/mystarcraft/swap_open.gif';
		
		if ($('swap_'+id+'_element').style.display == 'none')
		{
			// open
				$('swap_'+id+'_element').style.display = ''
				$('swap_'+id+'_trigger').src = swap_open
		}
		else
		{
			// close
				$('swap_'+id+'_element').style.display = 'none'
				$('swap_'+id+'_trigger').src = swap_close
		}
	}
	
	function live_popup(url)
	{
		window.open('http://www.mystarcraft.de/de/live/'+url+'/1', 'stream_popup_'+url, 'width=972,height=660,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');
	}
	
	function live_chat(url)
	{
		window.open('http://www.mystarcraft.de/de/live/'+url+'/2', 'stream_chat_'+url, 'width=972,height=660,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no');
	}
