
function changeFon_poisk(id,swith) {
if(swith==1) {document.getElementById(id).style.background = '#E7E2C5';}
if(swith==2) {document.getElementById(id).style.background = '';}
}

function changeFon_kreslo(id,swith) {
id1="kreslo";
if(swith==1) {document.getElementById(id1).style.background = "url('images/ortopedija/kreslo-ortoped-"+id+".jpg') no-repeat";}
if(swith==2) {document.getElementById(id1).style.background = "url('images/ortopedija/kreslo-ortoped-700239.jpg') no-repeat";}
}

var scrollH;
i= "";
fix = "null";
function show_menu(i,evt){
         evt = (evt)?evt:(window.event)?window.event:""
    if (evt)
        {
         if(fix!=i&fix!="null") close_menu(fix);
         if(i!="") {

         document.getElementById(i).style.visibility = "visible";
         fix=i;
         }
        }
}
function close_menu(i){
         if(document.getElementById(i))
        document.getElementById(i).style.visibility = "hidden";
}
function scrollHeight(){
scrollH = document.body.scrollHeight;
var news=document.getElementById("news1").innerHTML;
num=news.length;
var newsArray = news.split("</B>");
for (var i = 0; i < 6; i++) {
j=substr(newsArray[i])+'<BR>';
alert('str='+'str['+i+']');
}
document.getElementById("news1").innerHTML= newsArray;
}
function view_materials(id) {
  window.open("poisk_object.php?models_id="+id, id, "status=yes, toolbar=yes, menubar=no, scrollbars=yes");
}
function view_forum() {
  window.open("/forum_zasudili/www/index.php", "Форум", "");
}
function name_focus() {
document.poisk.massage_poisk.focus();
}


function model_chertioj() {
  document.all["chertioj"].style.visibility = "visible";
  return true;
}
function close_chertioj() {
  document.all["chertioj"].style.visibility = "hidden";
  return true;
}
function map_print() {
  window.open("/view_map_print.html", "displayWindow", "width=700,height=850,status=no,toolbar=no,menubar=no");
  return true;
}
function doc_view(width, height) {
  window.open("/dostavka.html", "displayWindow", "width="+width+",height="+height+",status=no,toolbar=no,menubar=no");
  return true;
}
var nw1;
function show(file, name, width, height)
        {
    if(nw1) nw1.close();
    nw=window.open('', 'wbl', 'width='+width+',height='+height+',titlebar=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
    nw.document.write('<html><title>'+name+'</title><body  bgcolor="#C0C0C0" leftmargin="0" topmargin="20" marginwidth="0" marginheight="20"><center><img src="'+file+'" title="'+name+'"></center></body></html>');
    nw1=nw;
    }


var op = 0;
var sStep = 16;
var sTimeout = 15;
var sLeft = 160;
var sRight = 160;
var wObj;


function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}


function showCallBack(){
    openOverlay();
    document.getElementById('plcDialog').style.display = 'block';
	document.getElementById('plcDialog').style.left=document.body.clientWidth/2-200;
}
function hideCallBack(){
    op = 0.5;
    closeOverlay();
    document.getElementById('plcDialog').style.display = 'none';
}
function closeOverlay(){
    if (op > 0) {
        op -= 0.1;
        document.getElementById('overlay').style.opacity = op;
        document.getElementById('overlay').style.filter = 'alpha(opacity=' + op * 100 + ')';
        t = setTimeout('closeOverlay()', 30);
    }
    else {
        document.getElementById('overlay').style.display = 'none';
    }
}
function openOverlay(){
    document.getElementById('overlay').style.display = 'block';
    if (op < 0.5) {
        op += 0.1;
        document.getElementById('overlay').style.opacity = op;
        document.getElementById('overlay').style.filter = 'alpha(opacity=' + op * 100 + ')';
        t = setTimeout('openOverlay()', 30);
    }
}
function sendCallBack(){
	var name=document.frmCallBack.name.value;
	var phone='8('+document.frmCallBack.kod.value+')'+document.frmCallBack.nomer.value;
	var time=document.frmCallBack.time.value;
	var message=document.frmCallBack.message.value;
	var param = 'name='+encodeURIComponent(name)+'&phone='+encodeURIComponent(phone)+'&time='+encodeURIComponent(time)+'&message='+encodeURIComponent(message);
	var xmlhttp = getXmlHttp()
	xmlhttp.open('POST', 'sendcallback.php' , false);
	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=windows-1251");


	xmlhttp.send(param);
	if(xmlhttp.status == 200) {
	  if ((xmlhttp.responseText.value)='ok') {alert('Запрос успешно отправлен!');hideCallBack()};
	}
}


				function show_place(id){
					switch (id) {
					case 1:
						document.getElementById('centr_place').innerHTML="<img src='images/kreslo1.png' align='left' style='padding:8px 0 0 11px' width='200px' height='302px'/>"+
						"<div class='txt'> <p class='menu'>Кресла для офиса</p>  "+
                        "<a href='/ofisnye-kresla.htm'>Офисные кресла</a> <br>  "+
                        "<a href='/vip-kreslo-direktora.htm'>Кресла эксклюзивные(VIP)</a> <br>  "+
						"<a href='/kresla-rukovoditelya.htm'>Кресла для руководителя</a> <br>  "+
						"<a href='/catalog.php?id=1001&par=12'>Кресла рабочие для персонала</a> </div>";
						break
					case 2:
						document.getElementById('centr_place').innerHTML="<img src='images/stul1.png' align='left' style='padding:8px 0 0 11px' width='173px' height='290px' />"+
						"<div class='txt'> <p class='menu'>Стулья для офиса, кафе, баров, гостиниц</p>  "+
                        "<a href='/catalog.php?id=1002'>Стулья на металлокаркасе</a> <br>  "+
						"<a href='/ofisnye-stuliya.htm'>Офисные стулья</a> <br>  "+
						"<a href='/barnye-stuliya-kafe.htm'>Барные стулья кафе</a> </div>";
						break
					case 3:
						document.getElementById('centr_place').innerHTML="<img src='images/mebel1.png' align='left' style='margin:18px 8px 0 13px;' width='182px' height='280px'/>"+
						"<div class='txt'> <p class='menu'>Мебель для офиса</p>    "+
						"<a href='/catalog.php?id=2001'>Кабинеты руководителя</a> <br>  "+
						"<a href='/catalog.php?id=2002'>Мебель для персонала</a><br>  "+
						"<a href='/catalog.php?id=2003'>Мягкая офисная мебель</a><br>  "+
						"<a href='/price.php?id=2004'>Прайс-листы</a> </div>";

						break
					case 4:
						document.getElementById('centr_place').innerHTML="<img src='images/detail.png' align='left' style='padding:8px 0 0 11px' width='180px' height='214px' />"+
						"<div class='txt'> <p class='menu'>Комплектующие кресел и стульев</p>  "+
						"<a href='/catalog.php?id=3001'>Каркасы и детали кресел</a> <br>  "+
						"<a href='/catalog.php?id=3002'>Деревянные подлокотники</a><br>  "+
						"<a href='/catalog.php?id=3003'>Детали стульев</a><br>  "+
						"<a href='/catalog.php?id=3004'>Новинки</a><br>  "+
						"<a href='/catalog.php?id=3005'>Отделочные материалы. Шпон</a><br>  "+
						"<a href='/price.php?id=3006'>Прайс-листы</a> </div>";
						break
					default:
						document.getElementById('centr_place').innerHTML="<img src='images/foto_centr.jpg' class='ram_image' alt=''>";
						break
					}
				}

