window.status="Автоцентр Элан-Моторс. Телефон: (812) 331 90 00"
// Статистика
 var bV=parseInt(navigator.appVersion);
 NS3=(document.layers) ? noundo : false;
 IE4=((document.all)&&(bV>=4))?true:false;
 ver4 = (NS3 || IE4) ? true : false;

 function expandIt()
  { return }


 isExpanded = false;

 function initIt()
  { tempColl = document.all.tags("DIV");
    for (i=0; i<tempColl.length; i++)
     { if (tempColl(i).className == "child") tempColl(i).style.display = "none";
     }
  }

 function expandIt(el)
  { if (!ver4) return;
    expandIE(el);
  }

 function expandIE(el)
  { whichEl = eval(el + "Child");
    whichIm = eval(el + "Image");
    if (whichEl.style.display == "none")
     { whichEl.style.display = "block";
       whichIm.src = "../img/pf_white_text_2.gif";
     }
    else
     { whichEl.style.display = "none";
       whichIm.src = "../img/pf_white_text_1.gif";
     }
  }

 with (document)
  { write("<STYLE TYPE='text/css'>");
    write(".child {display:none}")
    write(".childo{display:block}")
    write("</STYLE>");
  }

 onload = initIt;

// Фотогалерея
shown=''
function OnWPhoto(url) {
if( shown=='' || shown.closed) {
	shown=window.open(url,'OnWPhoto','scrollbars=no,status=no, high,width=420,height=320');
}
else{
	shown.close();
	shown=window.open(url,'OnWPhoto','scrollbars=no,status=no, high,width=420,height=320');
}
}

// Карта подъезда
shown=''
function OnW1(url) {
if( shown=='' || shown.closed) {
	shown=window.open(url,'OnW1','scrollbars=no,status=no, high,width=570,height=485');
}
else{
	shown.close();
	shown=window.open(url,'OnW1','scrollbars=no,status=no, high,width=570,height=485');
}
}

// Подарки для покупателей автомобиля
shown=''
function OnW3(url) {
if( shown=='' || shown.closed) {
	shown=window.open(url,'OnW3','scrollbars=yes,status=no, high,width=300,height=200');
}
else{
	shown.close();
	shown=window.open(url,'OnW3','scrollbars=yes,status=no, high,width=300,height=200');
}
}

// Цены на автомобили
shown=''
function OnW2(url) {
if( shown=='' || shown.closed) {
	shown=window.open(url,'OnW2','scrollbars=no,status=no, high,width=400,height=200');
}
else{
	shown.close();
	shown=window.open(url,'OnW2','scrollbars=no,status=no, high,width=400,height=200');
}
}

// Фотографии - Автосалоны
shown=''
function OnWSalon(url) {
if( shown=='' || shown.closed) {
	shown=window.open(url,'OnWSalon','scrollbars=no,status=no, high,width=250,height=198');
}
else{
	shown.close();
	shown=window.open(url,'OnWSalon','scrollbars=no,status=no, high,width=250,height=198');
}
}

// ЦВЕТА КУЗОВА
shown=''
function OnWColor(url) {
if( shown=='' || shown.closed) {
	shown=window.open(url,'OnWColor','scrollbars=ye s,status=no, high,width=600,height=500');
}
else{
	shown.close();
	shown=window.open(url,'OnWColor','scrollbars=yes,status=no, high,width=600,height=500');
}
}

// Год
today=new Date();
// Build an array initializer
function isnArray() {
argnr=isnArray.arguments.length
for (var i=0;i<argnr;i++) {
this[i+1] = isnArray.arguments[i];
}
}

