function ja(t){
      Top = $(t.hash).offset().top;
      $('html,body').animate({scrollTop: Top}, 1000, 'swing');
    return false;
  }

function GetModelList(to, manuf, type, sel)
{
	if(manuf == '' || manuf == 'all')
	{
		$('#'+to).html('<option value="">любая</option>');
		return;
	}

	var mods = (type=='t') ?tmodel[manuf] : wmodel[manuf];
	if(!$('#'+to) || !mods.length)return;

	var htmlmodel = new Array;
	htmlmodel.push('<option value="">любая</option>');
	for(var vr in mods )
	{
		var mo = mods[vr].split('^^');
		htmlmodel.push('<option value="'+mo[0]+'"'+((sel==mo[0]) ? ' selected' : '')+'>'+mo[1]+'</option>');
	}
	$('#'+to).html(htmlmodel.join(''));
}


//удержим сессию
$(document).ready(function ()
{
setInterval(function() { $('#sess_img').attr('src', '/blank.php?s='+Math.random());}, 900000);
});


function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

function setCookie(name, value, expiredays, path, domain, secure) {
   if (expiredays) {
      var exdate=new Date();
      exdate.setDate(exdate.getDate()+expiredays);
      var expires = exdate.toGMTString();
   }
   document.cookie = name + "=" + escape(value) +
   ((expiredays) ? "; expires=" + expires : "") +
   ((path) ? "; path=" + path : "") +
   ((domain) ? "; domain=" + domain : "") +
   ((secure) ? "; secure" : "");
}


function getParam(name) {
	var query = window.location.href.substring(window.location.href.indexOf('?') + 1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == name) {
			return pair[1].replace(/\%2C/, ',');
		}
	}
	return null;
}

function getPage() {
	var query = window.location.href.split("/");
	var vars = query[3].split(".");
	return vars[0];
	//return false;
}



