var vec_gps;

var lumen_arr = new Array();

var gshow;

var fsize;

function main()
	{
	lumen_arr[ 0 ] = { x:128, y:74,	 path:'url( "images/ton.gif" )', title:'Новостная лента' };
	lumen_arr[ 1 ] = { x:100, y:158, path:'url( "images/toh.gif" )', title:'История клуба' };
	lumen_arr[ 2 ] = { x:246, y:97,  path:'url( "images/aot.gif" )', title:'О нашей команде' };
	lumen_arr[ 3 ] = { x:477, y:153, path:'url( "images/og.gif" )',	 title:'Календарь игр' };
	lumen_arr[ 4 ] = { x:564, y:290, path:'url( "images/os.gif" )',	 title:'Наши спонсоры' };
	lumen_arr[ 5 ] = { x:425, y:89,	 path:'url( "images/gl.gif" )',	 title:'Галерея' };
	}
	
var lumen;
function my_reaction( show )
	{
	vec_gps = getAbsPos( document.getElementById('id_gps') );
	
	lumen = document.getElementById('id_lumen');
	lumen.style.visibility		= 'visible';
	
	lumen.style.backgroundImage = lumen_arr[ show ].path;
	lumen.style.left			= vec_gps.x + lumen_arr[ show ].x;
	lumen.style.top				= lumen_arr[ show ].y;
	}

function my_page_title( show )
	{
	gshow = show;
	}
	
function my_reaction2( hide )
	{
	lumen.style.visibility		= 'hidden';
	}

var nheight;
var nwindow;
var na;
function show_news( id, size )
	{
	nwindow = document.getElementById( id );
	na = document.getElementById( 'a'+id );
	na.innerHTML = '...компактный вид';
	
	show_news_liberty_roll( na, nwindow, size, 1 );
	}

var window2;
var size2;
function show_news_liberty_roll( a, window, size, dir )
	{
	var height = parseFloat( window.style.height );
	if( height != 93 && dir )
		{
		a.innerHTML = 'читать всю новость...';
		window.style.height = 93;
		return;
		}
	
	window2 = window;
	size2 = size;
	dir2 = dir;
	
	var step = Math.abs(size - height) / 10;
	step += (step < 3);
	step = Math.ceil( step );
	
	window.style.height = height + step;
	
	if( height < size )
		{
		setTimeout('show_news_liberty_roll( \'ы\', window2, size2, 0 )',10);
		}
	}

var d_gABSp_coord;
function getAbsPos(p)
	{
	d_gABSp_coord = { x:0, y:0 };
    while( p.offsetParent )
		{
        d_gABSp_coord.x += p.offsetLeft;
        d_gABSp_coord.y += p.offsetTop;
        p = p.offsetParent;
        }
    return d_gABSp_coord;
    }
	
function fak()
	{
	ent_timer = document.getElementById( 'bibi' );
	
	game_date_sec = ((gdate.d*24+gdate.h)*60 + gdate.m)*60 + gdate.s;
	curr_date_sec = ((cdate.d*24+cdate.h)*60 + cdate.m)*60 + cdate.s;
	sec_remaining = game_date_sec - curr_date_sec;
	
	timer = { d:0, h:0, m:0, s:0 };
	
	timer.d = Math.floor( sec_remaining / 60 / 60 / 24 );
	timer.h = Math.floor( sec_remaining / 60 / 60 - timer.d*24 );
	timer.m = Math.floor( sec_remaining / 60 - (timer.d*24 + timer.h)*60 );
	timer.s = Math.floor( sec_remaining - ((timer.d*24 + timer.h)*60 + timer.m)*60 );
	
	if( ent_timer )
		{
		if( timer.d < 0 )
			{
			ent_timer.rows[1].cells[1].innerHTML = 0;
			ent_timer.rows[2].cells[1].innerHTML = 0;
			ent_timer.rows[3].cells[1].innerHTML = 0;
			ent_timer.rows[4].cells[1].innerHTML = 0;
			}
		else
			{
			ent_timer.rows[1].cells[1].innerHTML = timer.d;
			ent_timer.rows[2].cells[1].innerHTML = timer.h;
			ent_timer.rows[3].cells[1].innerHTML = timer.m;
			ent_timer.rows[4].cells[1].innerHTML = timer.s;
			}
		}
	
	cdate.s++;
	
	setTimeout( 'fak();', 1000 );
	}
	
function gallery( s )
	{
	photo_cur += s;
	
	if( photo_cur < 0 )
		{
		photo_cur = photo_cnt;
		}
	
	if( photo_cur > photo_cnt )
		{
		photo_cur = 0;
		}
	
	return photo_cur;
	}
	
var sh;
function show_me_enter_window()
	{
	if( !sh )
		{
		sh = 1;
		document.getElementById('id_enter_window').style.visibility = 'visible';
		document.getElementById('id_enter_x').innerHTML = 'Спрятать';
		document.getElementById('id_enter_x').style.color = "#000000";
		}
	else
		{
		sh = 0;
		document.getElementById('id_enter_window').style.visibility = 'hidden';
		document.getElementById('id_enter_x').innerHTML = 'Вход';
		document.getElementById('id_enter_x').style.color = "";
		}
	}
