//サイト上の画像ディレクトリ(サイトルートで記述)
//記述例：siteDirCat = '/works/img/';
siteDirCat = '/privacy/img/';

//////////////////////////////////////
/*
ロールオーバー
rolloverCat('id名またはclass名','画像ファイル名');

画像置換のみ
repImgCat('id名またはclass名','画像ファイル名');

altなし
repImgCat('id名またはclass名','画像ファイル名','false');
*/

	repImgCat('#title','title.gif');
	repImgCat('#h2_1','h2_1.gif');
	repImgCat('#h2_2','h2_2.gif');
	repImgCat('#h2_3','h2_3.gif');
	repImgCat('#h2_4','h2_4.gif');
	repImgCat('#h2_5','h2_5.gif');
	repImgCat('#h2_6','h2_6.gif');
	repImgCat('#h2_7','h2_7.gif');
	repImgCat('#h2_8','h2_8.gif');


document.write('<style type="text/css" media="screen,tty,tv,projection,handheld,print,braille,embossed,speech">');
document.write('');
document.write('{display:block;text-indent: -9999px;}');
document.write('</style>');

/////////////////////////////////////

urlCom = document.URL;//urlを取得

if(siteDirComG != ""){
	imgDirCat = "http://"+location.hostname+siteDirComG+siteDirCat;
}
else if(urlCom.indexOf('http://') != -1 && urlCom.indexOf('wadax.ne.jp') != -1){
	imgDirCat = WADAXDirCom+siteDirCat;
}
else if(urlCom.indexOf('http://') != -1){
	imgDirCat = "http://"+location.hostname+siteDirCat;
}
else if(urlCom.indexOf('https://') != -1 && urlCom.indexOf('wadax.ne.jp') != -1){
	imgDirCat = WADAXsslDirCom+siteDirCat;
}
else if(urlCom.indexOf('https://') != -1){
	imgDirCat = "https://"+location.hostname+siteDirCat;
}
else{
	imgDirCat = localDirCom+siteDirCat;
}

/////////////////////////////////////

function rolloverCat(idx,idImg){
/*
document.write('<style type="text/css" media="screen,tty,tv,projection,handheld,print,braille,embossed,speech">');
document.write(idx);
document.write('{display:block;text-indent: -9999px;}');
document.write('</style>');
*/

	$(function(){
		$(idx).replaceImg(imgDirCat + idImg);
			$(idx+' img').each(function(){
				
		
				rolloverSrc = $(this).attr('src').replace(/(\.gif|\.jpg|\.png)$/, c.postfix+"$1");

				//イメージセット
				$(this).clone().insertAfter(this)
				.attr('src',rolloverSrc)
				.css('display','none');

				//ロールオーバー(マウスオン時)
				$(this).mouseover(function(){
				$(this).hide();
				$(this).next().show();
				});

				//ロールオーバー(マウスアウト時)
				$(this).next().mouseout(function(){
				$(this).hide();
				$(this).prev().show();
			});
		});
		$("style[media='screen,tty,tv,projection,handheld,print,braille,embossed,speech']").remove();
	});

}

/////////////////////////////////////

function repImgCat(idx,idImg,idFalse){
/*
document.write('<style type="text/css" media="screen,tty,tv,projection,handheld,print,braille,embossed,speech">');
document.write(idx);
document.write('{display:block;text-indent: -9999px;}');
document.write('</style>');
*/

	$(function(){
		if(idFalse == false){
			$(idx).replaceImg(imgDirCat + idImg,{
				imgTitle:false
			});
		}else{
			$(idx).replaceImg(imgDirCat + idImg);
		}
		$("style[media='screen,tty,tv,projection,handheld,print,braille,embossed,speech']").remove();
	});
}












