var layerRef='null', styleSwitch='null';
if (navigator.appName == 'Netscape') {
	layerRef='document.layers';
	styleSwitch='';
}else{
	layerRef='document.all';
	styleSwitch='.style';
}
var leftRef = 'null', topRef = 'null';
if (navigator.appName == 'Netscape') {
 leftRef = '.left';
 topRef = '.top';
}else{
 leftRef = '.pixelLeft';
 topRef = '.pixelTop';
}

function bgOn(a){
	document.getElementById('td_'+a).className='on';
}
function bgOff(a){
	document.getElementById('td_'+a).className='off';
}

function LineOn(b){
	document.getElementById('line1_'+b).className='LineOn';
	document.getElementById('line2_'+b).className='LineOn';
	document.getElementById('line3_'+b).className='LineOn';
	document.getElementById('line4_'+b).className='LineOn';
	document.getElementById('line_'+b).style.display='block';
}
function LineOff(b){
	document.getElementById('line1_'+b).className='LineOff';
	document.getElementById('line2_'+b).className='LineOff';
	document.getElementById('line3_'+b).className='LineOff';
	document.getElementById('line4_'+b).className='LineOff';
	document.getElementById('line_'+b).style.display='none'
}

function MoveLayer(layerName,topstop){
	if (eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+" > topstop")){
	  MoveLayerTop(layerName,topstop);
	}
	if (eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+" < topstop")){
	 MoveLayerDown(layerName,topstop);
	}
}

function MoveLayerTop(layerName,topstop){ 
	if (eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+" > topstop")){
	currTop=eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+"-10");
	eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+" = currTop");
	setTimeout("MoveLayerTop('"+layerName+"',"+topstop+")",70);
	} 
	else {
		eval(layerRef+"['"+layerName+"']"+styleSwitch+".top = topstop");		
	}
}
function MoveLayerDown(layerName,topstop){ 
	if (eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+" < topstop")){
	currTop=eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+"+10");
	eval(layerRef+"['"+layerName+"']"+styleSwitch+topRef+" = currTop");
	setTimeout("MoveLayerDown('"+layerName+"',"+topstop+")",100);
	} 
	else {
		eval(layerRef+"['"+layerName+"']"+styleSwitch+".top = topstop");		
	}
}

var timerID = null;
var timerRunning = false;

function stopclock (){
        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}
function showtime () {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
		var date = now.getDate();
		var year = now.getFullYear();
		var month = now.getMonth() + 1;
        //var seconds = now.getSeconds()
        var timeValue = ((hours >24) ? hours -24 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
		var dayValue = date+"."+((month >12) ? month -12 :month)+"."+year;
        //timeValue += ((seconds < 10) ? ":0" : ":") + seconds
        //timeValue += (hours >= 12) ? " Минск" : " Минск"
		document.getElementById('face').innerHTML=timeValue;
		document.getElementById('faceDate').innerHTML=dayValue;
        // you could replace the above with this
        // and have a clock on the status bar:
        //window.status = timeValue;
        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}

function startclock () {
        // Make sure the clock is stopped
        stopclock();
        showtime();
}

function timeLoad()
{
var time=setTimeout('',2600);
document.getElementById('timeFl').style.display="block";
document.getElementById('timeLogo').style.display="block";
}
function timeLoad2()
{
var fl=setTimeout('',1900);
document.getElementById('timePng').style.display="block";
document.getElementById('timeMn').style.display="block";
}
function timeLoad3()
{
var fl=setTimeout('',0);
document.getElementById('timeR').style.display="block";
}

