var newWND;

//------------------------------------
// функция открытия нового окна
//------------------------------------
function newWindow(url, height, width)
{
	values = "width=" + width + ", height=" + height + ", scrollbars=yes";

	newWND = window.open(url, "newWND", values); 
	newWND.focus();
}

var htmlWnd;
function popupHtml(url, width, height, title)
{
	htmlWnd = window.open('', '', 'width='+width+', height='+height+', status=no, menubar=no, resizable=no, scrollbars=no, left='+String((screen.width-width)/2)+', top='+String((screen.height-height)/2));

	htmlWnd.document.writeln("<html>");
	htmlWnd.document.writeln("<title>" + title + "</title>");
	htmlWnd.document.writeln('<body topmargin="0" leftmargin="0">');
	htmlWnd.document.writeln('<a href="#" onclick="window.close();"><img src="' + url + '" width="'+width+'" height="'+height+'" border="0"></a>');
	htmlWnd.document.writeln("</body>");
	htmlWnd.document.writeln("</html>");

}
//---------------------------
// загрузка картинок в память
//---------------------------
function loadIMG(imgName)
{
	this.img = new Image();
	this.img.src = imgName;
	return this;
}


backImgPassive = ROOT + "/graph/reviews_right.gif";
backImgActive = ROOT + "/graph/reviews_right_active.gif";

imgPassive = new Array();
imgPassive[1] = new loadIMG(ROOT + '/graph/reviews_text_01.gif');
imgPassive[2] = new loadIMG(ROOT + '/graph/reviews_text_02.gif');
imgPassive[3] = new loadIMG(ROOT + '/graph/reviews_text_03.gif');
imgPassive[4] = new loadIMG(ROOT + '/graph/reviews_text_04.gif');
imgPassive[5] = new loadIMG(ROOT + '/graph/reviews_text_05.gif');
imgPassive[6] = new loadIMG(ROOT + '/graph/reviews_text_06.gif');
imgPassive[7] = new loadIMG(ROOT + '/graph/reviews_text_07.gif');


imgActive = new Array();
imgActive[1] = new loadIMG(ROOT + '/graph/reviews_01.gif');
imgActive[2] = new loadIMG(ROOT + '/graph/reviews_02.gif');
imgActive[3] = new loadIMG(ROOT + '/graph/reviews_03.gif');
imgActive[4] = new loadIMG(ROOT + '/graph/reviews_04.gif');
imgActive[5] = new loadIMG(ROOT + '/graph/reviews_05.gif');
imgActive[6] = new loadIMG(ROOT + '/graph/reviews_06.gif');
imgActive[7] = new loadIMG(ROOT + '/graph/reviews_07.gif');


//--------------------
// смена картинок
//--------------------
function changeImg(id)
{	
	// делаем пассивными все пункты меню
	for (i = 1; i<imgActive.length; i++)
	{
		if (document.images["mimg_" + i])
		{
			backObject = eval("back_" + i);
			backObject.background = backImgPassive;		
			document.images["mimg_" + i].src = imgPassive[i].img.src;
		}
	}

	// делаем активным один пункт меню
	if (id)
	{
		backObject = eval("back_" + id);
		backObject.background = backImgActive;		
		
		document.images["mimg_" + id].src = imgActive[id].img.src;
	}
}
