d = document;
opera = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
ie = (document.all && !opera)? true : false;
dom = (document.getElementById && !ie && !opera)? true : false;

var okk; var okk2;

if (dom || ie)
{
        d.writeln('<STYLE type="text/css">');
        d.writeln('.subcat { display: none; }');
        d.writeln('</STYLE>');
}

function zoom(gal,wid,hei)
{
var n1=parseInt(wid);
var n2=parseInt(hei);
var wid2 = n1+5;
var hei2 = n2+10;
window.open(gal, 'gellery', "scrollbars=0,resizable=no,left=0,top=0,width="+wid2+",height="+hei2);
}

function foto(title, img, width, height, pr) {
	var width=(width ? width : 800);
	var height=(height ? height : 600);
	var win=window.open('', '_blank', 'width='+width+', height='+height+', left='+((screen.width-width)/2)+', top='+((screen.height-height)/2)+', toolbar=no, menubar=no, resizable=yes, status=yes, location=no, alwaysRaised=yes, scrollbars=no');
	win.document.write('<html><head><title>'+title+'</title></head><body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0"><table width="100%" cellpadding="0" cellspacing="0" border="0" height="100%"><tr><td width="100%" align="center"><img src="/'+img+'" border="0" style="border:1px solid #bbbbbb;"></td></tr></table></body></html>');
}


function change_bg(id1,color,color2){
document.getElementById(id1).style.background=color;
document.getElementById(id1+'a').style.color=color2;
}

function change_bg2(id1,color,color2){
document.getElementById(id1+'y').style.background=color;
document.getElementById(id1+'b').style.color=color2;
}


function ontm() {
if (document.getElementById('model').style.display == 'block'){ okk = setTimeout("hd()", 600); }
}

function offtm() {
clearTimeout(okk)
}


function hd(){
document.getElementById('model').style.display = 'none';
}



function ontm2() {if (document.getElementById('year').style.display == 'block'){ okk2 = setTimeout("hd2()", 600); }}
function offtm2() {clearTimeout(okk2)}
function hd2(){document.getElementById('year').style.display = 'none';}



function ontm11() {if (document.getElementById('brand').style.display == 'block'){ okk2 = setTimeout("hd11()", 600); }}
function offtm11() {clearTimeout(okk2)}
function hd11(){document.getElementById('brand').style.display = 'none';}

function ontm12() {if (document.getElementById('model').style.display == 'block'){ okk2 = setTimeout("hd12()", 600); }}
function offtm12() {clearTimeout(okk2)}
function hd12(){document.getElementById('model').style.display = 'none';}


function ontm13() {if (document.getElementById('year').style.display == 'block'){ okk2 = setTimeout("hd13()", 600); }}
function offtm13() {clearTimeout(okk2)}
function hd13(){document.getElementById('year').style.display = 'none';}


function nm_m(id){
var mdd = document.getElementById(id).innerHTML;
document.getElementById('md').innerHTML=mdd;
document.getElementById('model').style.display = 'none';
document.getElementById('yr').innerHTML='Выберите год выпуска';
}

function nm_m2(id){
var mdd = document.getElementById(id).innerHTML;
document.getElementById('br').innerHTML=mdd;
document.getElementById('brand').style.display = 'none';
document.getElementById('md').innerHTML='Выберите модель';
document.getElementById('yr').innerHTML='Выберите год выпуска'
document.getElementById('year').innerHTML='';
}
