/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/
/*
	Modified by Kohashi Junji 2008.
	http://elbro.net
*/


function initRollovers()	{

	if(navigator.userAgent.indexOf("MSIE")	!=	-1	&&	navigator.userAgent.indexOf("6.0")	!=	-1)	{
		var	ie6	=	true;
	}
	if	(!document.getElementById)	return
	
	var	aPreLoad	=	new	Array();
	var	sTempSrc;
	var	aImages		=	document.getElementsByTagName('img');

	for	(var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
		
			var	src					=	aImages[i].getAttribute('src');
			var	ftype				=	src.substring(src.lastIndexOf('.'),	src.length);
			var	hsrc				=	src.replace(ftype,	'_over'+ftype);

			aImages[i].setAttribute('hsrc',	hsrc);
			
			aPreLoad[i]				=	new	Image();
			aPreLoad[i].src			=	hsrc;
			
			if(ie6  && ftype=='.png') {
				aImages[i].type			=	ftype;
				aImages[i].style.filter	=	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aImages[i].src+"')";
				aImages[i].src			=	aImages[i].src.slice(0, aImages[i].src.lastIndexOf("/")+1) + "spacer.gif";
				aImages[i].behavior		=	"none";
			}
			
			aImages[i].onmouseover	=	function()	{
				if(ie6	&&	this.type=='.png') {
					this.style.filter		=	this.style.filter.replace(this.type, '_over'+this.type);
					this.style.behavior		=	"none";
				}	else	{
					sTempSrc	=	this.getAttribute('src');
					this.setAttribute('src', this.getAttribute('hsrc'));
				}
			}	
			
			aImages[i].onmouseout	=	function()	{
				if(ie6	&&	this.type=='.png') {
					this.style.filter		=	this.style.filter.replace('_over'+this.type, this.type);
					this.style.behavior		=	"none";
				}	else	{
					if (!sTempSrc)	sTempSrc	=	this.getAttribute('src').replace('_over'+ftype, ftype);
					this.setAttribute('src', sTempSrc);
				}
			}
		}
	}
}

window.onload	=	initRollovers;