browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion);

if (browser_name == "Netscape" && browser_version >= 3.0) { browser_ok = 'true'; }
else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 3.0) { 
browser_ok = 'true'; }
else { browser_ok = 'false'; }

function change(img, ref) {
   if (browser_ok == 'true') {
       document.images[img].src = ref;
   }
}

if (browser_ok == 'true')
{
 a1=new Image; a1.src="images/menu1_h.gif";
 a2=new Image; a1.src="images/menu2_h.gif";
 a3=new Image; a1.src="images/menu3_h.gif";
 a4=new Image; a1.src="images/menu4_h.gif";
 a5=new Image; a1.src="images/menu5_h.gif";
 a6=new Image; a1.src="images/menu6_h.gif";
 a7=new Image; a1.src="images/submenu1_h.gif";
 a8=new Image; a1.src="images/submenu2_h.gif";
 a9=new Image; a1.src="images/submenu3_h.gif";
a10=new Image; a1.src="images/submenu4_h.gif";
a11=new Image; a1.src="images/2pic1_h.gif";
a12=new Image; a1.src="images/2pic2_h.gif";
a13=new Image; a1.src="images/2pic3_h.gif";
a14=new Image; a1.src="images/2pic4_h.gif";
a15=new Image; a1.src="images/2pic5_h.gif";
a16=new Image; a1.src="images/2pic6_h.gif";
}

function popwin(w,h,path) { // Просмотр картики в новом окне; w, h - ширина, высота окна; path - путь картинки
	var x1 = (document.all) ? window.screenLeft : screenX;
	var x2 = (document.all) ? document.body.clientWidth : window.innerWidth;
	var y = (document.all) ? window.screenTop : screenY;
	var wleft = (x1 + (x2/2)) - (w/2);
	var wtop = 0;
	if (navigator.appName == 'Microsoft Internet Explorer') {
		wtop = y - 40;
	} 
	else {
		wtop = y + 40;
	}
	var feat = 'width=' + w + ',height=' + h + ',top=' + wtop + ',left=' + wleft + ',status=no,location=no,menubar=no,scrollbars=yes,resizable=yes,top=20,left=210,screenY=20,screenX=210';
	var popup = window.open('','svupopupwin',feat);
	var htmltext = '<html><head><title>ОАО &laquo;Дагэнерго&raquo; / Фотогалерея</title><link rel=stylesheet href=/style.css type=text/css></head><body bgcolor=EEEEEE leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0><table align=center cellpadding=0 border=0 cellspacing=0 width=100% height=100%><tr><td align=center valign=top width=100% height=100%><a href="javascript:self.close()"><img border=0 alt="закрыть окно" src=' + path + '></a><br><br><a href="javascript:self.close()">закрыть окно</a><br><br></td></tr></table></body></html>';
	popup.document.open();
	popup.document.write(htmltext);
	popup.document.close();
}

			function checkFields() {
				if (document.theForm.username.value == "") {
					alert('Введите имя!');
					document.theForm.username.focus();
					return false;
				}
				if (document.theForm.email.value == "" || document.theForm.email.value.indexOf('@', 0) == -1) {
					alert('Введите корректный e-mail!');
					document.theForm.email.focus();
					return false;
				}
				if (document.theForm.city.value == "") {
					alert('Введите город!');
					document.theForm.city.focus();
					return false;
				}
				if (document.theForm.phone.value == "") {
					alert('Введите Ваш телефон!');
					document.theForm.phone.focus();
					return false;
				}
				if (document.theForm.txt.value == "") {
					alert('Введите сообщение!');
					document.theForm.txt.focus();
					return false;
				}
				if (document.theForm.txt.value.length >= 2048) {
					document.theForm.txt.focus();
					alert('Слишком большое сообщение!');
					return false;
				}
				else { return true; }
			}			


			function checkFaqForm ( ) {
				if (document.FaqForm.username.value == "") {
					alert('Имя является обязательным!');
					document.FaqForm.username.focus();
					return false;
				}
				if (document.FaqForm.email.value == "" || document.FaqForm.email.value.indexOf('@', 0) == -1) {
					alert('Введите пожалуйста корректный e-mail!');
					document.FaqForm.email.focus();
					return false;
				}
				if (document.FaqForm.txt.value == "") {
					alert('Не оставляйте тело сообщения пустым!');
					document.FaqForm.txt.focus();
					return false;
				}
				if (document.FaqForm.txt.value.length >= 2048) {
					document.FaqForm.txt.focus();
					alert('Слишком большое сообщение!');
					return false;
				}
				else { return true; }
			}
