//クリックされたら、画像のファイル名から「.thumbnail」をON/OFF
//WORDPRESSが出力するファイル名以外で「.」を含めてはいけない
//「ID」の「1」は状態判別のためだけ。ON/OFFで1/0となる

function change(Path, ClassN, IMGname){
if(ClassN == "g1") {
Path = Path.replace(".jpg",".thumbnail.jpg");
Path = Path.replace(".JPG",".thumbnail.JPG");
Path = Path.replace(".gif",".thumbnail.gif");
Path = Path.replace(".GIF",".thumbnail.GIF");
Path = Path.replace(".bmp",".thumbnail.bmp");
Path = Path.replace(".BMP",".thumbnail.BMP");
document.images[IMGname].src = Path;
ClassN = "g0";
document.images[IMGname].className = ClassN;
enlargerInitImage(IMGname);
}

else {
Path = Path.replace(".thumbnail.jpg",".jpg");
Path = Path.replace(".thumbnail.JPG",".JPG");
Path = Path.replace(".thumbnail.gif",".gif");
Path = Path.replace(".thumbnail.GIF",".GIF");
Path = Path.replace(".thumbnail.bmp",".bmp");
Path = Path.replace(".thumbnail.BMP",".BMP");
document.images[IMGname].src = Path;
ClassN = "g1";
document.images[IMGname].className = ClassN;
enlargerInitImage(IMGname);
}
}


//画像フェードインスクリプト
function enlargerInitImage(IMGname) 
{
	image = document.images[IMGname];
	setOpacity(image, 0);
	image.style.visibility = "visible";
	enlargerFadeIn(IMGname,0);
}
function enlargerFadeIn(IMGname,opacity) 
{
	if (document.images[IMGname])
	{
		obj = document.images[IMGname];
		if (opacity <= 100) 
		{
			setOpacity(obj, opacity);
			opacity += 4;
			window.setTimeout("enlargerFadeIn('"+IMGname+"',"+opacity+")", 20);
		}
	}
}
function setOpacity(obj, opacity) 
{
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}