		var xmlHttp;
var xmlHttp1;
	try {
		xmlHttp=new XMLHttpRequest();
xmlHttp1=new XMLHttpRequest();

	}
	catch(e) {
		
		var XmlHttpVersions=new Array('MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP');
		var XmlHttpVersions1=new Array('MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP');
		
		
		for(var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) {
			try {
				xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
xmlHttp1 = new ActiveXObject(XmlHttpVersions1[i]);
			
			}
			catch(e) {}
		}
	}

	if(!xmlHttp) alert("Ошибка создания объекта XMLHttpRequest.");
	if(!xmlHttp1) alert("Ошибка создания объекта XMLHttpRequest.");	
	
    
function number_format (number, decimals, dec_point, thousands_sep) {
    // Formats a number with grouped thousands  
    // 
    // version: 1102.614
    // discuss at: http://phpjs.org/functions/number_format
    // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +     bugfix by: Michael White (http://getsprink.com)
    // +     bugfix by: Benjamin Lupton
    // +     bugfix by: Allan Jensen (http://www.winternet.no)
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +     bugfix by: Howard Yeend
    // +    revised by: Luke Smith (http://lucassmith.name)
    // +     bugfix by: Diogo Resende
    // +     bugfix by: Rival
    // +      input by: Kheang Hok Chin (http://www.distantia.ca/)
    // +   improved by: davook
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +      input by: Jay Klehr
    // +   improved by: Brett Zamir (http://brett-zamir.me)
    // +      input by: Amir Habibi (http://www.residence-mixte.com/)
    // +     bugfix by: Brett Zamir (http://brett-zamir.me)
    // +   improved by: Theriault
    // +      input by: Amirouche
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: number_format(1234.56);
    // *     returns 1: '1,235'
    // *     example 2: number_format(1234.56, 2, ',', ' ');
    // *     returns 2: '1 234,56'
    // *     example 3: number_format(1234.5678, 2, '.', '');
    // *     returns 3: '1234.57'
    // *     example 4: number_format(67, 2, ',', '.');
    // *     returns 4: '67,00'
    // *     example 5: number_format(1000);
    // *     returns 5: '1,000'
    // *     example 6: number_format(67.311, 2);
    // *     returns 6: '67.31'
    // *     example 7: number_format(1000.55, 1);
    // *     returns 7: '1,000.6'
    // *     example 8: number_format(67000, 5, ',', '.');
    // *     returns 8: '67.000,00000'
    // *     example 9: number_format(0.9, 0);
    // *     returns 9: '1'
    // *    example 10: number_format('1.20', 2);
    // *    returns 10: '1.20'
    // *    example 11: number_format('1.20', 4);
    // *    returns 11: '1.2000'
    // *    example 12: number_format('1.2000', 3);
    // *    returns 12: '1.200'
    // *    example 13: number_format('1 000,50', 2, '.', ' ');
    // *    returns 13: '100 050.00'
    number = (number + '').replace(',', '').replace(' ', '');
    var n = !isFinite(+number) ? 0 : +number,
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
        dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
        s = '',
        toFixedFix = function (n, prec) {
            var k = Math.pow(10, prec);
            return '' + Math.round(n * k) / k;
        };
    // Fix for IE parseFloat(0.55).toFixed(0) = 0;
    s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
    if (s[0].length > 3) {
        s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
    }
    if ((s[1] || '').length < prec) {
        s[1] = s[1] || '';
        s[1] += new Array(prec - s[1].length + 1).join('0');
    }
    return s.join(dec);
}    
    
	//Проверяем правильность введенного кода
function ochko() {
	
//	alert(entry.value);
	
	var gaga=document.getElementById('intext').value;
	
	zapros="fuck="+gaga;
	
//	alert(zapros);
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/ok_code.php", true);
		xmlHttp.onreadystatechange=handleServerResponse437;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('ochko()', 1000);
			}
}
function handleServerResponse437() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('outcode').value=response;
		
	//	alert(response);
		
	//hidetimer();
	}
		else setTimeout('handleServerResponse437()', 500);
	}
}

function addnewcode() {
	
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/ok_code11.php", true);
		xmlHttp.onreadystatechange=handleServerResponse938;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);	
	}
	else setTimeout('addnewcode()', 1000);
			}
}

