var  pics = new Array();
/*434440000000000000000000000444*/
var objCount = 0; // количество изображений на  web-странице
var pict_dir="/ars_image/";

function errormsg()
{
	ScrWindow=window.open("/errorinsite","","toolbar=no,width=580,height=250,location=no,left=200,top=100,directories=no,scrollbars=no,бstatus=yes,menubar=no,resizable=yes");
	return false;
}
function preload(name, first, second) {

  // предварительна\я загрузка изображений и размещение их в массиве

    pics[objCount] = new Array(3);
    pics[objCount][0] = new Image();
    pics[objCount][0].src =pict_dir +first;
    pics[objCount][1] = new Image();
    pics[objCount][1].src = pict_dir+second;
    pics[objCount][2] = name;
    objCount++;
}

function on(name){
for (i = 0; i < objCount; i++) {
  if (name == pics[i][2]) {
       // показывать вторую картинку, поскольку курсор пересекает данное изображение
           document.images[pics[i][2]].src = pics[i][1].src;
    }
}
}

function off(name){
for (i = 0; i < objCount; i++) {
  if (name == pics[i][2]) {
       // показывать вторую картинку, поскольку курсор пересекает данное изображение
           document.images[pics[i][2]].src = pics[i][0].src;
    }
}
}

function jump_text(name){
document.getElementById(name).height =3;
//document.getElementById(name).style['padding-top']="0px";
//document.getElementById(name).style['vertical-align']="top";
//alert(name);
}

function und_line(name){
document.getElementById(name).style.textDecoration="underline";
//document.getElementById(name).style.color="red";
//alert(name);
}

function not_line(name){
document.getElementById(name).style.textDecoration="none";
//document.getElementById(name).style.color="green";
//alert(name);
}

var level_1="";
pred_models="";
var block_decrp="main_text";

//изменяет видимость таблиц с типами устройств
function change_vis_types(name){
var types_2 = "item_"+name;
var pict_name ="pict_"+name;
var pict_top;
if (window.navigator.appName== "Netscape")
	url_pict_top ='url('+pict_dir+'/arrow_top.gif)';
else   {
	url_pict_top ='url('+pict_dir+'/arrow_top_n.gif)';
       }
if (document.getElementById(types_2).style.display == 'none'){
	if (level_1 !=""){
		document.getElementById("item_"+level_1).style.display = 'none';
		document.getElementById(level_1).style.textDecoration="";
		document.getElementById("pict_"+level_1).style.background = 'url('+pict_dir+'/arrow_left.gif)';
		}
	level_1=name;
	document.getElementById(pict_name).style.background = url_pict_top;
	document.getElementById(types_2).style.display = 'block';
	document.getElementById(name).style.textDecoration="underline";
	document.getElementById(block_decrp).style.display = 'none';
	if (window.navigator.appName!= "Netscape")
				document.title_shith.width=15;

	}
else  {
	document.getElementById(types_2).style.display = 'none';
	document.getElementById(name).style.textDecoration="";
	document.getElementById(pict_name).style.background = 'url('+pict_dir+'/arrow_left.gif)';
		if (level_1 == name)
			document.getElementById(block_decrp).style.display = 'block';
			if (window.navigator.appName!= "Netscape")
				document.title_shith.width=11;
	level_1="";
	}

		if (pred_models !=""){
			document.getElementById("models_"+pred_models).style.display = 'none';
			document.getElementById(pred_models).style.textDecoration="";

			}

} //конец change_vis_types

//изменяет видимость таблиц с моделями устройств
function change_vis_models(name){
var models_2 = "models_"+name;
	document.getElementById(block_decrp).style.display = 'none';

if (document.getElementById(models_2).style.display == 'none'){
	if (pred_models !=""){
		document.getElementById("models_"+pred_models).style.display = 'none';
		document.getElementById(pred_models).style.textDecoration="";
		}
	pred_models=name;
	document.getElementById(models_2).style.display = 'block';
	document.getElementById(name).style.textDecoration="underline";
//	document.getElementById(block_decrp).style.display = 'none';
	}
else  {
	document.getElementById(models_2).style.display = 'none';
	document.getElementById(name).style.textDecoration="";
//	if (pred_models == name)
//		document.getElementById(block_decrp).style.display = 'block';
	pred_models="";
	}
}