/* a2t **/
function t2a()
{
document.write('<div id="t2a_form"><form method="post" enctype="multipart/form-data" name=qformauto onsubmit="return false"><input type="hidden" name="ln" value="">');
document.write('<div class="title_form"><b><a href="http://www.shina.ru/selection_of_the_car.php">Подбор шин и дисков по авто:</a></b></div>');

document.write('<div class="manuf">Марка:<br><select name="qmanufacture" id="qmanufacture" onchange="qload_models();"  style="width:230px"><option></option>');
for(var k in manuft2a)
{
	document.write('<option value="'+k+'">'+manuft2a[k]+'</option>');
}
document.write('</select></div>');

document.write('<div id="qmodels" style="display:none">Модель:<br><select name="qmodel" id="qmodel" onchange="qload_years();"  style="width:230px" disabled><option></option></select></div>');

document.write('<div id="qyears" style="display:none">Год выпуска:<br><select name="qyear" id="qyear" onchange="qload_modification();" style="width:230px" disabled><option></option></select></div>');

document.write('<div id="qmodif" style="display:none">Комплектация:<br><select name="qmodification" id="qmodification" onchange="qload_auto();" style="width:230px" disabled><option></option></select></div>');

document.write('<span id="qwait" style="display:none"><img src="/img/wait_small.gif" alt="" border=0 width=16 height=16 /></span>  <div class="button_form"><input type="Submit" value="перейти" disabled name=sb onclick="qclick();">&nbsp;<input type=submit  disabled  name=cl style="color:#FF2424; font-size:12px;" value="&#215;" title="очистить форму" onclick="return cf(\'t2a\');"></div>');
document.write('</form></div>');




var save_auto = getCookie('save_auto');

if(save_auto != '' && save_auto != null)
{
	var save_auto_models_ = getCookie('save_auto_models');
	var save_auto_years_ = getCookie('save_auto_years');
	var save_auto_compls_ = getCookie('save_auto_compls');
	var save_auto_data_ = getCookie('save_auto_data');

	var save_auto_models = save_auto_models_.split('~');
	var save_auto_years = save_auto_years_.split('~');
	var save_auto_compls = save_auto_compls_.split('~');
	var save_auto_data = save_auto_data_.split('~');

	//manuf
	for(a=0; a<document.qformauto.qmanufacture.options.length; a++)
	{
		if(document.qformauto.qmanufacture.options[a].value==save_auto_data[2])document.qformauto.qmanufacture.options[a].selected=true;
	}

    //models
	var objSel = document.getElementById('qmodel');
	for(a=0; a<save_auto_models.length; a++)
	{
		mod = save_auto_models[a].split(';');
		qaddOption(objSel, mod[1].replace(/\+/g, ' '), mod[0], '', ((save_auto_data[0]==mod[0]) ? 1 : 0));
	}
 	objSel.disabled = false;
	document.getElementById('qmodels').style.display='';

	//year
	var objSel = document.getElementById('qyear');
	for(a=0; a<save_auto_years.length; a++)
	{
		qaddOption(objSel, save_auto_years[a], save_auto_years[a], '', ((save_auto_data[1]==save_auto_years[a]) ? 1 : 0));

	}
 	objSel.disabled = false;
	document.getElementById('qyears').style.display='';

    //modification
	var objSel = document.getElementById('qmodification');
	for(a=0; a<save_auto_compls.length; a++)
	{
		mod = save_auto_compls[a].split(';');
		qaddOption(objSel, mod[1].replace(/\+/g, ' '), mod[0], '', ((save_auto==mod[0]) ? 1 : 0));
	}
 	objSel.disabled = false;
	document.getElementById('qmodif').style.display='';

	qload_auto();
document.qformauto.cl.disabled=false;

}
}


    function qload_models() {
if(document.qformauto.qmanufacture.selectedIndex==0)return;
    	//document.getElementById('autofinish').innerHTML='';
document.qformauto.sb.disabled=true;
document.qformauto.qmanufacture.options[0].disabled=true;
qAllEnabled();

    	var objSel = document.getElementById('qmodel');
    	objSel.options.length=1;
    	objSel.disabled=true;
    	var objSel2 = document.getElementById('qyear');
    	objSel2.options.length=1;
    	objSel2.disabled=true;
    	var objSel3 = document.getElementById('qmodification');
    	objSel3.options.length=1;
    	objSel3.disabled=true;
    	document.getElementById('qwait').style.display='';
        JsHttpRequest.query(
            '/services/selection_of_the_car/ajax.php',
            {
		'GetModels': document.qformauto.qmanufacture.options[document.qformauto.qmanufacture.selectedIndex].value
            },
            function(result, errors) {
                if (result) {
                    for(a=0; a<result['models'].length; a++)
                    {

                    	qaddOption(objSel, result['models'][a][1], result['models'][a][0]);

                    }
                    objSel.disabled = false;
document.getElementById('qmodels').style.display='';
                    document.getElementById('qwait').style.display='none';
                }
            },
            false
        );
document.qformauto.cl.disabled=false;
    }


    function qload_years() {
if(document.qformauto.qmodel.selectedIndex==0)return;
qAllEnabled();
    	//document.getElementById('model').remove(0);
document.qformauto.sb.disabled=true;
    	//document.getElementById('autofinish').innerHTML='';
    	var objSel2 = document.getElementById('qyear');
    	objSel2.options.length=1;
    	objSel2.disabled=true;
    	var objSel3 = document.getElementById('qmodification');
    	objSel3.options.length=1;
    	objSel3.disabled=true;

		document.getElementById('qwait').style.display='';
        JsHttpRequest.query(
            '/services/selection_of_the_car/ajax.php',
            {

                'Manufacture': document.qformauto.qmanufacture.options[document.qformauto.qmanufacture.selectedIndex].value,
                'GetYears': document.qformauto.qmodel.options[document.qformauto.qmodel.selectedIndex].value
            },
            function(result, errors) {
                if (result) {
                    var objSel = document.getElementById('qyear');
                    objSel.options.length=1;
                    for(a=0; a<result['years'].length; a++)
                    {

                    	qaddOption(objSel, result['years'][a], result['years'][a]);
                    }
                    objSel.disabled = false;
document.getElementById('qyears').style.display='';
                    document.getElementById('qwait').style.display='none';
document.qformauto.qmodel.options[0].disabled=true;
                }
            },
            false
        );
document.qformauto.cl.disabled=false;
    }



    function qload_modification() {
if(document.qformauto.qyear.selectedIndex==0)return;

    	qAllEnabled();
    	document.getElementById('qwait').style.display='';
document.qformauto.sb.disabled=true;
        JsHttpRequest.query(
            '/services/selection_of_the_car/ajax.php',
            {
                'Manufacture': document.qformauto.qmanufacture.options[document.qformauto.qmanufacture.selectedIndex].value,
                'Model': document.qformauto.qmodel.options[document.qformauto.qmodel.selectedIndex].value,
                'GetModification': document.qformauto.qyear.options[document.qformauto.qyear.selectedIndex].value




            },
            function(result, errors) {
                if (result) {
                    var objSel = document.getElementById('qmodification');
                    objSel.options.length=1;
                    for(a=0; a<result['modifications'].length; a++)
                    {

                    	qaddOption(objSel, result['modifications'][a][1], result['modifications'][a][0]);
                    }
                    objSel.disabled = false;
document.getElementById('qmodif').style.display='';
                    document.getElementById('qwait').style.display='none';
document.qformauto.qyear.options[0].disabled=true;
                }
            },
            false
        );
document.qformauto.cl.disabled=false;
    }

    function qload_auto() {
if(document.qformauto.qmodification.selectedIndex==0)return;
document.qformauto.qmodification.options[0].disabled=true;
document.qformauto.ln.value=document.qformauto.qmodification.options[document.qformauto.qmodification.selectedIndex].value;
document.qformauto.sb.disabled=false;
document.qformauto.cl.disabled=false;

    }

