/*function wopen(imgName, w , h, Title)
{
	var wo = window.open("", "abc", "width = " + w + " , height = " + h + ", scrollbars=0, status=0");
	wo.document.open();
	var win = "";
	win = "<html><head><title>";
	win += Title;
	win += "</title></head>"
	win += "<body bgcolor='#F5F5F5' leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0' marginwidth='0' marginheight='0'>";
	win += "<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center'>";
	win += "<a href='#' onClick='self.window.close();'><img src='" + imgName + "' width='" + w + "' height='" + h + "' border='0' alt='" + Title + "'></a>";
	win += "</td></tr></table>";
	win += "</body></html>";
	w += 48;
	h += 66;
	wo.window.resizeTo(w, h);
	wo.document.write(win);
	wo.window.focus();
	wo.document.close();
}*/

/* Дичайшая дичь */
/*обдолбанные кнопки*/
//пежо
function leftMenuOver_pego(obj)
{
	obj.childNodes[0].style.color = '#FFF';
}
function leftMenuOut_pego(obj)
{
	obj.childNodes[0].style.color = '';
}
//фв
function leftMenuOver_vw(obj)
{
	obj.childNodes[0].style.color = '#FFF';
}
function leftMenuOut_vw(obj)
{
	obj.childNodes[0].style.color = '';
}

/* */
//левое меню
function leftMenuOver(obj)
{
	obj.style.background = 'url(\'/img/bg_grad.gif\') no-repeat #F0F0F0';
	obj.childNodes[0].style.color = '#FFF';
}
function leftMenuOut(obj)
{
	obj.style.background = 'url(\'/img/bg_white.gif\') no-repeat';
	obj.childNodes[0].style.color = '';
}

//left menu blue
function leftMenuOver2(obj)
{
	obj.style.background = 'url(\'/img/bg_blue2.gif\') no-repeat #F0F0F0';
	obj.childNodes[0].style.color = '#FFF';
}
function leftMenuOut2(obj)
{
	obj.style.background = 'url(\'/img/bg_blue.gif\') no-repeat';
	obj.childNodes[0].style.color = '';
}

//left menu red
function leftMenuOver3(obj)
{
	obj.style.background = 'url(\'/img/bg_red2.gif\') no-repeat #F0F0F0';
	obj.childNodes[0].style.color = '#FFF';
}
function leftMenuOut3(obj)
{
	obj.style.background = 'url(\'/img/bg_red.gif\') no-repeat';
	obj.childNodes[0].style.color = '';
}

/* --- WK Menu's ---*/
var NN		= (navigator.userAgent.lastIndexOf('Gecko') != -1) ? true : false;
var IE		= (navigator.userAgent.indexOf('IE') != -1 && navigator.userAgent.lastIndexOf('Opera') == -1) ? true : false;
var Opera	= (navigator.userAgent.lastIndexOf('Opera') != -1) ? true : false; 

function over(obj)
{
	var a = obj.getElementsByTagName('DIV')[0];
	var b = obj.getElementsByTagName('DIV')[1];
	
	if(a)
	{
		a.className								= 'wh';
		a.childNodes[0].style.color				= '#FFF';
		a.childNodes[0].style.textDecoration	= 'none';
		
		/*a.style.background	= 'url(../img/bg_bl.gif)'*/
	}
	
	if(b)
	{
		b.className								= 'ju1';
	}		
		
	if(!IE)
	{
		obj.style.overflow = 'show';
	}
	else
	{
		obj.style.overflow = 'visible';
	}
	
	obj.style.height = 'auto';
}

function out(obj)
{
	var a = obj.getElementsByTagName('DIV')[0];
	var b = obj.getElementsByTagName('DIV')[1];
	
	if(a)
	{
		a.className					= '';
		a.childNodes[0].style.color	= '';
		
		/*a.style.background	= ''*/
	}
	
	if(b)
	{
		b.className					= 'ju';	
	}
	
	obj.style.overflow = '';
	obj.style.height = '';
}

function ChangeFoto(sImg)
	{
		var img = document.getElementById('CarIDF');
		img.src = sImg;
	}
	
	