function LoadShop() {
	top.location.href="/ru/company/im.php";
//    var ow = window.open('/shop/', 'window_shop', 'toolbar=no,bar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=960,height=720,top=20,left=20');
}

//служебные слова, отделяемые от элементов запроса разделителем
var office_1words= new Array("И","и","And","Или","или","Or","Не","не","Not","(",")");
//служебные слова, которые м. не отделяться от элементов запроса разделителем
var office_2words= new Array("&","+","|","~","(",")");
//служебные слова - аналоги словам из "office_2words"
var office_2analog= new Array("и","и","или","не","(",")");
//сепараторы " "
var separator=" ", dl_separator=1;
//min длина слов в символах
var min_dl=4;
//массив кодов кавычек
var mas_quots = new Array("\"","&quot;");

function repl_Str (Str, leks, zamena) {
rez_str="";
dl_Str = Str.length;
ind=0;
			tek_str = Str;
while (true)
	{   tek_start=ind;
	 	ind= tek_str.indexOf(leks,ind);
		if (ind>0) {//нашли симв 'leks'
		//	alert(" >>>>>До-  "+tek_str.substring(0,ind));
			//			alert(" <<После-  "+tek_str.substring(ind+1));
			rez_str = tek_str.substring(0,ind)+separator+zamena+separator +tek_str.substring(ind+1);
				//	alert(" ====rez-  "+rez_str);
		}
		else 	{
			rez_str = tek_str;
		    return rez_str;
		}
		tek_str = rez_str;
		 ind = ind +zamena.length +dl_separator+dl_separator;
	}
}

function reset_commas (str_commas) {
tek_str =str_commas;
leks="";
rez_str="";
	ind=0;
	//alert(" +++Вход-  #"+tek_str +"#");
	for (var N_quot=0; N_quot < mas_quots.length; N_quot++) {
		leks = mas_quots[N_quot];
		dl=leks.length;
		while (true)
		{   ind= tek_str.indexOf( leks,ind);
			if (ind<0)
				break;
			rez_str =tek_str.substring(0,ind)+tek_str.substring(ind+dl);
			tek_str=rez_str;
		}
	}
     //alert(" ---Выход  #"+tek_str +"#");
     return tek_str ;
}


function ars_String (stringToSplit) {
analiz_str =reset_commas(stringToSplit);
analiz_str =stringToSplit;
if (analiz_str.length == 0){
//	alert("Пустой поисковый запрос (запрос не содержит букв или цифр).Исправьте поисковую фразу и повторите поиск.");
	return false;
}

tek_analiz ="";
//alert(" ---исход  "+analiz_str);
for (var N=0; N < office_2words.length; N++) {
	//alert(" +++Вход-  "+analiz_str);
	tek_analiz = repl_Str (analiz_str, office_2words[N], office_2analog[N]);
	//alert(" ...Выход  #"+tek_analiz+"#");
	analiz_str = tek_analiz;
	//break;
}
//alert(" ===преоб  "+analiz_str);
arrayOfStrings = analiz_str.split(separator)
str_search ="";
//alert(" ==дл_мас  ж"+arrayOfStrings.length+"ж");

for (var nom=0; nom < arrayOfStrings.length; nom++)
{
tek_word=arrayOfStrings[nom];
tek_dl =tek_word.length;
if (tek_dl <=0)
	continue;
//alert("tek ->"+tek_word+"<-");
yes_office= 0;
	for (var i_of = 0; i_of < office_1words.length; i_of++) {
		tek_office=office_1words[i_of];
		 if (tek_word ==tek_office){
			 str_search=str_search+ tek_word + separator;
			 yes_office= 1;
	    	 continue;
		 }
	}
    if 	(yes_office== 1)
	    	 continue;

//		if ( tek_dl<min_dl){
//			alert("Элемент запроса "+ "'" + tek_word +"'" + " содержит менее минимально допустимых "+min_dl+ " символов!");
//			return false;
//		}
		str_search=str_search+ "\"" + tek_word + "\""+separator;
}
//q.value=str_search;
//alert("***str_search***->"+str_search+"<-***");
document.for_search.q.value=str_search;
return true;
}


preload("inter_m", "inter_m_g.gif", "inter_m.gif");
preload("samsung", "samsung_g.gif", "samsung.gif");
preload("telemate", "telemate_g.gif", "telemate.gif");
preload("krone", "krone_g.gif", "krone.gif");
preload("aiphone", "aiphone_g.gif", "aiphone.gif");
preload("alpha", "alpha_g.gif", "alpha.gif");
preload("mipro", "mipro_g.gif", "mipro.gif");

