function change_span2() 

	{

	var stFlag = document.getElementById('mbprice').value;

	

	var span = document.getElementsByTagName('span');

		for (i = 0; i < span.length; i ++)

		if(span[i].className == 'RUB' || span[i].className== 'EUR') {

			

			span[i].style.display = 'none';}

			

			

		for (i = 0; i < span.length; i ++) {

		if(span[i].className == stFlag) 

			{

				

				//USD показать

				//RUB скрыть

				

				span[i].style.display = 'block';

			}		

		}

	}





function change_span() 

	{

	var stFlag = document.getElementById('price_state').value;

	

	var span = document.getElementsByTagName('span');

		for (i = 0; i < span.length; i ++)

		if(span[i].className == 'RUB' || span[i].className== 'USD') {

			

			span[i].style.display = 'none';}

			

			

		for (i = 0; i < span.length; i ++) {

		if(span[i].className == stFlag) 

			{

				

				//USD показать

				//RUB скрыть

				

				span[i].style.display = 'block';

			}		

		}

	}





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='#FFFFFF' 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 += 8;

	h += 26;

	wo.window.resizeTo(w, h);

	wo.document.write(win);

	wo.window.focus();

	wo.document.close();	

}







function WKWinOpen(imgPath)

	{	

		var w = 500;

		var h = 335;

		var Title = "Распродажа (неликвиды)";

		

		var wo = window.open("", "abc", "width = " + (w+8) + " , height = " + (h+26) + ", scrollbars=0, status=0");

		wo.document.open();

		

		var win = "";

		win = "<html><head><title>";

		win += Title;

		win += "</title></head>"

		win += "<body bgcolor='#FFFFFF' 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='" + imgPath + "' width='" + w + "' height='" + h + "' border='0' alt='" + Title + "'></a>";

		win += "</td></tr></table>";

		win += "</body></html>";

		

		

		wo.document.write(win);

		wo.window.focus();

		wo.document.close();

	}





/*Дичь для меню*/

function leftMenuOver(obj)

{

	obj.style.background = 'url(\'/img/OrangeArrow.gif\') no-repeat 10px 7px #F0F0F0';

	obj.childNodes[0].style.color = '#00ADEF;';

}

function leftMenuOut(obj)

{

	obj.style.background = 'url(\'/img/GreyArrow.gif\') no-repeat 10px 7px';

	obj.childNodes[0].style.color = '';

}



function leftMenuOverA(obj)

{

	obj.style.background = 'url(\'/img/OrangeArrow.gif\') no-repeat 10px 7px #F0F0F0';

	obj.childNodes[0].style.color = '#00ADEF;';

}

function leftMenuOutA(obj)

{

	obj.style.background = 'url(\'/img/GreyArrowA.gif\') no-repeat 10px 7px';

	obj.childNodes[0].style.color = '';

}



function leftMenuOver2(obj)

{

	obj.style.background = 'url(\'/img/OrangeArrow.gif\') no-repeat 20px 7px #F0F0F0';

	obj.childNodes[0].style.color = '#00ADEF';

}

function leftMenuOut2(obj)

{

	obj.style.background = 'url(\'/img/GreyArrow.gif\') no-repeat 20px 7px';

	obj.childNodes[0].style.color = '';

}



function leftMenuOver2A(obj)

{

	obj.style.background = 'url(\'/img/OrangeArrow.gif\') no-repeat 20px 7px #F0F0F0';

	obj.childNodes[0].style.color = '#00ADEF';

}

function leftMenuOut2A(obj)

{

	obj.style.background = 'url(\'/img/GreyArrowA.gif\') no-repeat 20px 7px';

	obj.childNodes[0].style.color = '';

}



function leftMenuOver3(obj)

{

	obj.style.background = 'url(\'/img/OrangeArrow.gif\') no-repeat 30px 7px #ECECEC';

	obj.childNodes[0].style.color = '#00ADEF';

}

