function nw(a, id, foto, addit){
	var height = 420;
	if (typeof addit=="undefined"){addit=''};
	if (foto > 0){height = 560;}
	var popupWin = window.open('../re.php?a='+a+'&id='+id+'n'+addit, 'contacts'+id, 'location=false,width=610,height='+height+',resizable=1,scrollbars=1');
	popupWin.focus();
	return false
}
function nw_people(id){
	var height = 720;
	var popupWin = window.open('../people.php?a=show&id='+id+'&s=1', 'peoples'+id, 'location=false,width=710,height=720,resizable=1,scrollbars=1');
	popupWin.focus();
	return false
}
function showHideOnlineReq(){
	var style = document.getElementById('online-request-form').style.display;
	if (style == 'block'){
		document.getElementById('online-request-form').style.display = 'none';
		document.getElementById('online-request-text').className = 'onlinereqp';
		
	}else{
		document.getElementById('online-request-form').style.display = 'block';
		document.getElementById('online-request-text').className = 'onlinereqm';
	}
}

function chkOnlineForm(){
  if (check('orn-id','Пожалуйста, укажите свое имя')
    && check('orp-id','Пожалуйста, заполните поле телефон')
      && check('ore-id','Пожалуйста, укажите Ваш e-mail. Если его у Вас нет, поставьте прочерк.')){
        return true;
  }
  return false;
}
function chkAndSbmOnline(){
  if (chkOnlineForm()){
		document.getElementById('online-request-form').submit();
	}
	return false;
}
function check(el_id, msg){
	var el = document.getElementById(el_id);
	if(el.value == ''){
		alert(msg);
		el.focus();
		return false;
	}
	return true;
}
function add_next_file_input( element_name ) {
	//Create an input type dynamically.
	var element = document.createElement("input");

	//Assign different attributes to the element.
	element.setAttribute("type", 'file');
	element.setAttribute("name", 'uploaded_files[]');

	var foo = document.getElementById( element_name );
	
	//Append the element in page (in span).
	foo.appendChild(element);
	return false;
}