//function for menu resizing
function resizeLeftMenu(){
  var lm = document.getElementById("lcon");
  var rc = document.getElementById("rcon");
  lm.style.width="0";
  rc.style.width="100%";
  alert(lm.style.width);
  return true;
}

function loadTopBanner(){

    var windoxW = document.body.clientWidth; 

  if (windoxW>=1010){
  	if (AC_FL_RunContent == 0) {
  		alert("This page requires AC_RunActiveContent.js.");
  	} else {
  		AC_FL_RunContent(
  			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
  			'width', '990',
  			'height', '300',
  			'src', '/irp-header2',
  			'quality', 'high',
  			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
  			'align', 'middle',
  			'play', 'true',
  			'loop', 'true',
  			'scale', 'showall',
  			'wmode', 'transparent',
  			'devicefont', 'false',
  			'id', 'irp-header',
  			'bgcolor', '#ffffff',
  			'name', 'irp-header',
  			'menu', 'true',
  			'allowFullScreen', 'false',
  			'allowScriptAccess','sameDomain',
  			'movie', '/irp-header2',
  			'salign', '',
  			'flashVars', 'timeOut=700'
  			); //end AC code
  	}
  	}
  	else {
     document.write('<a href="/"><img width="790" height="280" border="0" src="/images/logo-splash.gif" alt="Институт региональной политики: мы создаем новую экономическую географию России" /></a>');   
    }
}

function check_backform() {
     var fields = new Array('fio','email','mes','captcha_word');
     var messages = new Array('Представьтесь пожалуйста','Введите E-mail','Введите сообщение','Введите код с картинки');
     var errField = document.getElementById("message");
     for (i=0;i<fields.length;i++) 
     if (eval('document.F1.'+fields[i]+'.value==""')) {
          errField.innerHTML = messages[i]; 
          eval('document.F1.'+fields[i]+'.focus()');
          return false;
      }

     if (!isValidEmail(document.F1.email.value)) {
          errField.innerHTML = 'Введен неверный адрес E-mail';
          document.F1.email.focus();
          return false;
     }

     return 1;
}
   
function isValidEmail(email) {
    re = /^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i;
    return re.test(email);
}

function hidemenu(){
  document.getElementById("projectleftmenu").style.display="none";
  return true;
}