// JavaScript Document

function checkAll(form, group, element) {

	for (var i = new Number(0); i < document.forms[form].elements.length; i++)
		if ( document.forms[form].elements[i].getAttribute('group') == group) {
			document.forms[form].elements[i].checked = element.checked;
			eval('document.forms[\'' + form + '\'].elements[' + i + '].onclick = function(){unCheck(\'' + form + '\', \'' + element.getAttribute('name') + '\')}');
		}
	
}

function unCheck (form, nameCheckboxAll){

	document.forms[form].elements[nameCheckboxAll].checked = false;
}

function checksays() 
			{ //v3.0
			//alert("Не все, обязательные для заполнения поля, были заполнены!");
			  if (document.messageform1.firmname.value=="") 
			  	{
			     alert("Fill, please!");
				 document.messageform1.firmname.focus();
			     return false;
				}
			 if (document.messageform1.osnovanie.value=="") 
			  	{
			     alert("Fill, please!");
				 document.messageform1.osnovanie.focus();
			     return false;
				}
			if (document.messageform1.kontlitso.value=="") 
			  	{
			     alert("Fill, please!");
				 document.messageform1.kontlitso.focus();
			     return false;
				}
			  else return true;
			}
			
function checkinfoform() 
			{ //v3.0
			//alert("Не все, обязательные для заполнения поля, были заполнены!");
			  if (document.infoForm.companyname_new.value=="") 
			  	{
			     alert("Fill, please!");
				 document.infoForm.companyname_new.focus();
			     return false;
				}
			 if (document.infoForm.email_new.value=="") 
			  	{
			     alert("Fill, please!");
				 document.infoForm.email_new.focus();
			     return false;
				}
			if (document.infoForm.name_new.value=="") 
			  	{
			     alert("Fill, please!");
				 document.infoForm.name_new.focus();
			     return false;
				}
			  else return true;
			}

function checksub() 
			{ //v3.0
			//alert("Не все, обязательные для заполнения поля, были заполнены!");
			  if (document.sub.companyname_new.value=="") 
			  	{
			     alert("Fill, please!");
				 document.sub.companyname_new.focus();
			     return false;
				}
			 if (document.sub.email_new.value=="") 
			  	{
			     alert("Fill, please!");
				 document.sub.email_new.focus();
			     return false;
				}
			if (document.sub.name_new.value=="") 
			  	{
			     alert("Fill, please!");
				 document.sub.name_new.focus();
			     return false;
				}
			  else return true;
			}
function checkunsub() 
			{ //v3.0
			//alert("Не все, обязательные для заполнения поля, были заполнены!");
			 if (document.unsub.email_new.value=="") 
			  	{
			     alert("Пожалуйста, введите email!");
				 document.unsub.email_new.focus();
			     return false;
				}
			 return true;
			}
			
function checksubinfo() 
			{ //v3.0
			//alert("Не все, обязательные для заполнения поля, были заполнены!");
			 if (document.subinfo.email_new.value=="") 
			  	{
			     alert("Пожалуйста, введите email!");
				 document.subinfo.email_new.focus();
			     return false;
				}
			 return true;
			}

			
function AddAmount()
				{
					var form = document.pay_form;
					for (var i = 0; i < form.Amount.length; i++) {
						if (form.Amount[i].checked) {
							break;
						}
					}
					form.wbp_currencyamount.value += form.Amount[i].value; 
					return true;
				}

function pop()
{
	var w,h;
	w=window.screen.width;
	h=window.screen.height;
	if (h>700)
	{
		window.open("metro.html",null,"height=670,width=480,top=0,left=0,resizable=no,menubar=no,scrollbars=no,status=no,location=no");
	}
	else
	{
		window.open("metro.html",null,"height=540,width=500,top=0,left=0,resizable=no,menubar=no,scrollbars=yes,status=no,location=no");
	}
	return false;
}

function openInfo(url)
{
	newWin=window.open(url,'Photo','width=480,height=500,scrollbars=yes,top=0,left=0,resizable=yes');
	newWin.focus();
}



function visa_docs_detail(way)
{
	window.open(way, null, "width=350, height=450, left=10, top=10, location=0, toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, fullscreen=0, channelmode=0")
}


function getSelectValue( selectObject )
{
	return selectObject.options[selectObject.selectedIndex].value;
}

function go_bbs_country( selectObject, param )
{
	id = getSelectValue( selectObject );
	if ( id != "")
	{
		location.href = "http://spomir.ru/bbs/list&search=1&"+param+"="+id;
	}
}

function go_visa_country( selectObject, param )
{
	id = getSelectValue( selectObject );
	if ( id != "")
	{
		location.href = "http://spomir.ru/visa/consul&"+param+"="+id;
	}
}


