﻿function newWindow(name, src) {
    window.open(src, name, "status=no,help=no,resizable=yes,scrollbars=yes ,width=500,height=700");
    return true;
}


function Write(value) 
{ 
    document.write(value); 
} 

function op(src, w, h) { 
   var wnd = window.open(src, "custom", "status=no,help=no,resizable=no,scrollbars=no,width=" + w + ",height=" + h); 
   wnd.opener = window; 
   wnd.focus();
} 

function StartTimer() {
	var timerObj = document.getElementById("idTime");
	if(timerObj) {
		CTimer();
		window.setInterval(CTimer, 1000*60);
	}
}

function CTimer() {
	var timerObj = document.getElementById("idTime");
	var wdays = new Array("Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота");
	var months = new Array("января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря");

	var time = new Date();
	
	sminutes = new String(time.getMinutes());
	if(sminutes.length == 1)
		sminutes = "0"+sminutes;
	shours = new String(time.getHours());
	if(shours.length == 1)
		shours = "0"+shours;
	
	var val = "в Москве: <strong>"+ shours+":"+sminutes+"</strong> "+wdays[time.getDay()]+", "+time.getDate()+" "+months[time.getMonth()]+" "+time.getFullYear()+" г.";
	timerObj.innerHTML = val;
}

function LoadComplete() {
	
	try {
		document.getElementById("loader").style.display = "none";
		document.getElementById("main").style.display = "";	
	} catch(e) {
		window.setTimeout('LoadComplete();', 2000);		
	}
}

window.onload = function(e) {
	// try to start a timer 
	StartTimer();
	
	// show all objects
	LoadComplete();
}

function setHackTimeOut() {
	window.setTimeout('LoadComplete();', 2000);
}
