// функция скрывающая / отображающая результаты голосования
function toggleVotingResult( votingForm )
{
	var results = document.getElementById( votingForm ).getElementsByTagName( "dd" );
	var link = document.getElementById( votingForm ).getElementsByTagName( "a" )[0];
	
	for( var i=0; i < results.length; i++ )
	{
		if ( results[i].style.display == 'block' )
		{
			results[i].style.display = 'none';
			link.innerHTML = 'Результаты'
		}
		else
		{
			results[i].style.display = 'block';
			link.innerHTML = 'Скрыть'
		}
	}
	
	return false;
}
// заменяет фоновый рисонок у указанного объекта
function replaceBg(sBackground,sWhere)
{			
	document.getElementById(sWhere).style.backgroundImage="url(" + sBackground + ")";
}

// показывает скрывает описание динамических свойств 
function SlideProperty(slidename)
{
	if (document.getElementById(slidename).style.display=='none') 
		{
			document.getElementById(slidename).style.display='block'; 
		} 
	else 
		{
			document.getElementById(slidename).style.display='none';
		}
}
var listItems = new Array();

// отображает рисунок, соответсвующий выбранному товару
function showProductThumb( thumbId ) {
	listItems[ thumbId ] = true;
	var thumb = document.getElementById( thumbId );
	var thumbMain = document.getElementById ( thumbId.replace(/\d*$/, 'main' ) );
	
	thumb.style.visibility = 'visible';
	thumbMain.style.visibility = 'hidden';
}
// отображает рисунок, соответсвующий выбранному товару
function hideProductThumb( thumbId ) {
	if ( !listItems[ thumbId ] )
	{
		var thumb = document.getElementById( thumbId );
		var thumbMain = document.getElementById ( thumbId.replace(/\d*$/, 'main' ) );
		
		thumb.style.visibility = 'hidden';
	}
}
function requestHideThumb( thumbId ) {
	listItems[ thumbId ] = false;
	setTimeout( "hideProductThumb( '" + thumbId + "' )", 10 );
	var thumbMain = document.getElementById ( thumbId.replace(/\d*$/, 'main' ) );
	thumbMain.style.visibility = 'visible';
}

menus = new Array();

function requestHide( menuId ) {
	menus[ menuId ] = false;
	setTimeout( "hideMenu( '" + menuId + "' )", 10 );
}

function hideMenu( menuId ) {
	if ( !menus[ menuId ] ) {
		document.getElementById( menuId ).style.display = 'none';
		document.getElementById( menuId ).parentNode.style.zIndex = '2';
	}
}

function showMenu( menuId ) {
	menus[ menuId ] = true;
	document.getElementById( menuId ).style.display = 'block';
	document.getElementById( menuId ).parentNode.style.zIndex = '3';
}