function handleServerResponse938() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('newcode').innerHTML=response;
	//hidetimer();
	}
		else setTimeout('handleServerResponse938()', 500);
	}
}


	//Голосуем
function golos(vote,ids) {
	

	

	
	zapros="id="+ids+"&vote="+vote;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/golos.php", true);
		xmlHttp.onreadystatechange=handleServerResponse671;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('golos('+vote+','+ids+')', 1000);
			}
}
function handleServerResponse671() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
	
        if(response=='no') alert("Вы уже проголосовали за это фото");
        else alert("Спасибо, Ваш голос принят.");
	//hidetimer();
	}
		else setTimeout('handleServerResponse671()', 500);
	}
}




	//Добавляем машину в блокнот
function bloknot(entry) {
	
//	alert(entry.value);
	

	
	zapros="id="+entry;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/bloknot.php", true);
		xmlHttp.onreadystatechange=handleServerResponse371;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('bloknot('+entry+')', 1000);
			}
}
function handleServerResponse371() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		if(response=='ok') alert('Авто добавлено в Ваш блокнот.');
	//hidetimer();
	}
		else setTimeout('handleServerResponse371()', 500);
	}
}



//Добавляем к сравнению
function sravni(entry) {
	
//	alert(entry.value);
	

	
	zapros="id="+entry;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/sravni.php", true);
		xmlHttp.onreadystatechange=handleServerResponse372;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('sravni('+entry+')', 1000);
			}
}
function handleServerResponse372() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		if(response=='ok') alert('Авто добавлено к сравнению.');
	//hidetimer();
	}
		else setTimeout('handleServerResponse372()', 500);
	}
}




//Сообщаем о том что машина продана
function prodana(entry) {
	
//	alert(entry.value);
	

	
	zapros="id="+entry;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/prodana.php", true);
		xmlHttp.onreadystatechange=handleServerResponse373;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('prodana('+entry+')', 1000);
			}
}
function handleServerResponse373() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		if(response=='ok') alert('Спасибо, Ваша заявка отправлена владельцу объявления.');
	//hidetimer();
	}
		else setTimeout('handleServerResponse373()', 500);
	}
}






//Сообщаем о том что машина продана
function reple(entry) {
	
//	alert(entry.value);
	

	
	zapros="id="+entry.value;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modeli.php", true);
		xmlHttp.onreadystatechange=handleServerResponse374;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('reple('+entry+')', 1000);
			}
			
			
}
function handleServerResponse374() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('mmmm').innerHTML=response;
	//hidetimer();
	}
		else setTimeout('handleServerResponse374()', 500);
	}
}

//Сообщаем о том что машина продана
function reple11(entry) {
	
//	alert(entry.value);
	

	
	zapros="id="+entry.value;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modeli.php", true);
		xmlHttp.onreadystatechange=handleServerResponse3741;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('reple11('+entry+')', 1000);
			}
			
			
}
function handleServerResponse3741() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('mmmm11').innerHTML=response;
	//hidetimer();
	}
		else setTimeout('handleServerResponse3741()', 500);
	}
}





















//Выбор городов по области
function reple12(entry) {
	
//	alert(entry.value);
	

	
	zapros="id="+entry.value;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/goroda.php", true);
		xmlHttp.onreadystatechange=handleServerResponse3742;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('reple12('+entry+')', 1000);
			}
			
			
}
function handleServerResponse3742() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('mmmm12').innerHTML=response;
	//hidetimer();
	}
		else setTimeout('handleServerResponse3742()', 500);
	}
}





function zhaloba(entry) {
	
//	alert(entry.value);
	

	
	zapros="id="+entry;
	
	
	//alert(zapros);
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/zaloba.php", true);
		xmlHttp.onreadystatechange=handleServerResponse3745;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('zhaloba('+entry+')', 1000);
			}
			
			
}
function handleServerResponse3745() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		
		if(response=='ok') alert("Спасибо, Ваша жалоба направлена в администрацию ресурса");
	
	//hidetimer();
	}
		else setTimeout('handleServerResponse3745()', 500);
	}
}