function qclick()
{
window.location.href='/selection_of_the_car.php?automobile='+document.qformauto.ln.value;
}


function qaddOption (oListbox, text, value, isDefaultSelected, isSelected)
{
  var oOption = document.createElement('option');
  oOption.appendChild(document.createTextNode(text));
  oOption.setAttribute('value', value);

  if (isDefaultSelected) oOption.defaultSelected = true;
  else if (isSelected) oOption.selected = true;

  oListbox.appendChild(oOption);
}

function qAllEnabled()
{
document.qformauto.qyear.options[0].disabled=false;
document.qformauto.qmodel.options[0].disabled=false;
document.qformauto.qmodification.options[0].disabled=false;
}





/*Forms**/
function wheel_form()
{
var wke='';
getwM = getParam('manufacture');
getwMO = getParam('model');
getwW = getParam('w');
getwD = getParam('d');
getwP = getParam('pcd');
getwtype = getParam('type');
getwCat = getParam('iscat');
getpg = getPage();

//if(getpg=='diski')return '';

document.write('<div id="wheel_form" '+((getpg=='diski') ? 'style="display:none"' : '')+'><div class="title_form"><b><a href="http://www.shina.ru/price-wheels.shtml">Поиск дисков:</a></b></div><form name=fast_search_wheel action="http://www.shina.ru/price-wheels.shtml"  onsubmit="return check(\'wheel\');" method=get><input type="hidden" name="wheel" value="1"><input type=hidden name=id value="43">');

document.write('<div class="manuf">Марка <select name="manufacture" title="Производитель дисков" onchange="GetModelList(\'qwmodel\', $(this).val(), \'w\', 0)">');
for(var k in wmanuf_k)
{
	document.write('<option value="'+wmanuf_k[k]+'"'+((getwM==wmanuf_k[k])?' selected':'')+'>'+wmanuf_v[k]+'</option>');
}
document.write('</select></div>');


document.write('<div class="model">Модель <select name="model" id="qwmodel" title="Модель диска">');
document.write('<option value="">любая</option>');
if(getwM)
{
	for(var mm in wmodel[getwM])
	{
		var mo = wmodel[getwM][mm].split('^^');
		document.write('<option value="'+mo[0]+'"'+((getwMO==mo[0])?' selected':'')+'>'+mo[1]+'</option>');
	}
}
document.write('</select></div>');



document.write('<div class="size"><select name="w" title="ширина диска">');
for(var k in wwidth)
{
if(wwidth[k]=='-')wke='all';
else wke = wwidth[k];
	if(wwidth[k]=='-')document.write('<optgroup label="Ширина">');
	document.write('<option value="'+wke+'"'+((getwW== wwidth[k])?' selected':'')+'>'+wwidth[k]+'</option>');
}

document.write('</optgroup></select>&nbsp;&nbsp;X&nbsp;&nbsp;');

document.write('<select name="d">');
for(var k in wdiameter)
{
if(wdiameter[k]=='-')wke='all';
else wke = wdiameter[k];
	if(wdiameter[k]=='-')document.write('<optgroup label="Диам.">');
	document.write('<option value="'+wke+'"'+((getwD==wdiameter[k])?' selected':'')+'>'+wdiameter[k]+'</option>');
}
document.write('</optgroup></select> ');

document.write('<select name="pcd" title="Крепление (PCD)">');
for(var k in pcd)
{
if(pcd[k]=='-')wke='all';
else wke = pcd[k];
	if(pcd[k]=='-')document.write('<optgroup label="Крепл.">');
	document.write('<option value="'+wke+'"'+((getwP==pcd[k])?' selected':'')+'>'+pcd[k]+'</option>');
}
document.write('</optgroup></select></div>');

document.write('<div class="type"><label><input name="type" value="2" type="radio"'+((getwtype==2)?' checked':'')+'>&nbsp;Легкосплавный</label>&nbsp;&nbsp;');
document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label><input name="type" value="1" type="radio"'+((getwtype==1)?' checked':'')+'>&nbsp;Штампованный</label>&nbsp;&nbsp;');
document.write('</div>');
document.write('<div class="iscat"><label for="iscat"><input type=checkbox name=iscat value=1'+((getwCat=='1' && getParam('wheel')=='1')?' checked':'')+' id=iscat> с картинками</label></div>');
document.write('<div class="button_form"><input type="Submit" value="искать">&nbsp;<input type=submit style="color:#FF2424; font-size:12px;" value="&#215;" title="очистить форму" onclick="return cf(\'wheel\');"></div>');
document.write('</form></div>');
}

