<!--
function whole()
{ var msg="",str=document.contact.c_E_MAIL.value,all; 
if (document.contact.a_NAME.value=='') msg='Ф.И.О.,\n'; 
if (document.contact.b_PHONE.value=='') msg+="Тел./факс ,\n"; 
if (str.indexOf('@')==-1) 
{
msg+='e-mail \nнеобходимо заполнить'; 
window.alert(msg); return false; 
}
else
{ 
return true; 
} 
}
function email()
{ var msg="",str=document.contact.c_E_MAIL.value,all; 
if (document.contact.a_NAME.value=='')msg='Ф.И.О. ,\n'; 
if (str.indexOf('@')==-1) 
{msg+='e-mail \nнеобходимо заполнить'; 
window.alert(msg); return false; 
}else{ 
return true; 
} 
} 
function fax()
{ var msg=""; 
if (document.contact.a_NAME.value=="") msg="Ф.И.О.,\n"; 
if (document.contact.b_PHONE.value=="")
{msg+="Тел./факс ,\nнеобходимо заполнить"; 
window.alert(msg); return false; 
} 
else 
{ return true; 
} 
} 

// this function is for contact

function Check()
{ 
var msg="", str=document.contact.c_E_MAIL.value, all; 
if (document.contact.d_SEND_BY_FAX.checked==0&&document.contact.e_E_MAIL_PRICE.checked==0&&document.contact.f_E_MAIL_SUBSCRIBE.checked==0&&document.contact.a_NAME.value==""&&document.contact.b_PHONE.value==""&&document.contact.c_E_MAIL.value==""&&document.contact.g_MESSAGE.value=="") 
{ 
window.alert("НИ ОДНО ПОЛЕ НЕ ЗАПОЛНЕНО,\n ФОРМА НЕ БУДЕТ ОТОСЛАНА!"); 
return false; 
} 
else 
{ 
if ((document.contact.d_SEND_BY_FAX.checked&&document.contact.e_E_MAIL_PRICE.checked)||(document.contact.d_SEND_BY_FAX.checked&&document.contact.f_E_MAIL_SUBSCRIBE.checked)) return whole(); 
if (document.contact.e_E_MAIL_PRICE.checked||document.contact.f_E_MAIL_SUBSCRIBE.checked) return email(); 
if (document.contact.d_SEND_BY_FAX.checked||document.contact.g_MESSAGE.value!="")return fax(); 
} 
}

function eng_whole()
{ var msg="",str=document.contact.c_E_MAIL.value,all; 
if (document.contact.a_NAME.value=='') msg='NAME,\n'; 
if (document.contact.b_PHONE.value=='') msg+="Tel/Fax ,\n"; 
if (str.indexOf('@')==-1) 
{
msg+='e-mail \nmust be entered!'; 
window.alert(msg); return false; 
}
else
{ 
return true; 
} 
}
function eng_email()
{ var msg="",str=document.contact.c_E_MAIL.value,all; 
if (document.contact.a_NAME.value=='')msg='NAME,\n'; 
if (str.indexOf('@')==-1) 
{msg+='e-mail \nmust be entered!'; 
window.alert(msg); return false; 
}else{ 
return true; 
} 
} 
function eng_fax()
{ var msg=""; 
if (document.contact.a_NAME.value=="") msg="NAME,\n"; 
if (document.contact.b_PHONE.value=="")
{msg+="Tel/Fax \nmust be entered!"; 
window.alert(msg); return false; 
} 
else 
{ return true; 
} 
} 

// this function is for eng_contact

function eng_Check()
{ 
var msg="", str=document.contact.c_E_MAIL.value, all; 
if (document.contact.d_SEND_BY_FAX.checked==0&&document.contact.e_E_MAIL_PRICE.checked==0&&document.contact.f_E_MAIL_SUBSCRIBE.checked==0&&document.contact.a_NAME.value==""&&document.contact.b_PHONE.value==""&&document.contact.c_E_MAIL.value==""&&document.contact.g_MESSAGE.value=="") 
{ 
window.alert("NO DATA ENTERED! \nTHE FORM WILL NOT BE SENT!"); 
return false; 
} 
else 
{ 
if ((document.contact.d_SEND_BY_FAX.checked&&document.contact.e_E_MAIL_PRICE.checked)||(document.contact.d_SEND_BY_FAX.checked&&document.contact.f_E_MAIL_SUBSCRIBE.checked)) return eng_whole(); 
if (document.contact.e_E_MAIL_PRICE.checked||document.contact.f_E_MAIL_SUBSCRIBE.checked) return eng_email(); 
if (document.contact.d_SEND_BY_FAX.checked||document.contact.g_MESSAGE.value!="")return eng_fax(); 
} 
}