function step1(entry) {
	
//	alert(entry.value);
	
document.getElementById('step2').innerHTML='';
document.getElementById('step3').innerHTML='';
document.getElementById('step4').innerHTML='';
document.getElementById('outlet').innerHTML='';	
document.getElementById('ekonom').innerHTML='';
	zapros="marka_name="+entry;
	

	
	if(xmlHttp) {	
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/step1.php", true);
		xmlHttp.onreadystatechange=handleServerResponse3749;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('step1('+entry+')', 1000);
			}
			
			
}
function handleServerResponse3749() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		
		
	document.getElementById('step2').innerHTML=response;
	
	}
		else setTimeout('handleServerResponse3749()', 500);
	}
}





function step2(entry) {
	
//	alert(entry.value);
	
document.getElementById('step3').innerHTML='';
document.getElementById('step4').innerHTML='';
	document.getElementById('outlet').innerHTML='';	
    document.getElementById('ekonom').innerHTML='';
	zapros="model_name="+entry+"&marka_name="+document.getElementById('marka').value;

	
	if(xmlHttp) {	
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/step2.php", true);
		xmlHttp.onreadystatechange=handleServerResponse3750;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('step2('+entry+')', 1000);
			}
			
			
}
function handleServerResponse3750() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		
		
	document.getElementById('step3').innerHTML=response;
	
	}
		else setTimeout('handleServerResponse3750()', 500);
	}
}


function showto(entry) {
    
    if(entry=='') document.getElementById('step4').innerHTML='';
    else document.getElementById('step4').innerHTML='<div class="fl sss">Выберите № ТО</div><div class="fl"><select name="to11" onchange="raschet(this.form, 1, 0)"><option value=""></option><option value="to0">ТО 0</option><option value="to10000">ТО 10000</option><option value="to20000">ТО 20000</option><option value="to30000">ТО 30000</option><option value="to40000">ТО 40000</option><option value="to50000">ТО 50000</option><option value="to60000">ТО 60000</option><option value="to70000">ТО 70000</option><option value="to80000">ТО 80000</option><option value="to90000">ТО 90000</option><option value="to100000">ТО 100000</option></select></div><div class="cl"><br /></div>';
    document.getElementById('outlet').innerHTML='';
    document.getElementById('ekonom').innerHTML='';
}


function raschet(form, nom, skidka) {
    
    
    if(nom==2) alert("Не забудьте выбрать нужные Вам пункты!");
    
    
    if(skidka==3 || skidka==5 || skidka==7 || skidka==10 || skidka==15 || skidka==20) {var skd='<option value="'+skidka+'" selected="true">Карта '+skidka+'%</option>'; 
    
     alert("Не забудьте выбрать нужные Вам пункты!");
    }
    else var skd='';
    
    if(nom==1) document.getElementById('ekonom').innerHTML='<div class="fl"><input type="button" value="Хочу сэкономить" onclick="raschet(this.form, 2,0)" /></div><div class="ar">Дункан дисконт: <select name="skidka" onchange="raschet(this.form, 1, this.value)">'+skd+'<option value="0">без скидки</option><option value="3">Карта 3%</option><option value="5">Карта 5%</option><option value="7">Карта 7%</option><option value="10">Карта 10%</option><option value="15">Карта 15%</option></select></div>';
    else if(nom==2) document.getElementById('ekonom').innerHTML='<div class="fl"><input type="button" value="Оригинальные запчасти" onclick="raschet(this.form, 1,0)" /></div><div class="ar">Дункан дисконт: <select name="skidka" onchange="raschet(this.form, 2, this.value)">'+skd+'<option value="0">без скидки</option><option value="3">Карта 3%</option><option value="5">Карта 5%</option><option value="7">Карта 7%</option><option value="10">Карта 10%</option><option value="15">Карта 15%</option></select></div>';
    
    //alert("Marka: "+form.marka.value+"; Model: "+form.model.value+"; Engine: "+form.engine.value+"; TO: "+form.to11.value);
    
    
    
    zapros="marka_name="+form.marka.value+"&model_name="+form.model.value+"&engine_name="+form.engine.value+"&to_name="+form.to11.value+"&nom="+nom+"&skidka="+skidka;
	


	if(xmlHttp) {	
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/raschet_calc.php", true);
		xmlHttp.onreadystatechange=handleServerResponse3751;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('raschet('+form+','+nom+','+skidka+')', 1000);
			}
    
    
}