function tyre_form()
{
var wke='';
getM = getParam('manufacture');
getMO = getParam('model');
getW = getParam('sh1');
getP = getParam('sh2');
getR = getParam('shr');
getS1 = getParam('s1');
getS2 = getParam('s2');
getS3 = getParam('s3');
getS4 = getParam('s4');
getS6 = getParam('s6');
getCat = getParam('iscat');
getCargo = getParam('cargo');
getty = getParam('tyre');

getpg = getPage();

//if(getpg=='shini')return '';


document.write('<div id="tyre_form" '+((getpg=='shini') ? 'style="display:none"' : '')+'><div class="title_form"><b><a href="http://www.shina.ru/price-tyres.shtml">Поиск шин:</a></b></div><form name=fast_search_tyre action="http://www.shina.ru/price-tyres.shtml" onsubmit="return check(\'tyre\');" method=get><input type="hidden" name="tyre" value="1"><input type=hidden name=cargo value=0>');

document.write('<div class="manuf">Марка <select name="manufacture" title="Производитель шин" onchange="GetModelList(\'qtmodel\', $(this).val(), \'t\', 0)">');
for(var k in manuf_k)
{
	document.write('<option value="'+manuf_k[k]+'"'+((getM==manuf_k[k])?' selected':'')+'>'+manuf_v[k]+'</option>');
}
document.write('</select></div>');


document.write('<div class="model">Модель <select name="model" id="qtmodel" title="Модель шины">');
document.write('<option value="">любая</option>');
if(getM && getty==1)
{
	for(var mm in tmodel[getM])
	{
		var mo = tmodel[getM][mm].split('^^');
		document.write('<option value="'+mo[0]+'"'+((getMO==mo[0])?' selected':'')+'>'+mo[1]+'</option>');
	}
}
document.write('</select></div>');


document.write('<div class="size"><select name="sh1" title="ширина шины в мм. для Европейских шин и в дюймах для Американских">');
for(var k in width_1)
{
if(width_1[k]=='-')wke='all';
else wke = width_1[k];
	document.write('<option value="'+wke+'"'+((getW==width_1[k])?' selected':'')+'>'+width_1[k]+'</option>');
	if(width_1[k]=='-')document.write('<optgroup label="Euro">');
}
document.write('</optgroup><optgroup label="Usa">');
for(var k in width_2)
{

	document.write('<option value="'+width_2[k]+'"'+((getW==width_2[k])?' selected':'')+'>'+width_2[k]+'</option>');
}
document.write('</optgroup></select> / ');

document.write('<select name="sh2">');
for(var k in profile_1)
{
if(profile_1[k]=='-')wke='all';
else wke = profile_1[k];
	document.write('<option value="'+wke+'"'+((getP==profile_1[k])?' selected':'')+'>'+profile_1[k]+'</option>');
	if(profile_1[k]=='-')document.write('<optgroup label="Euro">');
}
document.write('</optgroup><optgroup label="Usa">');
for(var k in profile_2)
{
	document.write('<option value="'+profile_2[k]+'"'+((getP==profile_2[k])?' selected':'')+'>'+profile_2[k]+'</option>');
}
document.write('</optgroup></select> R ');

document.write('<select name="shr" title="Диаметр">');
for(var k in diametr)
{
if(diametr[k]=='-')wke='all';
else wke = diametr[k];

	document.write('<option value="'+wke+'"'+((getR==diametr[k])?' selected':'')+'>'+diametr[k]+'</option>');
	if(wke >= 13 && wke <= 18)document.write('<option value="'+wke+'"'+((getR==diametr[k] && getCargo==1)?' selected':'')+' class=cargoC>'+diametr[k]+'C</option>');
}
document.write('</select></div>');

document.write('<div class="seasons"><label><input name="s1" value="1" type="checkbox"'+((getS1==1)?' checked':'')+'><img src="/img/ico/sun.gif" width=20 height=20 alt="Летние"></label>&nbsp;&nbsp;');
document.write('<label><input name="s2" value="1" type="checkbox"'+((getS2==1)?' checked':'')+'><img src="/img/ico/all.gif" width=20 height=21 alt="Всесезонные"></label>&nbsp;&nbsp;');
document.write('<label><input name="s3" value="1" type="checkbox"'+((getS3==1)?' checked':'')+'><img src="/img/ico/snow.gif" width=20 height=21 alt="Зимние"></label>&nbsp;&nbsp;');
document.write('<label><input name="s4" value="1" type="checkbox"'+((getS4==1)?' checked':'')+'><img src="/img/ico/ship.gif" width=20 height=18 alt="Шипованные">');
document.write('</div>');
document.write('<div class="iscat"><label for="iscat1"><input type=checkbox name=iscat value=1'+((getCat=='1' && getParam('tyre')=='1')?' checked':'')+' id=iscat1> с картинками</label></div>');
document.write('<div class="button_form"><input type="Submit" value="искать">&nbsp;<input type=submit style="color:#FF2424; font-size:12px;" value="&#215;" title="очистить форму" onclick="return cf(\'tyre\');"></div>');
document.write('</form></div>');
}



