﻿
/*	画像ロールオーバー
------------------------------------------------------------------------
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
----------------------------------------------------------------------
function initRollovers() {
	if (!document.getElementsByTagName) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgNav') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}*/

/*	新規ウィンドウ	------------------------------------------------------
------------------------------------------------------------------------*/
function externalLinks() {
	if (!document.getElementsByTagName) return

	var anchors = document.getElementsByTagName("a");
	
	for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") &&
			anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";
	}
}


	
	
/*	フォントサイズ変更	------------------------------------------------------
---------------------------------------------------------------------------*/
function fontChange(str){
	var targetFile;
	switch(str){
	case "small":
		targetFile="../css/fontSmall.css";
	break;
	case "medium":
		targetFile="../css/fontMedium.css";
	break;
	case "large":
		targetFile="../css/fontLarge.css";
	break;
	default:
		alert("error");
	break;
	}
	//フォント用CSSのファイル名をクッキーの値として保存
	//フォント切り替え機能をサイト全体適用するためpathに/（ルート）を指定
	document.cookie="fontstyle="+targetFile+";path=/;";
	window.location.reload(); //ページをリロードして設定を反映。
}



//以下はページが読み込まれる際必ず実行される処理

var name="fontstyle";
var cookie=document.cookie; //クッキーを取得
if(-1==cookie.indexOf(name)){ //クッキーがなければsmallを指定（デフォルト）
	var file='../css/fontSmall.css';
}else{
	var pos_s=cookie.indexOf(name)+name.length+1; //クッキーの値の開始位置
	var pos_e=cookie.indexOf(";",pos_s); //クッキーの値の終了位置
	if(-1==pos_e){ //末尾にセミコロンがあるか？
		var file=cookie.slice(pos_s); //無い
	}else{
		var file=cookie.slice(pos_s,pos_e); //有る
	}
}
//クッキーの値に対応するCSSを読み込む。
document.write('<link rel="stylesheet" href="'+file+'" type="text/css" />');




/*	読み込み	----------------------------------------------------------
------------------------------------------------------------------------*/
onload = function(){
//	initRollovers();
	externalLinks();
}

/*	ブックマークに追加する	---------------------------------------------------
---------------------------------------------------------------------------*/
function addBookmark(title,url) {
	
    if( document.all ) {
       window.external.AddFavorite(url, title);
    } else if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( window.opera && window.print ) {
      return true;
    }
}

/*	プリントプレビュー	---------------------------------------------------
---------------------------------------------------------------------------
function PrintPreview()	{
	if(window.ActiveXObject == null || document.body.insertAdjacentHTML == null) return;
	var sWebBrowserCode = '<object width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>'; 
	document.body.insertAdjacentHTML('beforeEnd', sWebBrowserCode); 
	var objWebBrowser = document.body.lastChild;
	if(objWebBrowser == null) return;
	objWebBrowser.ExecWB(7, 1);
	document.body.removeChild(objWebBrowser);
}*/

/*	調査員応募に関する問合せ	---------------------------------------------------*/

function MaleToChosain()	{
		
	document.write("<a href=\"mailto:csc-sales@ajis-group.co.jp></a>");

	
}

/*	問合せ・応募フォームスクリプトチェック-----------------------------------------*/

function CheckJS()	{

	document.getElementById("JSNG").style.display = "none";

	document.getElementById("JSOK").style.display = "block";
}

/*	問合せ・応募フォームURLチェック-----------------------------------------*/

function CheckURL()	{

	if(window.location.href=="http://www.mystery-shopper.jp/Tyosa/user_register.html"){
		top.location = "https://www.mystery-shopper.jp/Tyosa/user_register.html"​ ;
	}
	if(window.location.href=="http://www2.mystery-shopper.jp/Tyosa/user_register.html"){
		top.location = "https://www2.mystery-shopper.jp/Tyosa/user_register.html"​ ;
	}

	if(window.location.href=="http://www.mystery-shopper.jp/Tyosa/contact.html"){
		top.location = "https://www.mystery-shopper.jp/Tyosa/contact.html"​ ;
	}
	if(window.location.href=="http://www2.mystery-shopper.jp/Tyosa/contact.html"){
		top.location = "https://www2.mystery-shopper.jp/Tyosa/contact.html"​ ;
	}

	if(window.location.href=="http://www.mystery-shopper.jp/contact.html"){
		top.location = "https://www.mystery-shopper.jp/contact.html"​ ;
	}
	if(window.location.href=="http://www2.mystery-shopper.jp/contact.html"){
		top.location = "https://www2.mystery-shopper.jp/contact.html"​ ;
	}


}