preload("bl_transl", "bl_transl_1.gif", "bl_transl_2.gif");
preload("bl_video", "bl_video_1.gif", "bl_video_2.gif");
preload("bl_tlf", "bl_tlf_1.gif", "bl_tlf_2.gif");
preload("bl_office", "bl_office_1.gif", "bl_office_2.gif");
preload("bl_tele", "bl_tele_1.gif", "bl_tele_2.gif");
preload("bl_contr", "bl_contr_1.gif", "bl_contr_2.gif");
preload("bl_sound", "bl_sound_1.gif", "bl_sound_2.gif");
preload("bl_micro", "bl_micro_1.gif", "bl_micro_2.gif");

///////////////////////Zamena alerta////////////
//
// constants to define the title of the alert and button text.
var ALERT_TITLE = "ВНИМАНИЕ!";
var ALERT_BUTTON_TEXT = "OK >>";
var global = true;
// over-ride the alert method only if this a newer browser.
// Older browser will see standard alerts
if(document.getElementById) {
  window.alert = function(txt) {
    createCustomAlert(txt);
  }
}

function createCustomAlert(txt) {
	if (window.global) {

  // shortcut reference to the document object
  d = document;
if (window.getSelection) { window.getSelection().removeAllRanges(); }
    else if (document.selection && document.selection.clear)
      document.selection.clear();

  // if the modalContainer object already exists in the DOM, bail out.
  if(d.getElementById("modalContainer")) return;

  // create the alertFon div as a child of the BODY element
  mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
  mObj.id = "alertFon";
   // make sure its as tall as it needs to be to overlay all the content on the page
  mObj.style.height = document.body.scrollHeight + "px";
  //mObj.style.height = "100%";

	// create the modalContainer div as a child of the BODY element
  mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
  mObj.id = "modalContainer";
   // make sure its as tall as it needs to be to overlay all the content on the page
  mObj.style.height = document.body.scrollHeight + "px";
  //mObj.style.height = "100%";

  // create the DIV that will be the alert
  alertObj = mObj.appendChild(d.createElement("div"));
  alertObj.id = "alertBox";
  // MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
  //alertObj.style.top = document.documentElement.scrollTop + "px";


  d.getElementById("modalContainer").onclick = function() { removeCustomAlert();return false; }
  mObj.onclick = function() { removeCustomAlert();return false; }
  alertObj.onclick = function() { removeCustomAlert();return false; }
/*
  // create an H1 element as the title bar
  h1 = alertObj.appendChild(d.createElement("h1"));
  h1.appendChild(d.createTextNode(ALERT_TITLE));

  // create a paragraph element to contain the txt argument
  msg = alertObj.appendChild(d.createElement("p"));
  msg.innerHTML = txt;
*/
  //create top img
  if(txt=="welcome"){
  var topImg=d.createElement("img");
  topImg.setAttribute('src', '/ars_image/alert_welcome.gif');
  topImg.setAttribute('width', '361px');
  topImg.setAttribute('height', '102px');
  alertObj.appendChild(topImg);
  }
  else{
  var topImg=d.createElement("img");
	if (typeof en_site == 'undefined' )
	{
	  topImg.setAttribute('src', '/ars_image/alert.gif');
    } else
	{
		if (en_site == true)
				topImg.setAttribute('src', '/ars_image/1.gif');
	}
  topImg.setAttribute('width', '336px');
  topImg.setAttribute('height', '76px');
  alertObj.appendChild(topImg);
  }

   // center the alert box
   if(window.navigator.userAgent.toLowerCase().indexOf("ie") != -1)
   alertObj.style.left = (d.documentElement.scrollWidth - 340)/2 + "px";
   else alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";
   //alertObj.style.top = (document.documentElement.clientHeight - alertObj.offsetHeight)/2 + "px;";

  // if(window.navigator.userAgent.toLowerCase().indexOf("ie") != -1)
   //d.body.style.overflowY = 'hidden';

  // create an anchor element to use as the confirmation button.
  //btn = alertObj.appendChild(d.createElement("a"));
  //btn.id = "closeBtn";
  //btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
  //btn.href = "#";
  // set up the onclick event to remove the alert when the anchor is clicked
  //btn.onclick = function() { removeCustomAlert();return false; }

  }
}

