var cur_lang = '';

function na_preload_img()
{
	var img_list = na_preload_img.arguments;
	if (document.preloadlist == null)
	document.preloadlist = new Array();
	var top = document.preloadlist.length;
	for (var i=0; i < img_list.length-1; i++) {
		document.preloadlist[top+i] = new Image;
		document.preloadlist[top+i].src = img_list[i+1];
	}
}

function na_change_img_src(name, nsdoc, rpath, preload)
{
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
	if (name == '')
	return;
	if (img) {
		img.altsrc = img.src;
		img.src    = rpath;
	}
}

function na_restore_img_src(name, nsdoc)
{
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
	if (name == '')
	return;
	if (img && img.altsrc) {
		img.src    = img.altsrc;
		img.altsrc = null;
	}
}
function SetLocTime(lang)
{
        if (cur_lang == '') {
           cur_lang = (lang == '' ? 'rus' : lang);
        }

	loc=new Date();
	locTimestamp=parseInt(loc.getTime()/1000);
	loc_off=loc.getTimezoneOffset()*60;
	curDate = new Date((tm+(locTimestamp-startTimestamp+(serv_off+loc_off)))*1000);
	SetTimer();
	if (call_date>=10)
	{
		call_date=0;
		SetDate();
	}
	call_date++;

	window.setTimeout('SetLocTime()',1000);
}


function SetTimer()
{

	h=curDate.getHours();
	if (h<10) h='0'+h;

	m=curDate.getMinutes();
	if (m<10) m='0'+m;

	s=curDate.getSeconds();
	if (s<10) s='0'+s;
	document.getElementById('clock').innerHTML=(h+':'+m+':'+s);

}

function SetDate()
{
	d=curDate.getDay();
	dat=curDate.getDate();
	mon=curDate.getMonth();
	y=curDate.getFullYear();
        if (cur_lang != 'eng') {
           document.getElementById('date').innerHTML=('<nobr>'+dat+' '+month_arr[mon]+' '+y+'</nobr>');
        } else {
           document.getElementById('date').innerHTML=('<nobr>'+month_arr[mon]+' '+dat+', '+y+'</nobr>');
        }
}

function ShowBanner(src, h, w)
{
	//alert ('hi!');
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
		'width', w,
		'height', h,
		'src', '/swf/'+src+'.swf',
		'quality', 'high',
		'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'exactfit',
		'wmode', 'window',
		'devicefont', 'false',
		'id', 'stan_tv',
		'bgcolor', '#ffffff',
		'name', 'stan_tv',
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'movie', '/swf/'+src,
		'salign', ''
		); //end AC code
	}
}

function TurnSound()
{
	if (s_on==1)
	{
		document.getElementById('s_link').title='Âêëþ÷èòü çâóê';
		document.getElementById('s_img').src='/img/icons/s_off.gif';
		//document.getElementById('s_link').onmouseover="na_change_img_src('sound', 'document', '/img/icons/s_on.gif', true)"
		s_on=0;
		StVol(-10000);
	}
	else
	{
		document.getElementById('s_link').title='Îòêëþ÷èòü çâóê';
		document.getElementById('s_img').src='/img/icons/s_on.gif';
		//document.getElementById('s_link').onmouseover="na_change_img_src('sound', 'document', '/img/icons/s_off.gif', true)"
		s_on=1;
		StVol(0);
	}



}

function StVol(vl)
{
	//alert (vl);
	//alert (document.clip.volume);
	if (document.getElementById('OnLineTVSet').volume!=undefined)
	{
		document.OnLineTVSet.volume=vl;
		//alert (document.getElementById('OnLineTVSet').volume);
	}
	else{
		//alert ('else');
		//document.OnLineTVSet_ff.setAttribute('volume',vl);
		document.OnLineTVSet_ff.SetMute(true);
		//alert (document.OnLineTVSet_ff.getAttribute('volume'));
	}
}