// this function is for quick search
function search(){
if (document.find.opt[0].checked)
{
document.find.action="deposits.php";
//window.alert("Hi");
//return false;
}
if (document.find.opt[1].checked)
{document.find.action="firms.php";
}
if (document.find.opt[2].checked)
{document.find.action="production.php";
}
}

// this function is for newfirm end order

function checkForm (){
myArray= new Array();
myArray[0]=document.insert.name_rus;
myArray[1]=document.insert.obl;
myArray[2]=document.insert.address_rus;
myArray[3]=document.insert.CityCode;
myArray[4]=document.insert.Phone;
myArray[5]=document.insert.Description;
titles=new Array("Название", "Область", "Адрес", "Код города", "Телефон", "Вид деятельности");
var str;
for (var i= 0; i<6; i++)
{ 
	if (myArray[i].value==""||myArray[i].value==" "||myArray[i].value=="null")
 	{
	myArray[i].focus();
	str=titles[i];
	myArray[i].value=window.prompt ("Обязательное поле [ "+ str + " ] * должно быть заполнено! Пожалуйста, введите данные!",myArray[i].value); 
// confirm ("The required "+str+ "(*)  field must be entered! Please enter the correct data!");
		if (myArray[i].value==""||myArray[i].value==" "||myArray[i].value=="null")i--;			
	}															
}
if (document.insert.email.value==""||document.insert.email.value=="null")
	{
document.insert.email.value=="";
	}else
	{
while(document.insert.email.value.indexOf("@")==-1)
	{
(document.insert.email.value=window.prompt ("Неправильный e-mail адрес! Проверьте правильность заполнения!",document.insert.email.value)); 
	}//checkForm ();

	}

}

// this function is for eng_quick search

function eng_search(){
if (document.find.opt[0].checked)
{
document.find.action="eng_deposits.php";
//window.alert("Hi");
//return false;
}
if (document.find.opt[1].checked)
{document.find.action="eng_firms.php";
}
if (document.find.opt[2].checked)
{document.find.action="eng_production.php";
}
}

// this function is for eng_newfirm end eng_order

function eng_checkForm (){
myArray= new Array();
myArray[0]=document.insert.name_eng;
myArray[1]=document.insert.country;
myArray[2]=document.insert.address_eng;
myArray[3]=document.insert.CityCode;
myArray[4]=document.insert.Phone;
myArray[5]=document.insert.Description;
titles=new Array("COMPANY", "COUNTRY", "ADDRESS", "CITY CODE", "PHONE", "MAIN ACTIVITIES");
var str;
for (var i= 0; i<6; i++)
{ 
	if (myArray[i].value==""||myArray[i].value==" "||myArray[i].value=="null")
 	{
	myArray[i].focus();
	str=titles[i];
	myArray[i].value=window.prompt ("The required field [ "+ str + " ] * must be entered! Please, enter data!",myArray[i].value); 
// confirm ("The required "+str+ "(*)  field must be entered! Please enter the correct data!");
		if (myArray[i].value==""||myArray[i].value==" "||myArray[i].value=="null")i--;			
	}															
}
if (document.insert.email.value==""||document.insert.email.value=="null")
	{
document.insert.email.value=="";
	}else
	{
while(document.insert.email.value.indexOf("@")==-1)
	{
(document.insert.email.value=window.prompt ("Incorrect e-mail! Check it!",document.insert.email.value)); 
	}
	}
}

function mark_all()
{
var n;
var str="";
//if (document.Insert.elements.length)
//	{
n=(document.Insert.elements.length-3);
//window.alert(n);
var x, y;
for (var i=-1; i<n; i++)
		{
x=i+2;
y=x-1;
if (document.Insert.elements[y].value.indexOf("@")==-1)
			{
document.Insert.elements[x].checked=false;
			}	
else
			{
document.Insert.elements[x].checked=true;
			}
		}
//	}
}
//-->