//サイト上の画像ディレクトリ(サイトルートで記述)
//記述例：siteDirPage = '/works/img/';
siteDirPage = '/img_exam/';

//////////////////////////////////////
/*
ロールオーバー
rolloverPage('id名またはclass名','画像ファイル名');

画像置換のみ
repImgPage('id名またはclass名','画像ファイル名');

altなし
repImgPage('id名またはclass名','画像ファイル名','false');
*/
	repImgPage('#side dt','side_tit.jpg');
	repImgPage('#flow','home_image_02.jpg','false');

/////////////////////////////////////

urlCom = document.URL;//urlを取得

if(urlCom.indexOf('http://') != -1 && urlCom.indexOf('wadax.ne.jp') != -1){
	imgDirPage = WADAXDirCom+siteDirPage;
}
else if(urlCom.indexOf('http://') != -1){
	imgDirPage = "http://"+location.hostname+siteDirPage;
}
else if(urlCom.indexOf('https://') != -1 && urlCom.indexOf('wadax.ne.jp') != -1){
	imgDirPage = WADAXsslDirCom+siteDirPage;
}
else if(urlCom.indexOf('https://') != -1){
	imgDirPage = "https://"+location.hostname+siteDirPage;
}
else{
	imgDirPage = localDirCom+siteDirPage;
}





/////////////////////////////////////

function rolloverPage(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(imgDirPage + 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 repImgPage(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(imgDirPage + idImg,{
				imgTitle:false
			});
		}else{
			$(idx).replaceImg(imgDirPage + idImg);
		}
		$("style[media='screen,tty,tv,projection,handheld,print,braille,embossed,speech']").remove();
	});
}