/*модифицированная wopen*/
/*function wopen(obj)
{
    var img = new proxyImage(obj);
	var w, h;
	
	w = 30;
	h = 50;

   var wo = window.open("", "abc", "width = " + img.getBigImageWidth() + " , height = " + img.getBigImageHeight() + ", scrollbars=0, status=0");
   wo.document.open();
   var win = "";
   win = "<html><head><title>";
   win += img.getBigImageAlt();
   win += "</title></head>"
   win += "<body bgcolor='#F5F5F5' leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0' marginwidth='0' marginheight='0'>";
   win += "<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center'>";
   win += "<a href='#' onClick='self.window.close();'><img src='" + img.getBigImageSrc() + "' width='" + img.getBigImageWidth() + "' height='" + img.getBigImageHeight() + "' border='0' alt='" + img.getBigImageAlt() + "'></a>";
   win += "</td></tr></table>";
   win += "</body></html>";
  
w += parseInt(img.getBigImageWidth());
h += parseInt(img.getBigImageHeight());

   wo.window.resizeTo(w, h);
   wo.document.write(win);
   wo.window.focus();
   wo.document.close();
}
*/
function proxyImage(srcSmallImg)
{
            this.getBigImageSrc = getBigImageSrc;
            this.getBigImageAlt = getBigImageAlt;
            this.getBigImageWidth = getBigImageWidth;
            this.getBigImageHeight = getBigImageHeight;
            /* --- Получаем ID текущего обьекта  --- */
            this.id = srcSmallImg.id;
            /* --- Получаем SRC текущего обьекта  --- */
            this.src = srcSmallImg.src;
            /* --- Получаем Alt текущего обьекта  --- */
            this.alt = srcSmallImg.alt;
}
function getBigImageSrc()
{
            var arr = [];                  
            var src = this.src;
            var id = this.id;
            var index = src.lastIndexOf('\/');
            var before = src.substring(0, index + 1);
            var img = id.substring(1);
            var after = src.substring(index + 1);
            arr = after.split('.');
            var extension = arr[1];
            var result = before + img + '.' + extension;

            return result;
}
function getBigImageAlt()
{
            return this.alt;
}
function getBigImageWidth()

{
            var img = new Image();
            img.src = this.getBigImageSrc();
            return img.width;
}
function getBigImageHeight()
{
            var img = new Image();
            img.src = this.getBigImageSrc();
            return img.height;
}

/*еще одна вопен*/
function wopen(imgName, w , h, Title)
{
            var img = new Image(w, h);
            img.src = imgName;
            nWidth = img.width;
            nHeight = img.height;
            var wo = window.open("", "abc", "width = " + nWidth + " , height = " + nHeight + ", scrollbars=0, status=0");
            wo.document.open();
            var win = "";
            win = "<html><head><title>";
            win += Title;
            win += "</title></head>"
            win += "<body bgcolor='#F5F5F5' leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0' marginwidth='0' marginheight='0'>";
            win += "<table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center'>";
            win += "<a href='#' onClick='self.window.close();'><img src='" + imgName + "' width='" + nWidth + "' height='" + nHeight + "' border='0' alt='" + Title + "'></a>";
            win += "</td></tr></table>";
            win += "</body></html>";
            w += 48;
            h += 66;
            wo.window.resizeTo(w, h);
            wo.document.write(win);
            wo.window.focus();
            wo.document.close();
}

var id = 'superId';




function imgOver(src)
{
	var doc = document.getElementById(id);
	var img = '<img src="' + src + '" width="625" height="201">';
	doc.innerHTML = img;
} 

function imgOut()

{
	var doc = document.getElementById(id);
	var img = '<img src="' + defaultImg + '" width="625" height="201">';
	doc.innerHTML = img;
}

function FlashOver(src)
{
	var doc = document.getElementById(id);
	var flash = '<embed src="' + src + '" width="625" height="201" ';
    	flash += 'type="application/x-shockwave-flash" wmode="transparent" menu="false"></embed>';
	doc.innerHTML = flash;
}

function FlashOut()
{
	var doc = document.getElementById(id);
	var flash = '<embed src="' + defaultFlash + '" width="625" height="201" ';
    	flash += 'type="application/x-shockwave-flash" wmode="transparent" menu="false"></embed>';
	doc.innerHTML = flash;
}

function images()
{
var img;

for(var i=0; i<arr.lenght; i++)
	{
	img = new Image(625, 201);
	img.src = arr[i];
	}
	window.onload = images;
}