function handleServerResponse3751() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		
		
	document.getElementById('outlet').innerHTML=response;
	
	}
		else setTimeout('handleServerResponse3751()', 500);
	}
}


function chipok3(entry, ids) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('itog3').value);
    var entry=parseFloat(entry);
   
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else {esso=kinza-entry;}
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog3').value=esso;
    
}


function chipok(entry, ids) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('itog').value);
    var entry=parseFloat(entry);
   
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog').value=esso;
    
    
    
    
        var esso=0;
    var kinza=parseFloat(document.getElementById('itog_00').value);
    var entry=parseFloat(entry);
   
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog_00').value=esso;
    
   
    
    
}
function chipok_01(entry, ids) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('itog').value);
    var entry=parseFloat(entry);
   
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog').value=esso;
    
    
    
    
        var esso=0;
    var kinza=parseFloat(document.getElementById('itog_01').value);
    var entry=parseFloat(entry);
   
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog_01').value=esso;
    
   
    
    
}


function chipok1(entry, ids) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('itog1').value);
    var entry=parseFloat(entry);
    
 
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
 
    
    
    esso = number_format(esso, 2, '.', '');
    
    document.getElementById('itog1').value=esso;
    
    
    
    
       var esso=0;
    var kinza=parseFloat(document.getElementById('itog_02').value);
    var entry=parseFloat(entry);
    
 
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
 
    
    
    esso = number_format(esso, 2, '.', '');
    
    document.getElementById('itog_02').value=esso;
}




function chipok1_02(entry, ids) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('itog1').value);
    var entry=parseFloat(entry);
    
 
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
 
    
    
    esso = number_format(esso, 2, '.', '');
    
    document.getElementById('itog1').value=esso;
    
    
    
    
       var esso=0;
    var kinza=parseFloat(document.getElementById('itog_03').value);
    var entry=parseFloat(entry);
    
 
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
 
    
    
    esso = number_format(esso, 2, '.', '');
    
    document.getElementById('itog_03').value=esso;
}


function chipok2(entry, ids) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('itog2').value);
    var entry=parseFloat(entry);
    
  
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog2').value=esso;
    
    
        var esso=0;
    var kinza=parseFloat(document.getElementById('itog_04').value);
    var entry=parseFloat(entry);
    
  
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog_04').value=esso;
    
}


function chipok2_01(entry, ids) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('itog2').value);
    var entry=parseFloat(entry);
    
  
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog2').value=esso;
    
    
        var esso=0;
    var kinza=parseFloat(document.getElementById('itog_05').value);
    var entry=parseFloat(entry);
    
  
    
    
    if(document.getElementById(ids).checked===false) esso=kinza+entry;
    else esso=kinza-entry;
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('itog_05').value=esso;
    
}


function vsego(entry, ids, cll) {
    
    var esso=0;
    var kinza=parseFloat(document.getElementById('uniqq').value);
    var entry=parseFloat(entry);
    
    
    
    
    if(document.getElementById(ids).checked===false) {esso=kinza+entry; document.getElementById(cll).className='notclose';}
    else {esso=kinza-entry; document.getElementById(cll).className='close';
    
    
    
    }
    
    
    esso = number_format(esso, 2, '.', '');
    document.getElementById('uniqq').value=esso;
    
    
    
    
                            }
                            
function kirza(form) {
    
var zapros="swidth="+form.swidth.value+"&sradius="+form.sradius.value+"&sdisk_dia="+form.sdisk_dia.value+"&sdisk_sverlovka="+form.sdisk_sverlovka.value+"&set="+form.set.value+"&sbrand="+form.sbrand.value;
    
    
    	if(xmlHttp) {	
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/podbor_disk.php", true);
		xmlHttp.onreadystatechange=handleServerResponse1214;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('kirza('+form+')', 1000);
			}
    
    
}


function handleServerResponse1214() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('kimono').innerHTML=response;
	//hidetimer();
	}
		else setTimeout('handleServerResponse1214()', 500);
	}
}      


function kirza11(form) {
    
var zapros="swidth="+form.swidth.value+"&sheight="+form.sheight.value+"&sradius="+form.sradius.value+"&sbrand="+form.sbrand.value+"&sauto_type="+form.sauto_type.value+"&ssezon="+form.ssezon.value+"&sshipi="+form.sshipi.value;
    
   
    	if(xmlHttp) {	
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/podbor_tire.php", true);
		xmlHttp.onreadystatechange=handleServerResponse1215;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('kirza11('+form+')', 1000);
			}
    
    
}


