function incImg(href, id,cell)
{
	document.getElementById(id).src = cell.src;





}

function title(titl){
    titl=document.getElementById('mainTitle').innerHTML+titl;
 	document.title=titl;
 	}


var s = 0;
function loadDocR()
         {

         mode = document.getElementById('razdel').options[document.getElementById('razdel').selectedIndex].value;


         id = 'kats';
url = 'func_kats.php?id=' + mode;

         if (window.XMLHttpRequest)// для "родного" XMLHttpRequest Opera
             {
             req = new XMLHttpRequest();
             req.onreadystatechange = processReqChange;
             req.open("GET", url, true);
             req.send(null);
             }
         else if (window.ActiveXObject)// для версии с ActiveX
              {
              req = new ActiveXObject("Microsoft.XMLHTTP");
                    if (req)
                        {
                        req.onreadystatechange = processReqChange;
                        req.open("GET", url, true);
                        req.send();
                        }
              }
         }

function LoadFoto(f)
         {



         id = 'foto-' + f;
url = 'load_foto.php?id=' + f;

         if (window.XMLHttpRequest)// для "родного" XMLHttpRequest Opera
             {
             req = new XMLHttpRequest();
             req.onreadystatechange = processReqChangeq;
             req.open("GET", url, true);
             req.send(null);
             }
         else if (window.ActiveXObject)// для версии с ActiveX
              {
              req = new ActiveXObject("Microsoft.XMLHTTP");
                    if (req)
                        {
                        req.onreadystatechange = processReqChangeq;
                        req.open("GET", url, true);
                        req.send();
                        }
              }
         }


function show_text(cell,id,sh)
{	if(cell.innerHTML == 'Показать фото')
	{
	cell.innerHTML = 'Скрыть фото';
	document.getElementById(sh).innerHTML = 'Загрузка фото ...';
	LoadFoto(id);
	 }
	 else
	 {	 	cell.innerHTML ='Показать фото';
	 	document.getElementById(sh).innerHTML = '';

      }
}

         function processReqChangeq()
         {
         if (req.readyState == 4)// только пр состоянии "complete"
             {
             if (req.status == 200)// для статуса "OK"
                 {

                        q = req.responseText;

                       //document.getElementById('load').style.visibility = 'hidden';
                      // document.getElementById('res').style.visibility = 'visible';

                    //   if(h==0)
					//	document.getElementById('res').style.visibility = 'hidden';

                 document.getElementById(id).innerHTML = q; // здесь идут всякии штуки с полученным ответом
                 }
             else
                 {

                 alert("Не удалось получить данные:\n" +req.statusText);
                //  document.getElementById('load').style.visibility = 'hidden';
                 }
             }
         }







var req;




function show_param(param)
{

  if(document.getElementById(param).style.visibility=='visible'){
     document.getElementById(param).style.visibility='hidden';

     }
  else
  {
  document.getElementById(param).style.visibility='visible';








  }


}


function check_pr()
{
	if(document.getElementById('probegrf').value==1)
	   document.getElementById('probegrf').value=0;
	   else
	document.getElementById('probegrf').value=1;


}
function loadDoc()
         {

         mode = document.getElementById('marka').options[document.getElementById('marka').selectedIndex].value;

         id = 'answer';
url = 'func_sort.php?id=' + mode;

         if (window.XMLHttpRequest)// для "родного" XMLHttpRequest Opera
             {
             req = new XMLHttpRequest();
             req.onreadystatechange = processReqChange;
             req.open("GET", url, true);
             req.send(null);
             }
         else if (window.ActiveXObject)// для версии с ActiveX
              {
              req = new ActiveXObject("Microsoft.XMLHTTP");
                    if (req)
                        {                        	var h = 0;
                        req.onreadystatechange = processReqChange;
                        req.open("GET", url, true);
                        req.send();

                        }
              }



         }
 function loadDocUsr()
         {

         mode = document.getElementById('users').options[document.getElementById('users').selectedIndex].value;

         id = 'user_list';
url = 'usr_f.php?id=' + mode;

         if (window.XMLHttpRequest)// для "родного" XMLHttpRequest Opera
             {
             req = new XMLHttpRequest();
             req.onreadystatechange = processReqChange;
             req.open("GET", url, true);
             req.send(null);
             }
         else if (window.ActiveXObject)// для версии с ActiveX
              {
              req = new ActiveXObject("Microsoft.XMLHTTP");
                    if (req)
                        {
                        	var h = 0;
                        req.onreadystatechange = processReqChange;
                        req.open("GET", url, true);
                        req.send();

                        }
              }



         }





         function reset()
         {
         	document.getElementById('rul').value='n';
         	document.getElementById('probegrf').value='m';



         }
 function query(){

      q = '?';

     q+='marka=' + document.getElementById('marka').options[document.getElementById('marka').selectedIndex].value;
     q+='&';
     if(document.getElementById('marka')!=0 && document.getElementById('marka')!='')
     {q+='model=' + document.getElementById('model').options[document.getElementById('model').selectedIndex].value;
     q+='&';
     }
     q+='god_fr=' + document.getElementById('god_fr').options[document.getElementById('god_fr').selectedIndex].value;
     q+='&';
     q+='god_till=' + document.getElementById('god_till').options[document.getElementById('god_till').selectedIndex].value;

     q+='&';

 	 q+='kuzov=' + document.getElementById('kuzov').options[document.getElementById('kuzov').selectedIndex].value;
     q+='&';
     q+='color=' + document.getElementById('color').options[document.getElementById('color').selectedIndex].value;
     q+='&';
     q+='dvizhok=' + document.getElementById('dvizhok').options[document.getElementById('dvizhok').selectedIndex].value;
     q+='&';
     q+='toplivo=' + document.getElementById('toplivo').options[document.getElementById('toplivo').selectedIndex].value;
     q+='&';
     q+='privod=' + document.getElementById('privod').options[document.getElementById('privod').selectedIndex].value;
     q+='&';
     q+='salon=' + document.getElementById('salon').options[document.getElementById('salon').selectedIndex].value;
     q+='&';
     q+='sost=' + document.getElementById('sost').options[document.getElementById('sost').selectedIndex].value;
     q+='&';
     q+='kpp=' + document.getElementById('kpp').options[document.getElementById('kpp').selectedIndex].value;
     q+='&';
     q+='town=' + document.getElementById('town').options[document.getElementById('town').selectedIndex].value;
     q+='&';

 	 q+='v_fr=' + document.getElementById('v_fr').value;
     q+='&';
     q+='v_till=' + document.getElementById('v_till').value;
     q+='&';
     q+='sort_by=' + document.getElementById('sort_by').options[document.getElementById('sort_by').selectedIndex].value;
     q+='&';

     rl =  document.getElementById('rul').value;


     q+='rul=' + rl;
     q+='&';
     q+='probegrf=' + document.getElementById('probegrf').value;


    return q;
 }

