//ローカル上の確認用画像フォルダ（絶対パスで気記述）(末尾スラッシュなし)
//記述例：localDirCom = 'file:///C:/Documents and Settings/af/デスクトップ/mywork';
localDirCom = '';

//ワダックス用仮ドメイン(絶対パスで記述)(末尾スラッシュなし)
//記述例：WADAXDirCom = '/http://sv**.wadax.ne.jp/~*****************';
//WADAXDirCom = '';
WADAXDirCom = '';

//ワダックス用SSLサイト(絶対パスで記述)(末尾スラッシュなし)
//記述例：WADAXsslDirCom = '';
WADAXsslDirCom = '';


//サイト上の画像ディレクトリ(サイトルートで記述)
//記述例：siteDirCom = '/works/img/';
siteDirCom = '/img_common/';

//確認サイト用ディレクトリ
//記述例：siteDirCom = '/works/img/';
siteDirComG = '';


//////////////////////////////////////
/*
ロールオーバー
rolloverCom('id名またはclass名','画像ファイル名');

画像置換のみ
repImgCom('id名またはclass名','画像ファイル名');

altなし
repImgCom('id名またはclass名','画像ファイル名','false');
*/

/*
	rolloverCom('#nav-sitemap a','header_sitemap.gif');
	rolloverCom('#nav-contact a','header_contact.gif');
	rolloverCom('#nav-home a','nav_home.jpg');
	rolloverCom('#nav-business a','nav_business.jpg');
	rolloverCom('#nav-profile a','nav_profile.jpg');
	rolloverCom('#nav-recruit a','nav_recruit.jpg');
	repImgCom('#logo','logo.gif');

	rolloverCom('#foot-home a','footer_home.gif');
	rolloverCom('#foot-recruit a','footer_recruit.gif');
	rolloverCom('#foot-contact a','footer_contact.gif');
	rolloverCom('#foot-privacy a','footer_privacy.gif');
	repImgCom('#copyright','copyright.gif');

document.write('<style type="text/css" media="screen,tty,tv,projection,handheld,print,braille,embossed,speech">');
document.write('#nav-sitemap a,#nav-contact a,#nav-home a,#nav-business a,#nav-profile a,#nav-recruit a,#logo,#foot-home a,#foot-recruit a,#foot-contact a,#foot-privacy a');
document.write('{display:block;text-indent: -9999px;}');
document.write('</style>');
*/


//////////////////////////////////////

urlCom = document.URL;//urlを取得

if(siteDirComG != ""){
	imgDirCom = "http://"+location.hostname+siteDirComG+siteDirCom;
}
else if(urlCom.indexOf('http://') != -1 && urlCom.indexOf('wadax.ne.jp') != -1){
	imgDirCom = WADAXDirCom+siteDirCom;
}
else if(urlCom.indexOf('http://') != -1){
	imgDirCom = "http://"+location.hostname+siteDirCom;
}
else if(urlCom.indexOf('https://') != -1 && urlCom.indexOf('wadax.ne.jp') != -1){
	imgDirCom = WADAXsslDirCom+siteDirCom;
}
else if(urlCom.indexOf('https://') != -1){
	imgDirCom = "https://"+location.hostname+siteDirCom;
}
else{
	imgDirCom = localDirCom+siteDirCom;
}


/////////////////////////////////////

function rolloverCom(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(imgDirCom + 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 repImgCom(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(imgDirCom + idImg,{
				imgTitle:false
			});
		}else{
			$(idx).replaceImg(imgDirCom + idImg);
		}
		$("style[media='screen,tty,tv,projection,handheld,print,braille,embossed,speech']").remove();
	});
}