function check(type)
{
if(type=='wheel')
{
	f = document.fast_search_wheel;

	if(f.manufacture.options[f.manufacture.selectedIndex].value=='all' &&
	f.w.options[f.w.selectedIndex].value=='all' &&
	f.d.options[f.d.selectedIndex].value=='all' &&
	f.pcd.options[f.pcd.selectedIndex].value=='all' &&
	f.d2.checked != true  &&
	f.d1.checked != true  )
	{
		alert('Поиск дисков: Нужно выбрать хотя бы одно свойство.');
		return false;
	}
}
else
{
	f = document.fast_search_tyre;

	if($(f.shr.options[f.shr.selectedIndex]).attr('class')=='cargoC')f.cargo.value=1;
	else f.cargo.value=0;
	
	if(f.manufacture.options[f.manufacture.selectedIndex].value=='all' &&
	f.sh1.options[f.sh1.selectedIndex].value=='all' &&
	f.sh2.options[f.sh2.selectedIndex].value=='all' &&
	f.shr.options[f.shr.selectedIndex].value=='all'   &&
	f.s1.checked != true &&
	f.s3.checked != true  &&
	f.s4.checked != true  &&
	f.s2.checked != true  &&
f.s6.checked != true)
	{
		alert('Поиск шин: Нужно выбрать хотя бы одно свойство.');
		return false;
	}
}
}



function ch_city(city)