function handleServerResponse1215() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('kimono11').innerHTML=response;
        
         //alert("test");
        
	//hidetimer();
	}
		else setTimeout('handleServerResponse1215()', 500);
	}
}                


function koleso(form) {
    
var zapros="swidth="+form.swidth.value+"&sradius="+form.sradius.value+"&sdisk_dia="+form.sdisk_dia.value+"&sdisk_sverlovka="+form.sdisk_sverlovka.value+"&set="+form.set.value+"&sbrand="+form.sbrand.value;
    
    
    	if(xmlHttp) {	
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/podbor_disk_title.php", true);
		xmlHttp.onreadystatechange=handleServerResponse1216;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('koleso('+form+')', 1000);
			}
    
    
}


function handleServerResponse1216() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('chita1').innerHTML=response;
	//hidetimer();
	}
		else setTimeout('handleServerResponse1216()', 500);
	}
}      

function koleso11(form) {
    
var zapros="swidth="+form.swidth.value+"&sheight="+form.sheight.value+"&sradius="+form.sradius.value+"&sbrand="+form.sbrand.value+"&sauto_type="+form.sauto_type.value+"&ssezon="+form.ssezon.value;
    
   
    	if(xmlHttp) {	
	
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/podbor_tire_title.php", true);
		xmlHttp.onreadystatechange=handleServerResponse1217;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('koleso11('+form+')', 1000);
			}
    
    
}


function handleServerResponse1217() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('chita2').innerHTML=response;
        
         //alert("test");
        
	//hidetimer();
	}
		else setTimeout('handleServerResponse1217()', 500);
	}
}



//Выводим марки авто

function showmodels(entry) {
	
//	alert(entry.value);
	
	
	
	zapros="marka_id="+entry;
	document.getElementById('years').innerHTML='Год выпуска<br /><select name="years"><option value=""></option></select> ';
        document.getElementById('modification').innerHTML='Модификация<br /><select name="modification"><option value=""></option></select> ';
        
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/models.php", true);
		xmlHttp.onreadystatechange=handleServerResponse11;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showmodels('+entry+')', 1000);
			}
}
function handleServerResponse11() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('model').innerHTML=response;
        
        
        
	//hidetimer();
	}
		else setTimeout('handleServerResponse11()', 500);
	}
}


//Выводим год авто

function showyears(entry) {
	
//	alert(entry.value);
	
	
	
	zapros="model_id="+entry;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/years.php", true);
		xmlHttp.onreadystatechange=handleServerResponse12;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showyears('+entry+')', 1000);
			}
}
function handleServerResponse12() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('years').innerHTML=response;
document.getElementById('modification').innerHTML='Модификация<br /><select name="modification"><option value=""></option></select> ';
	}
		else setTimeout('handleServerResponse12()', 500);
	}
}


//Выводим модификацию
function showmodifcation(entry) {
	
	
	zapros="year_id="+entry+"&model_id="+document.getElementById('mdd').value;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/modification.php", true);
		xmlHttp.onreadystatechange=handleServerResponse13;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showmodifcation('+entry+')', 1000);
			}
}
function handleServerResponse13() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('modification').innerHTML=response;
	//hidetimer();
	}
		else setTimeout('handleServerResponse13()', 500);
	}
}


function bigben(entry) {
    
    document.getElementById('vibor').className='blok'+entry;
    
    
    if(entry==1) {
        document.getElementById('link1').className='inok1_';
        document.getElementById('link2').className='inok2';
        document.getElementById('link3').className='inok3';
        }
    else if(entry==2) {
        document.getElementById('link1').className='inok1';
        document.getElementById('link2').className='inok2_';
        document.getElementById('link3').className='inok3';
        }    
    else if(entry==3) {
        document.getElementById('link1').className='inok1';
        document.getElementById('link2').className='inok2';
        document.getElementById('link3').className='inok3_';
        }   
    
    
    document.getElementById('select1').style.display='none';
    document.getElementById('select2').style.display='none';
    document.getElementById('select3').style.display='none';
    
    document.getElementById('select'+entry).style.display='';
}

