function blank(link, width, height, scrollbars)
{
  scrollwidth = scrollbars? 16: 0;
  window.open(link, '', 'width='+(width+scrollwidth)+', height='+height+', left='+(screen.width-width-scrollwidth)/2+', top='+(screen.height-50-height)/2+', titlebar=no, menubar=no, toolbar=no, location=no, status=no, scrollbars='+(scrollbars? 'yes': 'no')+', resizable=yes');
}

function file(name)
{
  blank('/files?name='+name, 640+16, 640+16, false);
}

function browser()
{
  isDOM = document.getElementById; //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
  isOpera = isOpera5 = window.opera && isDOM; //Opera 5+
  isOpera6 = isOpera && window.print; //Opera 6+
  isOpera7 = isOpera && document.readyState; //Opera 7+
  isMSIE = document.all && document.all.item && !isOpera; //Microsoft Internet Explorer 4+
  isMSIE5 = isDOM && isMSIE; //MSIE 5+
  isNetscape4 = document.layers; //Netscape 4.*
  isMozilla = isDOM && navigator.appName == "Netscape"; //Mozilla или Netscape 6.*
}

function detect_flash()
{
  isDOM = document.getElementById; //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
  isOpera = isOpera5 = window.opera && isDOM; //Opera 5+
  isOpera6 = isOpera && window.print; //Opera 6+
  isOpera7 = isOpera && document.readyState; //Opera 7+
  isMSIE = document.all && document.all.item && !isOpera; //Microsoft Internet Explorer 4+
  isMSIE5 = isDOM && isMSIE; //MSIE 5+
  isNetscape4 = document.layers; //Netscape 4.*
  isMozilla = isDOM && navigator.appName == "Netscape"; //Mozilla или Netscape 6.*

  ie = 0;
  f = 0;
  fz = 0;

  if(navigator.platform == 'Win32' && !window.opera && isMSIE)
  {
    ie = 1;

    for(i = 3; i < 10; i++)
      if(eval('new ActiveXObject("ShockwaveFlash.ShockwaveFlash.'+i+'")'))
        f = i;
  }

  if((ie == 0) && (navigator.plugins))
    for(i = 0; i < navigator.plugins.length; i++)
      if(navigator.plugins[i].name.indexOf('Flash') > -1)
      {
        fz = parseInt(navigator.plugins[i].description.charAt(16));
        if(fz > f)
          f = fz;
      }
}

function flash(v, fl, gif, w, h, alias, href)
{
  d = ' width='+w+' height='+h;

  if(f >= v)
  {
    /*document.write('<div class="fmenu"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+d+'width="+w" height="+h+"><param name=movie value='+fl+'><embed src='+fl+' quality=high'+d+'></embed></object></div>');*/

    document.write('<div id="swf_'+alias+'" class="fmenu"></div>');
    swf = new SWFObject(fl, '', w, h, v, '');
    swf.addParam('quality', 'best');
    swf.addParam('wmode', 'transparent');
    swf.addParam('menu', 'false');
    swf.addParam('play', 'true');
    swf.write('swf_'+alias);
  }
  else
    document.write('<div class="fmenu"><a '+href+'><img src='+gif+d+' border="0"/></a></div>');
}

function OnOverButton()
{
	var i = document.getElementById('but');
	i.src = "/files/button_pres_a.jpg";
}

function OnOutButton()
{
	var i = document.getElementById('but');
	i.src = "/files/button_pres.jpg";
}

function OnCheckForm()
{
	var person = document.getElementById('person');
	var email = document.getElementById('email');
	var formFlag=false;
	
	if(person.value == '') 
	 {
    	alert('Не заполнено поле имя');
		formFlag=false;
     }
	 else if(email.value == '')
	 {
		 alert('Не заполнено поле E-mail');
		formFlag=false;
	 }
	  else 
	 {
      	 formFlag=true;
     }
	 
	 return formFlag;
}