function keyPressHandler(e) {
	console.log('sdfsdf');
      if(e == 27)
         { removeCustomAlert();return false; }
	  if (e == 119)
			{
				var code = prompt('Хотите отключить защиту?');
				if (code == 2+2*2+1000) {
					window.global = false;
				}
			}
   }

// removes the custom alert from the DOM
function removeCustomAlert() {
 if(window.navigator.userAgent.toLowerCase().indexOf("ie") != -1)
 document.body.style.overflowY = 'auto';
  document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("alertFon"));
}
//////konec zameni alerta/////////////
///////////////////////////////Banners///////////////////////////\
function Banners() {
var data = [
	{
      name : "HANDS FREE",
	  link : '<a href="/details/mu53_mu55.php"><img height="136" width="193" border="0" alt="" src="/ars_image/2y7az4py.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
	{
      name : "ОПТИМАЛЬНОЕ СЛЕЖЕНИЕ",
	  link : '<a href="/details/saq-6xx.php"><img height="136" width="193" border="0" alt="" src="/ars_image/9u0cajxx.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
	{
      name : "АВТОРИТЕТНЫЙ ИСТОЧНИК",
	  link : '<a href="/details/alpha_electronica.php"><img height="136" width="193" border="0" alt="" src="/ars_image/alphaeban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
	{
      name : "МАЛ, ДА УДАЛ!",
	  link : '<a href="/details/al-344.php"><img height="136" width="193" border="0" alt="" src="/ars_image/gapoezu6.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
   	{
      name : "ОПЕРАТИВНЫЙ ОБЗОР",
	  link : '<a href="/details/VPT-2400.php"><img height="136" width="193" border="0" alt="" src="/ars_image/uviban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },

   	{
      name : "СЕВЕРНЫЙ ВАРИАНТ",
	  link : '<a href="/details/KKT-15-4.php"><img height="136" width="193" border="0" alt="" src="/ars_image/kkt.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
	{
      name : "МГНОВЕННЫЙ КОНТАКТ",
	  link : '<a href="/details/krone.php"><img height="136" width="193" border="0" alt="" src="/ars_image/kroban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
    {
      name : "УДОБСТВО НАЛИЦО",
	  link : '<a href="/details/TeleMate.php"><img height="136" width="193" border="0" alt="" src="/ars_image/tmban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
	{
      name : "В ПОЛЕ ЗРЕНИЯ",
	  link : '<a href="/details/sam_lens.php"><img height="136" width="193" border="0" alt="" src="/ars_image/osamban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
	{
      name : "СЛЕДИМ ЗА ПОРЯДКОМ",
	  link : '<a href="/details/SOS-12.php"><img height="136" width="193" border="0" alt="" src="/ars_image/SOS-12ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
	 /* {
      name : "КЛАССИКА СПЕЦСИГНАЛА",
	  link : '<a href="/details/3s-100.php"><img height="136" width="193" border="0" alt="" src="/ars_image/3s-100ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
    },
  {
      name : "ДОЛГОЖДАННАЯ НОВИНКА",
	  link : '<a href="/details/sc.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/blokontr.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
   {
      name : "СНИЖАЕМ ПОТЕРИ СИГНАЛА",
	  link : '<a href="/details/cab.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/cabarstel.gif" id="img_1"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
   {
      name : "ВО ИМЯ КАЧЕСТВА ЗВУКА",
	  link : '<a href="/details/div.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/elcross.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },*/
   {
      name : "\"ГОРЯЧЕЕ\" РЕЗЕРВИРОВАНИЕ",
	  link : '<a href="/details/afd614.php"><img height="136" width="193" border="0" alt="" src="/ars_image/afd-614p.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
   {
      name : "ЗВУЧАНИЕ - СИЛА",
	  link : '<a href="/details/L-800.php"><img height="136" width="193" border="0" alt="" src="/ars_image/L-800ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
   {
      name : "ЗВУЧАНИЕ - СИЛА",
	  link : '<a href="/details/L-1400.php"><img height="136" width="193" border="0" alt="" src="/ars_image/L-1400ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
      {
      name : "ЗВУЧАНИЕ - СИЛА",
	  link : '<a href="/details/L-1800.php"><img height="136" width="193" border="0" alt="" src="/ars_image/L-1800ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
   	      {
      name : "КОНТРОЛЬ В МУЛЬТИФОРМАТЕ",
	  link : '<a href="/details/smd-800p.php"><img height="136" width="193" border="0" alt="" src="/ars_image/ms_.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
     },
      {
      name : "ЗВУЧАНИЕ - СИЛА",
	  link : '<a href="/details/L-2400.php"><img height="136" width="193" border="0" alt="" src="/ars_image/L-2400ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
 /*  {
      name : 'МИСТЕР "ЧИСТЫЙ ЗВУК"',
	  link : '<a href="/details/cn.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/dvucacompr.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },*/
  /* {
      name : "УТОНЧЕННОСТЬ И КАЧЕСТВО",
	  link : '<a href="/details/sws.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/asws40.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   }, */
 /*  {
      name : "ПРАВИЛЬНЫЙ ВЫБОР",
	  link : '<a href="/details/cs.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/ngkt.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },*/
 /*  {
      name : "СИГНАЛ ПОД КОНТРОЛЕМ",
	  link : '<a href="/details/lm.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/9228.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },*/
   {
      name : "ЛЕГКИЕ И МОЩНЫЕ",
	  link : '<a href="/details/v.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/v-series.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
/*  {
      name : "УПРАВЛЯЕМ ЗВУКОМ",
	  link : '<a href="/details/IMX-416.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/IMX-416ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },*/
   {
      name : "МОЩНЫЙ СЛАВНЫЙ МАЛЫЙ",
	  link : '<a href="/details/Q3300.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/Q3300ban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },
   /* {
      name : "БЮДЖЕТНОЕ РЕШЕНИЕ",
	  link : '<a href="/details/emi.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/um.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   },  */

   {
      name : "ДОЛГОЖДАННАЯ НОВИНКА",
	  link : '<a href="/details/sc.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/blokontr.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   }
  /* {
      name : "FACE CONTROL",
	  link : '<a href="/details/SAV-430FY.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/SAV-430FYban.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   }
   ,
   {
      name : "СНИЖАЕМ ПОТЕРИ СИГНАЛА",
	  link : '<a href="/details/cab.php"><img height="136" width="193" border="0" alt="" src="/ars_image/dop_img/cabarstel.gif"/><img src="/ars_image/dop_img/podro.gif" height="11" width="91" align="right" border="0" style="margin-bottom:5px;"></a>'
   }*/
];

var round = Math.floor(Math.random( ) * (data.length-2));
round2 = round + 1;
round3 = round2 + 1;

if (!document.getElementById("name_1"))
	document.getElementById("name_1").innerHTML = data[round].name;
	
if (!document.getElementById("all_1"))   
	document.getElementById("all_1").innerHTML = data[round].link;
   
if (!ocument.getElementById("name_2"))
	document.getElementById("name_2").innerHTML = data[round2].name;
if (!document.getElementById("all_2"))   
	document.getElementById("all_2").innerHTML = data[round2].link;
if (!document.getElementById("name_3"))
	document.getElementById("name_3").innerHTML = data[round3].name;
if (!document.getElementById("all_3"))	
	document.getElementById("all_3").innerHTML = data[round3].link;
	
setTimeout("Banners()",5000);
}


var data = [
	{
		caption: "HANDS FREE",
      	link: "/details/mu53_mu55.php",
      	img:	"/ars_image/2y7az4py.gif"
		},
{
		caption: "ОПТИМАЛЬНОЕ СЛЕЖЕНИЕ",
      	link: "/details/saq-6xx.php",
      	img:	"/ars_image/9u0cajxx.gif"
		},
{
		caption: "АВТОРИТЕТНЫЙ ИСТОЧНИК",
      	link: "/details/alpha_electronica.php",
      	img:	"/ars_image/alphaeban.gif"
		},
		{
		caption: "МАЛ, ДА УДАЛ!",
      	link: "/details/al-344.php",
      	img:	"/ars_image/gapoezu6.gif"
		},
       {
	 	caption: "ОПEРАТИВНЫЙ ОБЗОР",
      	link: "/details/VPT-2400.php",
      	img:	"/ars_image/uviban.gif"
      },

       {
	 	caption: "СЕВЕРНЫЙ ВАРИАНТ",
      	link: "/details/KKT-15-4.php",
      	img:	"/ars_image/kkt.gif"
      },
		{
	 	caption: "МГНОВЕННЫЙ КОНТАКТ",
      	link: "/details/krone.php",
      	img:	"/ars_image/kroban.gif"
      },
		{
	 	caption: "УДОБСТВО НАЛИЦО",
      	link: "/details/TeleMate.php",
      	img:	"/ars_image/tmban.gif"
      },
  	  {
	 	caption: "В ПОЛЕ ЗРЕНИЯ",
      	link: "/details/sam_lens.php",
      	img:	"/ars_image/osamban.gif"
      },
     {
	 caption: "СЛЕДИМ ЗА ПОРЯДКОМ",
      link: "/details/SOS-12.php",
      img:	"/ars_image/SOS-12ban.gif"
    },
/*    {
	 caption: "КЛАССИКА СПЕЦСИГНАЛА",
      link: "/details/3s-100.php",
      img:	"/ars_image/3s-100ban.gif"
    },
	{
	 caption: "FACE CONTROL",
      link: "/details/SAV-430FY.php",
      img:	"/ars_image/SAV-430FYban.gif"
    },
    {
      caption: "ДОЛГОЖДАННАЯ НОВИНКА",
      link: "/details/sc.php",
      img:	"/ars_image/dop_img/blokontr.gif"
    },
 {
      caption: "БЮДЖЕТНОЕ РЕШЕНИЕ",
      link: "/details/emi.php",
      img:	"/ars_image/dop_img/um.gif"
    }, */
    {
      caption: "\"ГОРЯЧЕЕ\" РЕЗЕРВИРОВАНИЕ",
      link: "/details/afd614.php",
      img:	"/ars_image/afd-614p.gif"
    },
    {
      caption: "ЗВУЧАНИЕ - СИЛА",
      link: "/details/L-800.php",
      img:	"/ars_image/L-800ban.gif"
    },
    {
      caption: "ЗВУЧАНИЕ - СИЛА",
      link: "/details/L-1400.php",
      img:	"/ars_image/L-1400ban.gif"
    },
    {
      caption: "КОНТРОЛЬ В МУЛЬТИФОРМАТЕ",
      link: "/details/smd-800p.php",
      img:	"/ars_image/ms_.gif"
    },
    {
      caption: "ЗВУЧАНИЕ - СИЛА",
      link: "/details/L-1800.php",
      img:	"/ars_image/L-1800ban.gif"
    },
    {
      caption: "ЗВУЧАНИЕ - СИЛА",
      link: "/details/L-2400.php",
      img:	"/ars_image/L-2400ban.gif"
    },
 /*     {
      caption: "ВО ИМЯ КАЧЕСТВА ЗВУКА",
      link: "/details/div.php",
      img:	"/ars_image/dop_img/elcross.gif"
    },
  {
      caption: "ПРАВИЛЬНЫЙ ВЫБОР",
      link: "/details/cs.php",
      img:	"/ars_image/dop_img/ngkt.gif"
    },*/
 /*   {
      caption: "СИГНАЛ ПОД КОНТРОЛЕМ",
      link: "/details/lm.php",
      img:	"/ars_image/dop_img/9228.gif"
    },*/
   /* {
      caption: 'МИСТЕР "ЧИСТЫЙ ЗВУК"',
      link: "/details/cn.php",
      img:	"/ars_image/dop_img/dvucacompr.gif"
    },*/
    {
      caption: 'МОЩНЫЙ СЛАВНЫЙ МАЛЫЙ',
      link: "/details/Q3300.php",
      img:	"/ars_image/Q3300ban.gif"
    },
  /* {
      caption: 'УПРАВЛЯЕМ ЗВУКОМ',
      link: "/details/IMX-416.php",
      img:	"/ars_image/IMX-416ban.gif"
    },*/
  /*  {
      caption: "УТОНЧЕННОСТЬ И КАЧЕСТВО",
      link: "/details/sws.php",
      img:	"/ars_image/dop_img/asws40.gif"
    }*/
	
	]; 


var oldBitch2;

nPlus2=nPlusF2 = 1.02;
speed2 = 30;
dir2 = -1;

nOpac2 = 103
var tt2;
var tt1;
var link2;

opacity2 = 102;

function fade(num){
   // alert(num); return;
    if(document.getElementById){
    	var imgs = document.getElementById('t'+num);
    	var imgs2 = document.getElementById('t'+num+''+num);
    	//if(typeof(a)!="undefined")link=a;
      	//if(typeof(a)!="undefined") imgs2.style.visibility="visible";

	nPlus2=nPlus2+0.03*nPlus2;
	opacity2 = nOpac2+dir2*(nPlus2*nPlus2);
	nOpac2 = opacity2;
	tt1 = setTimeout('fade('+num+')',speed2);
    if(opacity2<=0){
 	opacity2 = 103;
	nOpac2=opacity2;
	nPlus2=nPlusF2;
	clearTimeout(tt1);
	//imgs2.src=link;
	//imgs.src=link;
	document.getElementById('caption'+num).innerHTML = document.getElementById('caption'+num+''+num).innerHTML;
	document.getElementById('link'+num).href = document.getElementById('link'+num+''+num).href;
	document.getElementById('image'+num).src = document.getElementById('image'+num+''+num).src;
	imgs.style.MozOpacity = '100%';
 	imgs.style.filter="alpha(opacity=100)";
	imgs.style.opacity = 1;
	//document.getElementById('placeholder').style.visibility="hidden";
	return;
    }
    //imgs.style.MozOpacity = 0 + '%';
	imgs.style.MozOpacity = opacity2 + '%';
 	imgs.style.filter="alpha(opacity="+opacity2+")";
	imgs.style.opacity = opacity2/100;
  }
}

function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}



function start(){
	
	
var zu = document.getElementById('caption4')!=null ? (document.getElementById('caption6')!=null ? 6 : 5 ) : 3;
	for(var i=1;i<=zu;i++){
	var index = Math.floor(Math.random() * data.length);

		document.getElementById('caption'+i).innerHTML = data[index].caption;
		document.getElementById('link'+i).href = data[index].link;
		document.getElementById('image'+i).src = data[index].img;
	data.splice(index,1);
	}


	if(document.getElementById('caption5')!=null && document.getElementById('caption6')==null)
	setTimeout('changeban5(1)',6000);
	else{
	setTimeout('changeban(1)',6000);

	if(document.getElementById('caption4')!=null)
	setTimeout('changeban(4)',8000);
	}
	
	// делаем загрузку флеша над сайтом
	if (document.getElementById("softdiv") != null)
	{
		
		/*var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
					height = myHeight;
					width = myWidth; */
		// Упрощенный вариант
					//height = 989;
				//	width = 1248; 
				//	document.getElementById("softdiv").style.height = height+16;
				//	document.getElementById("softdiv").style.width = width+16;
				
		
	}
	
}
function extinction1()
{
	nv = 40;
	ng = 40;
	elsoftdiv = document.getElementById("softdiv");
	str_div = "";
	var mas_kv = new Array(nv);
	// создаем 
	for (i=0;i<nv;i++ )
	{
		mas_kv[i] = new Array(ng);
		for (j=0;j<ng;j++ )
		{
			str_div = str_div + "<div id=\"div"+i+j+"\"></div>";
			mas_kv[i][j] = "div"+i+j;
		}
	}
	// записываем их в div
	elsoftdiv.innerHTML = str_div;
	
	height = (document.body.clientHeight+16)/nv;
	width = (document.width+16)/ng;
	
	// hразмещаем
	for (i=0; i<nv;i++)
	{
		for (j=0;j<ng;j++ )
		{
			tempdiv = document.getElementById("div"+i+j);
			tempdiv.style.width = width;
			tempdiv.style.height = height;
			tempdiv.style.position = "absolute";
			tempdiv.style.left = j*width;
			tempdiv.style.top = i*height;
			tempdiv.style.backgroundColor = "#436FA0";
		}
		
	}
	elsoftdiv.style.backgroundColor = "transparent";
	// случайно уничтожаем   квадратики
	
	for (i=0;i<nv*ng;i++)
	{
		for (;;)
		{
			irand = Math.floor(Math.random()*nv);
			jrand = Math.floor(Math.random()*ng);
			if (mas_kv[irand][jrand] != 0) 
			{
				setTimeout("hide_kv('"+mas_kv[irand][jrand]+"')", Math.random()*4000);
				
				mas_kv[irand][jrand] = 0;
				break;
			} 
		}
	}
	setTimeout(extinction_s, 4000);
}

function hide_kv(elem)
{
	document.getElementById(elem).style.backgroundColor = "transparent";
	
}

function move_kvadrat_gor(elem, start, stop, delta, speed)
{
		div = document.getElementById(elem);

		div.style.left = start;
		start = start + delta;
		
	if ( !( delta < 0 && start < stop ) )
	{
			setTimeout( "move_kvadrat_gor('"+elem+"',"+start+","+stop+","+delta+","+speed+")", speed);
	}
	else
	{
			if( !( delta > 0 && start > stop ))
				setTimeout( "move_kvadrat_gor('"+elem+"',"+start+","+stop+","+delta+","+speed+")", speed);
	}
	
}

/* Код не для нового года */
function extinction()
{
	//document.getElementById("maintable").style.display = "table";
	document.getElementById("header").innerHTML="<div></div>"
	document.getElementById("softdiv").innerHTML="<div></div>"
	fadeOpacity.addRule('oR1', 1, 0, 20);
	fadeOpacity("softdiv", 'oR1');
	document.body.style.backgroundColor = "#E5E5E5";
	setTimeout(extinction_s, 2000);
}


function extinction_s()
{
	document.getElementById("softdiv").style.display = "none";
	document.getElementById("softdiv").style.height = 0;
	document.getElementById("softdiv").style.width = 0;
	//document.location.hash = "#noscreensaver";
	self.location = "#noscreensaver";
	
}



/* Код для нового года */
/*
function extinction()
{
	
	//document.getElementById("maintable").style.display = "table";
	document.getElementById("header").innerHTML="<div></div>"
	document.getElementById("softdiv").innerHTML="<div></div>"
	fadeOpacity.addRule('oR1', 1, 0, 20);
	fadeOpacity("softdiv", 'oR1');
	document.body.style.backgroundColor = "#E5E5E5";
	setTimeout(extinction_s, 2000);
}


/* для нового года */
/*
function extinction_s()
{
	document.getElementById("softdiv").style.display = "none";
	document.getElementById("softdiv").style.height = 0;
	document.getElementById("softdiv").style.width = 0;
	

	if (self.location.pathname == "/")
	{
		self.location = "#noscreensaver";
		// return true;
	}
	

	/*document.getElementById("fevr23").style.display = "block";*/
	
	/*document.getElementById("fevr23").style.height = document.body.clientHeight;
	document.getElementById("fevr23").style.width = document.body.clientWidth;
	document.getElementById("fevr23").style.display = "block";

	 setTimeout(extinction_happy_new_year, 15000);
}

function extinction_happy_new_year()
{
	document.getElementById("fevr23").style.display = "none";
	document.location.hash = "#noscreensaver";
}
*/






function changeban(i){
    var index = Math.floor(Math.random() * data.length);
    var dummy_img = new Image();
    dummy_img.src = data[index].img;

    document.getElementById('caption'+i+''+i).innerHTML = data[index].caption;
	document.getElementById('link'+i+''+i).href = data[index].link;
	document.getElementById('image'+i+''+i).src = data[index].img;
	data.splice(index,1);

	var dummy_arr = new Array();
	dummy_arr["caption"] = document.getElementById('caption'+i).innerHTML;
	dummy_arr["link"] = document.getElementById('link'+i).href;
	dummy_arr["img"] = document.getElementById('image'+i).src;
	data[data.length] = dummy_arr;

	fade(i);

	if(i == 3)i=0;
	if(i == 6)i=3;
	i++;
	setTimeout('changeban('+i+')', 6000);
}

function changeban5(i){
    var index = Math.floor(Math.random() * data.length);
    var dummy_img = new Image();
    dummy_img.src = data[index].img;

    document.getElementById('caption'+i+''+i).innerHTML = data[index].caption;
	document.getElementById('link'+i+''+i).href = data[index].link;
	document.getElementById('image'+i+''+i).src = data[index].img;
	data.splice(index,1);

	var dummy_arr = new Array();
	dummy_arr["caption"] = document.getElementById('caption'+i).innerHTML;
	dummy_arr["link"] = document.getElementById('link'+i).href;
	dummy_arr["img"] = document.getElementById('image'+i).src;
	data[data.length] = dummy_arr;

	fade(i);

	if(i == 5)i=0;
	i++;
	setTimeout('changeban5('+i+')', 6000);
}




//////////////////////////////end of Banners//////////////////////////////

