/******************************************************************************
 * アプリケーション
 */
var _bannerPath = 'images/banners/';

function pull(elm)
{
	for(i = 0; i < elm.childNodes.length; i++)
	{
		if(elm.childNodes[i].nodeName.toUpperCase() == 'DD')
		{
			if(elm.childNodes[i].style.display == 'block')
			{
				elm.childNodes[i].style.display = 'none';
			}
			else
			{
				elm.childNodes[i].style.display = 'block';
			}
		}
	}
}

function random_banner(count, id)
{
	index = Math.floor(Math.random() * count + 1)
	elm = document.getElementById(id);
	url = 'url(' + _bannerPath + 'banner' + index + '.jpg' + ')';
	if(elm != undefined)
	{
		elm.style.backgroundImage = url;
	}
}

function rollover(elm, path) {
	if(elm.tagName.toUpperCase() == 'IMG')
	{
		elm.src = path;
	}
	else if(elm.childNodes && elm.childNodes[0].tagName.toUpperCase() == 'IMG')
	{
		elm.childNodes[0].src = path;
	}
}