// Логотипы
    function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;}}
	var preloadFlag = false;
	function preloadImages() {
	if (document.images) {

		img1on = newImage("../img/kia_02.gif"); 	img1off = newImage("../img/kia_01.gif");
		img2on = newImage("../img/daewoo_02.gif"); 	img2off = newImage("../img/daewoo_01.gif");
		img3on = newImage("../img/hyundai_02.gif"); 	img3off = newImage("../img/hyundai_01.gif");
		img4on = newImage("../img/peugeot_02.gif"); 	img4off = newImage("../img/peugeot_01.gif");

		img10 = newImage("../img/kia_03.gif");
		img20 = newImage("../img/kia_03.gif");
		img30 = newImage("../img/daewoo_03.gif");
		img40 = newImage("../img/daewoo_03.gif");
		img50 = newImage("../img/hyundai_03.gif");
		img70 = newImage("../img/peugeot_03.gif");
		img80 = newImage("../img/peugeot_03.gif");

		pixel1 = newImage("../img/kia_01.gif");
                                pixel2 = newImage("../img/daewoo_01.gif");
                                pixel3 = newImage("../img/hyundai_01.gif");
                                pixel4 = newImage("../img/peugeot_01.gif");

		preloadFlag = true;	}}
		preloadImages();

	function img_click(imgName)
               {   if (document.images && (preloadFlag == true)){ imgAct = eval (imgName + "act.src"); document [imgName].src = imgAct;} }
    //--
	function img_act(imgName1, imgName2)
	{	if (document.images && (preloadFlag == true)){
	imgOn1 = eval (imgName1 + "on.src"); document [imgName1].src = imgOn1;
	imgOn2 = eval (imgName2 + ".src"); document ['img1'].src = imgOn2;
	} }
	function img_inact(imgName)
	{	if (document.images && (preloadFlag == true)){
	imgOff = eval (imgName + "off.src"); document [imgName].src = imgOff;
	document ['img1'].src = "../img/kia_01.gif";
	} }
    //--
	function img_act2(imgName1, imgName2)
	{	if (document.images && (preloadFlag == true)){
	imgOn1 = eval (imgName1 + "on.src"); document [imgName1].src = imgOn1;
	imgOn2 = eval (imgName2 + ".src"); document ['img2'].src = imgOn2;
	} }
	function img_inact2(imgName)
	{	if (document.images && (preloadFlag == true)){
	imgOff = eval (imgName + "off.src"); document [imgName].src = imgOff;
	document ['img2'].src = "../img/daewoo_01.gif";
	} }
    //--
	function img_act3(imgName1, imgName2)
	{	if (document.images && (preloadFlag == true)){
	imgOn1 = eval (imgName1 + "on.src"); document [imgName1].src = imgOn1;
	imgOn2 = eval (imgName2 + ".src"); document ['img3'].src = imgOn2;
	} }
	function img_inact3(imgName)
	{	if (document.images && (preloadFlag == true)){
	imgOff = eval (imgName + "off.src"); document [imgName].src = imgOff;
	document ['img3'].src = "../img/hyundai_01.gif";
	} }
    //--
	function img_act4(imgName1, imgName2)
	{	if (document.images && (preloadFlag == true)){
	imgOn1 = eval (imgName1 + "on.src"); document [imgName1].src = imgOn1;
	imgOn2 = eval (imgName2 + ".src"); document ['img4'].src = imgOn2;
	} }
	function img_inact4(imgName)
	{	if (document.images && (preloadFlag == true)){
	imgOff = eval (imgName + "off.src"); document [imgName].src = imgOff;
	document ['img4'].src = "../img/peugeot_01.gif";
	} }
    //--
	function img_act5(imgName1, imgName2)
	{	if (document.images && (preloadFlag == true)){
	imgOn1 = eval (imgName1 + "on.src"); document [imgName1].src = imgOn1;
	imgOn2 = eval (imgName2 + ".src"); document ['img5'].src = imgOn2;
	} }
	function img_inact5(imgName)
	{	if (document.images && (preloadFlag == true)){
	imgOff = eval (imgName + "off.src"); document [imgName].src = imgOff;
	document ['img5'].src = "../img/peugeot_01.gif";
	} }

//Фотографии
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

//Меню навигации
timerID=null;
timerShowID=null;

function stopTimer(){
if (timerID!=null){
	clearTimeout(timerID);
	}
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
}

function timeoutShow(timer, id, tpos){
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
timerShowID=setTimeout("showMenu("+id+", " +tpos +")",timer);
}

function showMenu(id,tpos){
if (timerID!=null){
	clearTimeout(timerID);
	}
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
hideMenu();
id.style.display='block';
var cid="topTable.offsetTop+tpos"+tpos+".offsetTop+(tpos"+tpos+".offsetHeight)/2";
//alert(eval(cid));
id.style.top=eval(cid);
//id.style.left=event.x;
}

function timeoutHide(timer){
if (timerID!=null){
	clearTimeout(timerID);
	}
	timerID=setTimeout("hideMenu()",timer);
}

//------------------------------------------------------------------------------------
function showhide(d,l){
    if (d.style.display!="block"){
        d.style.display="block";
        l.innerHTML='&minus;'+l.innerHTML.substring(1);
    } else {
        d.style.display="none";
        l.innerHTML='+'+l.innerHTML.substring(1);
        }
}

function openwin(myurl,mx,my,name)
 {
if(name==null){name="popup";}
  nn4 = (document.layers)? true : false;
  ie4 = (document.all)? true : false;
  wx = Math.round((screen.width - mx) / 2);
  wy = Math.round((screen.height - my) / 2);
  wpos = (nn4)? "screenX="+wx+",screenY="+wy : "left="+wx+",top="+wy;
  var a = window.open(myurl,name,"resizable=yes, menubar=no,toolbars=no,scrollbars=yes,width=" + mx + ",height=" + my + "," + wpos);
  a.focus();
 }

function openimg(myurl,mx,my,name)
 {
  if (a!=null){a.close();}
  mx=mx+30;
  my=my+57;
  if(name==null){name="sv";}
  nn4 = (document.layers)? true : false;
  ie4 = (document.all)? true : false;
  wx = Math.round((screen.width - mx) / 2);
  wy = Math.round((screen.height - my) / 2);
  wpos = (nn4)? "screenX="+wx+",screenY="+wy : "left="+wx+",top="+wy;
  var a = window.open(myurl,name,"resizable=no, menubar=no,toolbars=no,scrollbars=no,width="+mx+",height="+my+"," + wpos);
  a.resizeTo(mx, my);
  a.focus();
 }


// Цвета
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


// Мигающие ссылки

function a_active2(blkid){
  try{var nl=document.getElementById(blkid).getElementsByTagName('a');
	for (var i=0;i<nl.length;i++){

  if(nl[i].className=='blred'){nl[i].className='blred2';}else{
  if(nl[i].className=='blred2'){nl[i].className='blred';}}

  if(nl[i].className=='blgreen'){nl[i].className='blgreen2';}else{
  if(nl[i].className=='blgreen2'){nl[i].className='blgreen';}}

	}
  }
catch(e){}
}

// Цвета кузова

idold= 'c' + '00';
function  change(divid)
{
if (idold!=divid)
{
eval(idold+".style.visibility='hidden'");
eval(idold+".style.display='none'");
eval(divid+".style.visibility='visible'");
eval(divid+".style.display='inline'");
}
idold=divid;
}