{

	//alert(city);

	$('#changeregion option').each(function (i)

	{

		$('#price_'+$(this).val()).hide();

		$('#store_'+$(this).val()).hide();

$('#delivery_'+$(this).val()).hide();



	});

	/*.each(function ()

	{

		alert(this.val());

		});

		*/

	$('#price_'+city).show();

	$('#store_'+city).show();

$('#delivery_'+city).show();





	if(city == 78 || city == 77 || city == 999)

	{

		$('#tyre_where2buy').show();

		$('#wheel_where2buy').show();

		if(city == 78)

		{

			$('#w2b_78').show();

			$('#w2b_77').hide();

			$('#w2b_999').hide();

		}

		else

			if(city == 999)

			{

				$('#w2b_999').show();

				$('#w2b_77').hide();

				$('#w2b_78').hide();

			}

			else

			{


				$('#w2b_77').show();

				$('#w2b_78').hide();

				$('#w2b_999').hide();

			}

	}

	else $('#tyre_where2buy').hide();





	/*if(city == 78 && TextButton[78] != '0')*/
	if(city != 77 && window.TextButton[city])

		$('#buy_button').val('Купить со скидкой '+(TextButton[city]*$('#tobasketselect').val())+' р.');

	else

		$('#buy_button').val('Купить');





setCookie('reg', city, 400, "/");





//	alert();

}


function ch_city___(city)
{
	//alert(city);
	$('#changeregion option').each(function (i)
	{
		$('#price_'+$(this).val()).hide();
		$('#store_'+$(this).val()).hide();
$('#delivery_'+$(this).val()).hide();

	});
	/*.each(function ()
	{
		alert(this.val());
		});
		*/
	$('#price_'+city).show();
	$('#store_'+city).show();
$('#delivery_'+city).show();


	if(city == 78 || city == 77)
	{
		$('#tyre_where2buy').show();
		$('#wheel_where2buy').show();
		if(city == 78)
		{
			$('#w2b_78').show();
			$('#w2b_77').hide();
		}
		else
		{
			$('#w2b_77').show();
			$('#w2b_78').hide();
		}
	}
	else $('#tyre_where2buy').hide();


	if(city == 78 && TextButton[78] != '0')
		$('#buy_button').val('Купить со скидкой '+(TextButton[78]*$('#tobasketselect').val())+' р.');
	else
		$('#buy_button').val('Купить');


setCookie('reg', city, 400, "/");


//	alert();
}


function Video(id,name) {
	$('#TyreVideo').modal(
		{
		overlayClose:true,
		minHeight:490,
		minWidth: 830,
		autoResize: true,
		onClose: function()
			{
				//$('#TyreVideo div').html('');
				$.modal.close();
				var o = document.getElementById('reproductorYT');
				if(o)o.stopVideo();
				return true;
			}
		});

  swfobject.embedSWF(
	    'http://www.youtube.com/v/'+id+'&enablejsapi=1&rel=0&fs=1&playerapiid=reproductorYT&autoplay=1',
	    'containerYT',
	    '800','450', '8',null,null,
	    {allowScriptAccess: 'always',allowFullScreen: 'true'},
    	{id: 'reproductorYT'}
    );

	pageTracker._trackEvent('Видео', name, 'YT:'+id);
return false;
}

function ja(t){
      Top = $(t.hash).offset().top; // Узнаем положение элемента, находящегося в href ссылки
      $('html,body').animate({scrollTop: Top}, 1000, 'swing'); // Изменяем значение скроллбара на наше
    return false; // Отменяем стандартное поведение браузеров
}

function cf(type) {
	if(type=='tyre')
	{
		var idname='tyre_form';
	}
	else if(type=='wheel')
	{
		var idname='wheel_form';
	}
	else if(type=='t2a')
	{
		$('#t2a_form select').find("option:first").attr("selected","selected");	
		$('#t2a_form select:gt(0)').html("<option></option>");
		$('#t2a_form div[id*="q"]').hide();
$('#t2a_form input[name="ln"]').val("");
$('#t2a_form input[name="sb"]').attr("disabled", "disabled");
		setCookie('save_auto', '', -1);
		setCookie('save_auto_models', '', -1);
		setCookie('save_auto_years', '', -1);
		setCookie('save_auto_compls', '', -1);
		setCookie('save_auto_data', '', -1);
		return false;
	}

	else return false;

	$('#'+idname+' select').find("option:first").attr("selected","selected");
	$('#'+idname+' input:checkbox').removeAttr("checked");
	$('#'+idname+' select[name="model"]').html("<option value=''>любая</option>"); 
	
	return false;
}

