/* JavaScript file */

function wopen2(imgName, w , h, Title)
{
	var left, top;
	left = screen.width / 2 - (w / 2);
	top = screen.height / 3 - (h / 3);
	var wo = window.open("", "abc", "width=" + w + ", height=" + h + ", scrollbars=0, status=0, left=" + left + ", top=" + top );
	wo.document.open();
	var win = "";
	win = "<html><head>";
	win += "<title>" + Title + "</title>";
	win += "<style type='text/css'> * {margin:0; padding:0; border:0; } img  {cursor:pointer;} </style> </head>"
	win += "<body>";
	win += "<table cellpadding='0' cellspacing='0' width='100%' height='100%'><tr><td align='center'>";
	win += "<a href='#' onClick='self.window.close();'><img src='" + imgName + "'></a>";
	win += "</td></tr></table>";
	win += "</body></html>";
	w += 20;
	h += 52;
	wo.window.resizeTo(w, h);
	wo.document.write(win);
	wo.window.focus();
	wo.document.close();
}

function wopenbanner(imgName, w , h, Title)
{
	var left, top;
	left = screen.width / 2 - (w / 2);
	top = screen.height / 3 - (h / 3);
	var wo = window.open("", "abc", "width=" + w + ", height=" + h + ", scrollbars=yes,menubar=yes, status=0, left=" + left + ", top=" + top );
	wo.document.open();
	var win = "";
	win = "<html><head>";
	win += "<title>" + Title + "</title>";
	win += "<style type='text/css'> * {margin:0; padding:0; border:0; } img  {cursor:pointer;} </style> </head>"
	win += "<body>";
	win += "<table cellpadding='0' cellspacing='0' width='100%' height='100%'><tr><td align='center'>";
	win += "<a href='#' onClick='self.window.close();'><img src='" + imgName + "'></a>";
	win += "<div align='center' style='margin-top:25px'>Для того, что бы распечатать картинку нужно в окне браузера выбрать опцию файл, далее печать. Далее откроется окно настройки печати принтера. В нём обязательным условием нужно поставить альбомную печать страницы</div>";
	win += "<div align='center' style='margin-top:5px'>Для того, чтобы сохранить рисунок на своём компьютере, нужно кликнуть на рисунок правой кнопкой мыши и в контекстном меню выбрать опцию <b>Сохранить как</b>, потом указать директорию сохранения рисунка. Рисунок сохранён!</div>";
	win += "</td></tr></table>";
	win += "</body></html>";
	w += 20;
	h += 250;
	wo.window.resizeTo(w, h);
	wo.document.write(win);
	wo.window.focus();
	wo.document.close();
}

var arr = new Array("progrTbl1", "progrTbl2", "progrTbl3", "progrTbl4", "progrTbl5");

function changeProgramme(tbl, img) {
		for(var i=1; i<arr.length; i++)
			{
				if (document.getElementById('progrTbl' + i)) 
					document.getElementById('progrTbl' + i).style.display = "none";
			}
		if (document.getElementById(tbl))  document.getElementById(tbl).style.display = "block";
		if (document.getElementById('imageProg')) document.getElementById('imageProg').src = img;
		if (tbl=='progrTbl4')
		{
			document.getElementById('topBgr').className="bgrTopNight"
		}
		else if (tbl=='progrTbl1' || tbl=='progrTbl2' || tbl=='progrTbl3')
		{
			document.getElementById('topBgr').className="bgrTop";
		}
		if (tbl=='progrTbl1')
		{
			document.getElementById('bottomProgramme').src="/i/bottom_image/morning.png";
			document.getElementById('bottomProgramme').width="464";
			document.getElementById('bottomProgrammeDiv').className="morningBottom";
			document.getElementById('moon').className="moonnone";
			document.getElementById('sun').className="sunprogrammyes";
			document.getElementById('footer_innernight').className="footer_inner";
			
		}
		else if (tbl=='progrTbl2')
		{
			document.getElementById('bottomProgramme').src="/i/bottom_image/afternoon.png";
			document.getElementById('bottomProgramme').width="478";
			document.getElementById('bottomProgrammeDiv').className="afternoonBottom";
			document.getElementById('moon').className="moonnone";
			document.getElementById('sun').className="sunprogrammyes";
			document.getElementById('footer_innernight').className="footer_inner";
		}
		else if (tbl=='progrTbl3')
		{
			document.getElementById('bottomProgramme').src="/i/bottom_image/evening.png";
			document.getElementById('bottomProgramme').width="514";
			document.getElementById('bottomProgrammeDiv').className="eveningBottom";
			document.getElementById('moon').className="moonnone";
			document.getElementById('sun').className="sunprogrammyes";
			document.getElementById('footer_innernight').className="footer_inner";
		}
		else if (tbl=='progrTbl4')
		{
			document.getElementById('bottomProgramme').src="/i/bottom_image/night.png";
			document.getElementById('bottomProgramme').width="310";
			document.getElementById('bottomProgrammeDiv').className="nightBottom";
			document.getElementById('footer_innernight').className="footer_innerbottomnight";
			document.getElementById('sun').className="sunprogrammnone";
			document.getElementById('moon').className="sunprogrammnightDIV";
			document.getElementById('topBgr').className="bgrTopNight";			
		}
}
		
		
function openWin(popup_name,popup_url,popup_with,popup_height)
{
if(!popup_with) {popup_with = 400;}
if(!popup_height) {popup_height = 200;}
        var popup_left = (window.screen.width/2)  - (popup_with/2 + 10);
        var popup_top  = (window.screen.height/2) - (popup_height/2 + 40);
        var fenster = window.open(popup_url,popup_name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + popup_with + ",height=" + popup_height + ",left=" + popup_left + ",top=" + popup_top + ",screenX=" + popup_left + ",screenY=" + popup_top);
        fenster.focus();

}

/*
function showhide(mut){
		var d2 = document.getElementById("mut_container");
					var dc2 = d2.getElementsByTagName("div");
					for (i=0; i<dc2.length; i++) {
						dc2[i].style.display = "none";
					}
		var s1 = document.getElementById(mut);
		s1.style.display = "block";
		var s2 = s1.getElementsByTagName("div");
				for (i=0; i<s2.length; i++) {
					if (s2[i].id!='imageProgramme'){
					}
					s2[i].style.display = "block";
				}
		}
*/
		
		function link_hover_click (spanid){
					for (i=1; i<8; i++) {
						document.getElementById(i).className = "select_color_text";
					}		
		document.getElementById(spanid).className = "select_color_text_selected";
		}




