//***************************************
//        
//        Design by  Victor Sazonov
//        http://www.sazonov.gtwar.com
//        sazonov@gtwar.com     
//***************************************



if (navigator.appName.indexOf('Microsoft')>=0)
    { var msie=true }
  else
    { var msie=false };


//***************************************
//      Pop up window
//  i=number picture
// Group=name catalogue
// Width&Height=beat pop up window
//               
//***************************************
function explain(i,Width,Height) {
    var fileName = i;
    var features = "width=" + Width + ",height=" + Height + ",menubar=no";
    window.open(fileName,"explWin",features);
                  }

//***************************************
//      Navigation
//***************************************

  if (document.images) {
t1on = new Image;		t1on.src = "img/b_home_off.gif";
t2on = new Image;		t2on.src = "img/b_menu_off.gif";
t3on = new Image;		t3on.src = "img/b_gallery_off.gif";
t4on = new Image;		t4on.src = "img/b_news_off.gif";
t5on = new Image;		t5on.src = "img/b_contacts_off.gif";

	
t1off = new Image;	t1off.src = "img/b_home_on.gif";
t2off = new Image;	t2off.src = "img/b_menu_on.gif";
t3off = new Image;	t3off.src = "img/b_gallery_on.gif";
t4off = new Image;	t4off.src = "img/b_news_on.gif";
t5off = new Image;	t5off.src = "img/b_contacts_on.gif";

	
 }

    function active(imgName) {
	if (document.images) {
	imgOn = eval(imgName + "on.src");
	document [imgName].src = imgOn; }
    }

    function passive(imgName) {
	if (document.images) {
	imgOff = eval(imgName + "off.src");
	document [imgName].src = imgOff; }
    }



//***************************************
//      Mail form
//***************************************

txt = new Object();

			var cnt=-1;
			var strMesg="                             ";
			var strLen=strMesg.length;
			var counter=-1;
			var strObj;
			startHelp=0;
			textDelay=80;

			function helpText(strObj)
			{
				if(startHelp)
				{
					curObj=strObj;
					// strObj.focus();
					clearTimeout(cnt);
					strObj.value+=strMesg.charAt(counter);
					counter++;
					if (counter>strLen)
					{
						strObj.value='';
						startHelp=0;
						return;
					}
					cnt=setInterval("helpText(eval(curObj))",textDelay);
				};
			}

			function checkRequest( formName )
			{
				thisForm=document.forms[ formName ];
			txt.validateObj = thisForm.Name;
							if (txt.validateObj)
							{
								// FullName : Begin
								if (txt.validateObj.value.length < 2 || !isNaN(txt.validateObj.value))
								{
									strMesg="Впишите Ваше имя...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									alert("clear!");
									helpText(txt.validateObj);
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
							}
							// FullName : End
			txt.validateObj = thisForm.Surname;
							if (txt.validateObj)
							{
								// FullName : Begin
								if (txt.validateObj.value.length < 2 || !isNaN(txt.validateObj.value))
								{
									strMesg="Впишите Вашу фамилию...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									alert("clear!");
									helpText(txt.validateObj);
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
							}
							// FullName : End
			txt.validateObj = thisForm.__mailform_replyTo;
							if (txt.validateObj)
							{
								// EmailAddr : Begin
								if (txt.validateObj.value.length < 5)
								{
									strMesg="Впишите Ваш E-mail...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								em=0;
								em=txt.validateObj.value.indexOf("@");
								if (em==-1)
								{
									strMesg="Некорректный адрес...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								emp=0;
								emp=txt.validateObj.value.indexOf(".");

								if (emp==-1)
								{
									strMesg="Некорректный адрес...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}
								// EmailAddr : End
txt.validateObj = thisForm.Phone;
							if (txt.validateObj)
							{
								// FullName : Begin
								if (txt.validateObj.value.length < 2 || !isNaN(txt.validateObj.value))
								{
									strMesg="Впишите Ваш телефон...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									alert("clear!");
									helpText(txt.validateObj);
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
							}
							// Phone : End

			txt.validateObj = thisForm.Comments;
							if (txt.validateObj)
							{
								// FullName : Begin
								if (txt.validateObj.value.length < 2 || !isNaN(txt.validateObj.value))
								{
									strMesg="Впишите Ваше сообщение...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									alert("clear!");
									helpText(txt.validateObj);
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
							}
							// Comments : End


<!-- -->
							}
			

				return(true);
			}

			function FormFocus()
			{
			//	thisForm=document.forms['validateForm'];

			//	txt.validateNameObj = thisForm.validateName;
			//	txt.validateNameObj.focus();
			}

			function ResetForm()
			{
			//	thisForm=document.forms['validateForm'];

			//	txt.validateNameObj = thisForm.validateName;
			//	txt.validateTitleObj = thisForm.validateTitle;
			//	txt.validateCompanyObj = thisForm.validateCompany;
			//	txt.validateObj = thisForm.validateEmail;
			//	txt.validateRecordObj = thisForm.validateRecord;
			//	txt.validateMessageObj = thisForm.validateMessage;

			//	thisForm.reset();

			//	txt.validateNameObj.value="";
			//	txt.validateTitleObj.value="";
			//	txt.validateCompanyObj.value="";
			//	txt.validateRecordObj.options[0].selected=true;
			//	txt.validateObj.value="";
			//	txt.validateMessageObj.value="";
			}