function showmodels_srav(entry) {
	
//	alert(entry.value);
	
	
	
	zapros="marka_id="+entry;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/models_srav.php", true);
		xmlHttp.onreadystatechange=handleServerResponse211;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showmodels_srav('+entry+')', 1000);
			}
}
function handleServerResponse211() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('model11').innerHTML=response;
  	}
		else setTimeout('handleServerResponse211()', 500);
	}
}

function showmodels_srav11(entry) {
	
//	alert(entry.value);
	
	
	
	zapros="marka_id="+entry;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/models_srav11.php", true);
		xmlHttp.onreadystatechange=handleServerResponse219;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showmodels_srav11('+entry+')', 1000);
			}
}
function handleServerResponse219() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('model11').innerHTML=response;
  	}
		else setTimeout('handleServerResponse219()', 500);
	}
}


function showrazmer_srav(entry) {
	
//	alert(entry.value);
	
	
	
	zapros="marka1_id="+entry;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/razmer_srav.php", true);
		xmlHttp.onreadystatechange=handleServerResponse9111;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
//	else setTimeout('showrazmer_srav('+entry+')', 1000);
			}
}
function handleServerResponse9111() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('razmer').innerHTML=response;
  	}
		else setTimeout('handleServerResponse9111()', 500);
	}
}

function kolb(val, ids) {
    
    
    if(document.getElementById(ids).checked===true) {
        
        tem1=val.split('_');
        
        zapros="marka_id="+tem1[0]+"&model_id="+tem1[1]+"&razmer="+tem1[2]+"&page=";
        
        
       	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/addtosrav.php", true);
		xmlHttp.onreadystatechange=handleServerResponse311;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('kolb('+val+', '+ids+')', 1000);
			} 
        
        
    }
    
}



function addtosrav(form) {
    
    //alert("marka: "+form.marka.value+" model: "+form.model.value);
    
    zapros="marka_id="+form.marka.value+"&model_id="+form.model.value+"&razmer="+form.razmer.value+"&page="+form.page.value;
	
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/addtosrav.php", true);
		xmlHttp.onreadystatechange=handleServerResponse311;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('addtosrav('+form+')', 1000);
			}
    
    
}

function handleServerResponse311() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		if(response=='no') {}
        else location.href='index.php?page=comparison';
  	}
		else setTimeout('handleServerResponse311()', 500);
	}
}












function sravv() {
    
    	var forma=document.getElementById('kimka');
	zapros='';
		var count=0;
for(var i=0; i<forma.length; i++)
{
	if(forma.elements[i].checked===true && forma.elements[i].name=='kiper') {count++; zapros+="cid"+count+"="+forma.elements[i].value+"&";}
}

zapros+="count="+count;

//alert(zapros);

if(count>0) {
    
    	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/addtosrav11.php", true);
		xmlHttp.onreadystatechange=handleServerResponse193;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('sravv()', 1000);
			}
    
    
    
} else {
    
    alert("Вы не выбрали товар");
}   
    
}
function handleServerResponse193() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		if(response=='ok') location.href='index.php?page=comparison';
	//hidetimer();
	}
		else setTimeout('handleServerResponse193()', 500);
	}
}


function tosrav() {
    
    	var forma=document.getElementById('bes');
	zapros='';
		var count=0;
for(var i=0; i<forma.length; i++)
{
	if(forma.elements[i].checked===true && forma.elements[i].id=='kuda') {count++; zapros+="cid"+count+"="+forma.elements[i].value+"&";}
}

zapros+="count="+count;

//alert(zapros);

if(count>5) {alert("В сравнение можно добавить не более 5 товаров");} else {
    
    if(count>0) {
    
    	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/tosrav.php", true);
		xmlHttp.onreadystatechange=handleServerResponse1213;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('tosrav()', 1000);
			}
    
    
    
} else {
    
    alert("Вы не выбрали товар");
} 
    
    
} 
    
}
function handleServerResponse1213() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		if(response=='ok') location.href='index.php?page=comparison';
	//hidetimer();
	}
		else setTimeout('handleServerResponse1213()', 500);
	}
}

function dudka(entry, id) {
    
    for(var i=1; i<=entry; i++) {
        
        document.getElementById('rend_'+i).style.display='none';
        
        
    }
    document.getElementById('rend_'+id).style.display='';
}
