//サイト上の画像ディレクトリ(サイトルートで記述)
//記述例：siteDirCat = '/works/img/';
siteDirCat = '/business/img/';

//////////////////////////////////////
/*
ロールオーバー
rolloverCat('id名またはclass名','画像ファイル名');

画像置換のみ
repImgCat('id名またはclass名','画像ファイル名');

altなし
repImgCat('id名またはclass名','画像ファイル名','false');
*/

	repImgCat('#movie #title','movie_title.gif');
	repImgCat('#movie #catchcopy','movie_catchcopy.gif');
	repImgCat('#h2-1','h2_1.gif');
	repImgCat('#h2-2','h2_2.gif');
	repImgCat('#title-works','slide_title_works.gif');
	repImgCat('#title-case','slide_title_case.gif');

	repImgCat('#zukan-pic a','zukan.jpg');

	repImgCat('#design #title','design_title.gif');
	repImgCat('#design #catchcopy','design_catchcopy.gif');

	repImgCat('#machines #title','machines_title.gif');
	repImgCat('#machines #catchcopy','machines_catchcopy.gif');

	repImgCat('#tour #title','tour_title.gif');
	repImgCat('#tour #catchcopy','tour_catchcopy.gif');
	repImgCat('#tour #site-pic a','tour_site.jpg');
	repImgCat('#tour #site-pic2 a','runding.jpg');
	
	repImgCat('#import #title','import_title.gif');
	repImgCat('#import #catchcopy','import_catchcopy.gif');
	repImgCat('#import #site-pic','import_site.jpg');


document.write('<style type="text/css" media="screen,tty,tv,projection,handheld,print,braille,embossed,speech">');
document.write('#movie #title,#movie #catchcopy,#h2-1,#h2-2,#zukan-pic,#design #title,#design #catchcopy,#machines #title,#machines #catchcopy,#tour #title,#tour #catchcopy,#tour #site-pic a,#import #title,#import #catchcopy,#import #site-pic a');
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();
	});
}