function loadDocNew()
         {
         qwer = query();
         document.getElementById('load').style.visibility = 'visible';







         id = 'resultt';
url = 'func_search_car.php' + qwer;

                 if (window.XMLHttpRequest)// для "родного" XMLHttpRequest Opera
             {
             req = new XMLHttpRequest();
             req.onreadystatechange = processReqChange;
             req.open("GET", url, true);
             req.send(null);
             }
         else if (window.ActiveXObject)// для версии с ActiveX
              {
              req = new ActiveXObject("Microsoft.XMLHTTP");
                    if (req)
                        {
                        req.onreadystatechange = processReqChange;
                        req.open("GET", url, true);
                        req.send();
                        }
              }
         }

function processReqChange()
         {
         if (req.readyState == 4)// только пр состоянии "complete"
             {
             if (req.status == 200)// для статуса "OK"
                 {

                        q = req.responseText;

                       document.getElementById('load').style.visibility = 'hidden';


                 document.getElementById(id).innerHTML = q; // здесь идут всякии штуки с полученным ответом
                 }
             else
                 {

                 alert("Не удалось получить данные:\n" +req.statusText);
                  document.getElementById('load').style.visibility = 'hidden';
                 }
             }
         }









    function display_(id)
          {

            if(document.getElementById(id).style.visibility=='hidden')
          	 document.getElementById(id).style.visibility='visible';
          	 else
          	 document.getElementById(id).style.visibility='hidden';



          }
 function display(id)
          {


          	 document.getElementById(id).style.visibility='hidden';



          }
           timerID = 235;






 function mOver(cell)
{
 if (1)
 {

   cell.style.cursor = 'hand'; cell.style.background = "url('img2/vrbgover.gif')";
   cell.style.color = 'dc0c0d';
 }
}
 function mOver__(cell)
{
 if (1)
 {

   cell.style.cursor = 'hand'; cell.style.background = "url('img/elem/bg__.png')";
   cell.style.color = 'white';
 }
}

function mOut__(cell,back)
{
 if (1)
 {
   cell.style.cursor = 'default'; cell.style.background = "url('" + back + "')";
   cell.style.color = 'black';
 }
}
function mOut(cell)
{
 if (1)
 {
   cell.style.cursor = 'default'; cell.style.background = 'url(none.gif)';
   cell.style.color = '000000';
 }
}


function mOver_w(cell)
{
 if (1)
 {
   cell.style.cursor = 'hand';

   cell.style.background = '#f9f5f5';
   cell.style.color = "red";


 }
}
function mOut_w(cell)
{
 if (1)
 {

   cell.style.cursor = 'default';

   cell.style.background = "ffffff";
    cell.style.color = "black";

 }
}



function mOver_k(cell)
{
 if (1)
 {
   cell.style.cursor = 'hand';

   cell.style.background = "url('img/elem/bg_kab_over.png')";



 }
}
function mOut_k(cell)
{
 if (1)
 {

   cell.style.cursor = 'default';

   cell.style.background = "url('img/elem/bg_kab.png')";


 }
}


function mOver_m(cell)
{
 if (1)
 {
   cell.style.cursor = 'hand';

   cell.style.background = '#ff9495';



 }
}
function mOut_m(cell,bg)
{
 if (1)
 {

   cell.style.cursor = 'default';

   cell.style.background = bg;


 }
}


//---------------------------------
//GUest


 function stlin(obj)
 {
    obj.style.cursor = 'hand';
    obj.style.color = 'gray';

 }
  function stlout(obj)
 {
    obj.style.cursor = 'hand';
    obj.style.color = '000000';



 }

 function cur(obj)
 {

    if(obj.id=='a')
    dop = ' href=Your adress';
    else
    dop = '';
    f = 0


  document.guest.text.value += '[' + obj.id + dop + ']' + '[/' + obj.id + ']';


		}

 function helpin(obj)
 {
 text = 'text';
    if(obj.id=='b')
         	text = "[b]Текст, который должен быть жирным[/b]";



    if(obj.id=='i')

      	text = "[i]Текст, который должен быть курсивным[/i]";


    if(obj.id=='a')
      	text = "[a href=\"адрес ссылки\"]Текст ссылки[/a]";


    document.getElementById("help").innerHTML = text;




 	}

function helpout(ident)
 {
    document.getElementById("help").innerHTML = '';



 	}