function leftMenuOut3(obj)

{

	obj.style.background = 'url(\'/img/GreyArrow.gif\') no-repeat 30px 7px';

	obj.childNodes[0].style.color = '';

}
function topMenuOver(obj)
{
	obj.style.background = 'url(\'/img/ArrowBigh.gif\') #FFFFFF no-repeat 6px 3px';
	//obj.childNodes[0].style.color = '';
}
function topMenuOut(obj)
{
	obj.style.background = 'url(\'/img/ArrowBig.gif\') no-repeat 6px 3px #F8F8F8';
	//obj.childNodes[0].style.color = '';
}
/*конец дичи*/





function anonsOver(obj)

{

	obj.style.background = 'url(\'img/OrangeArrow.gif\') no-repeat 0 5px';

	obj.childNodes[0].style.color = '#00ADEF;';

}



function anonsOut(obj)

{

	obj.style.background = 'url(\'img/BlueArrow.gif\') no-repeat 0 5px';

	obj.childNodes[0].style.color = '';

}



// фотогалерея

var arr = new Array("id0", "id1", "id2", "id3", "id4", "id5", "id6", "id7", "id8", "id9", "id10", "id11", "id12", "id13", "id14", "id15", "id16", "id17", "id18", "id19", "id20");

function ChangeFoto(sImg, imgSrc)

{

	 

	var img = document.getElementById('CarIDF');

	img.src = sImg;

	

	for(var i=0; i<arr.length; i++)

	{

		var julia = document.getElementById('id' + i);

		

		if(julia != null)

		{

			julia.style.background = 'url(\'img/galBgrNo.gif\')';

		}

	}

	

	imgSrc.style.background = 'url(\'img/galBgr.gif\')';

	//imgSrc.style.borderStyle = "solid";

	//imgSrc.style.borderColor = "#EE7815";

}



function ChangeColor(sImg, imgSrc)

{

	 

	var img = document.getElementById('CarIDF');

	img.src = sImg;

	

	for(var i=0; i<arr.length; i++)

	{

		var julia = document.getElementById('id' + i);

		

		if(julia != null)

		{

			julia.style.background = 'url(\'img/galBgrNo.gif\')';

		}

	}

	

	imgSrc.style.background = 'url(\'img/galBgr.gif\')';

}



function ChangeName( imgSrc)

{

	document.getElementById('nID').innerHTML = imgSrc.alt;	

}





function ChangeFoto2(sImg)

	{

		var img = document.getElementById('CarIDF');

		img.src = sImg;

	}



function wopen3 (obj){

 var wo = window.open("", "abc", "width=10, height=10, scrollbars=0, status=0");

 wo.document.open();

 var win = "";

 win = "<html><head>";

 win += "<title>Image</title>";

 win += "<script>function resizes (obj){";

 win += "var w=obj.width, h=obj.height;";

 win += "window.resizeTo (w+10, h+46);";

 win += "}</"+"script"+">";

 win += "<style type='text/css'> * {margin:0; padding:0; border:0; } </style> </head>"

 win += "<body>";

 win += "<table cellpadding='0' cellspacing='0' width='100%' height='100%'><tr><td align='center'>";

 win += "<img src='" + obj + "' alt='' onload='resizes(this)' />";

 win += "</td></tr></table>";

 win += "</body></html>";

 wo.document.write(win);

 wo.window.focus();

 wo.document.close();

}
function mainMenuOver(obj)
{
	obj.style.background = 'url(\'/img/menuSep.gif\') #FFFFFF no-repeat 0px 3px';
    //obj.childNodes[0].style.color = '';
    }

function mainMenuOut(obj)
{
	obj.style.background = 'url(\'/img/menuSep.gif\') no-repeat 0px 3px ';
	//obj.childNodes[0].style.color = '';
}
function changeState(layerRef, state)

{ 

	var blockElement = document.getElementById(layerRef).style;

	blockElement.display = state;

}

