function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->

re = /^[a-zA-Z0-9_\-\.]{1,}@[a-zA-Z0-9_\-\.]{1,}\.[a-zA-Z0-9_\-\.]{2,}$/;

function testMail()
{
	OK = re.exec(document.all['subscribeForm'].eMail.value);
	if (!OK)
	{
		window.alert ("Вы ввели неправильный E-mail адрес\nПопробуйте еще раз");
		return false;
	}
	else
	{
		mailWindow = window.open('', 'mailWindow', 'width=400, height=100, left=20, top=20, toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no')
		mailWindow.focus();
		return true;
	}
}

//-----------------------------------------------------------------------------
// variables
//-----------------------------------------------------------------------------

var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
var isMinMoz = (document.getElementById && isMinNS4) ? true : false;

// открытие окна для live operator
// -------------------------------
function openLive(){
userWindow = window.open('directConnect/index.html', 'userWindow', 'width=503, height=400, left=20, top=20, toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
userWindow.focus();
}

// открытие окна для плана этажа
// -----------------------------
function openPlan(fileName)
{
	my_top  = 0;
	my_left = 0;
	
	my_width  = 820;
	my_height = 480;

	myNewWindow=window.open('showPlan.php?fileName='+fileName,'','toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+my_width+',height='+my_height+',top='+my_top+',left='+my_left);
} 

// открытие окна
// -------------
function openNewWindow(fileName,my_width,my_height)
{
	my_top  = Math.ceil(Math.random() * 100);
	my_left = Math.ceil(Math.random() * 100);
	my_height = my_height + 35;

	myNewWindow=window.open(fileName,'','toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+my_width+',height='+my_height+',top='+my_top+',left='+my_left);
} 

// открытие окна для флэша
// -----------------------
function openNewWindow2(fileName,my_width_height)
{
myNewWindow=window.open(fileName,'','toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,' + my_width_height + ',top=0,left=0');
} 

// открытие окна для анкеты
// ------------------------
function openNewWindow3(fileName,my_width,my_height)
{
myNewWindow=window.open(fileName + '?from=7211000.ru','','toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+my_width+',height='+my_height+',top=0,left=0');
} 

// открытие окна для анкеты
// ------------------------
function openNewWindow4(fileName,my_width,my_height)
{
myNewWindow=window.open(fileName,'','toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+my_width+',height='+my_height+',top=0,left=0');
} 

// are you sure
// ------------
function areYouSure(stringName){
    return confirm(stringName);
}

// Over for flash
//-----------------------------

function flashSendVar(movieName, variable, varValue)
{
	tmpObj = eval('document.all["' + movieName + '"]');
	tmpObj.SetVariable(variable, varValue);
	return 1;
}

//-----------------------------------------------------------------------------
// Layer utilities.
//-----------------------------------------------------------------------------

function hideLayer(layer) {

	if (isMinIE4 || isMinMoz)
		layer.style.visibility = "hidden";
  	else
	if (isMinNS4 && !isMinMoz)
    	layer.visibility = "hide";
}

//-----------------------------------------------------------------------------
// showLayer
//-----------------------------------------------------------------------------
function showLayer(layer) {

	if (isMinIE4 || isMinMoz)
    	layer.style.visibility = "visible";
	else
	if (isMinNS4 && !isMinMoz)
		layer.visibility = "show";
}

//-----------------------------------------------------------------------------
// getLayer
//-----------------------------------------------------------------------------
function getLayer(name) 
{
	if (isMinMoz)
  			return eval('document.getElementById("' + name + '")');

  	if (isMinNS4)
		return findLayer(name, document);

	if (isMinIE4)
	    	return eval('document.all.' + name);


  	return null;
}

// ----------------------------------------------------------------------------
//  findLayer
// ----------------------------------------------------------------------------
function findLayer(name, doc) {

  var i, layer;

  for (i = 0; i < doc.layers.length; i++) {
    layer = doc.layers[i];
    if (layer.name == name)
      return layer;
    if (layer.document.layers.length > 0)
      if ((layer = findLayer(name, layer.document)) != null)
        return layer;
  }
  return null;
}

// ----------------------------------------------------------------------------
//  findLayer
// ----------------------------------------------------------------------------
function moveLayerTo(layer, x, y) {

	if (isMinMoz || isMinIE4)
	{
    	layer.style.left = x;
	    layer.style.top  = y;
  	}

	if (isMinNS4)
    	layer.moveTo(x, y);
}

// ----------------------------------------------------------------------------
//  centerPosition
// ----------------------------------------------------------------------------
function centerPosition(layer, width, height)
{
	realObj = getLayer(layer);
	objNewLeft = Math.ceil((getWindowWidth() - width) / 2);	
	objNewTop = Math.ceil((getWindowHeight() - height) / 2);	

	moveLayerTo(realObj, objNewLeft, objNewTop);
	
	return false;
}

//-----------------------------------------------------------------------------
// Layer utilities.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Window and page properties.
//-----------------------------------------------------------------------------

function getWindowWidth() {

  if (isMinNS4)
    return window.innerWidth;
  if (isMinIE4)
    return document.body.clientWidth;
  return -1;
}

function getWindowHeight() {

  if (isMinNS4)
    return window.innerHeight;
  if (isMinIE4)
    return document.body.clientHeight;
  return -1;
}
//-----------------------------------------------------------------------------
// Window and page properties.
//-----------------------------------------------------------------------------

<!--
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->