/*
 * common.js
 *
 */

	// 実行環境のパス （開発）
	//var SecureSite = 'https://others.apollon.tbn/metawater/html/';
	// 実行環境のパス （確認）
	//var SecureSite = 'https://10.190.3.8/';
	// 実行環境のパス （本番）
	var SecureSite = 'https://www.metawater.co.jp/';

	// 呼び出し元のaタグに記述されているドメイン
	var hrefURL = 'https://www.metawater.co.jp/';
	
	window.onload = function () { 
		swapImage.init();
	}
	
	
	// ウインドウ操作関数
	
	//親または子ウインドウの有無確認
	function fWinClosed(winVar) {
	var ua = navigator.userAgent
		if( !!winVar )
			if( ( ua.indexOf('Gecko')!=-1 || ua.indexOf('MSIE 4')!=-1 ) && ua.indexOf('Win')!=-1 ) 
					return winVar.closed
				else return typeof winVar.document  != 'object'
		else return true
	}
	
	function fOpenWin(theURL,targetName,theW,theH) {
		if(fWinClosed(tWin)){
			var tWin = window;
			tWin = open(theURL,targetName,'scrollbars=yes,resizable=yes,toolbar=no,location=yes,directories=no,status=yes,menubar=no,width='+theW+',height='+theH+'');
			tWin.focus();
		}
	}
	
	function fOpenInquiry(theURL,targetName,theW,theH) {
		var SecureURL = theURL.replace(hrefURL,SecureSite);
		fOpenWin(SecureURL,targetName,theW,theH);
	}
		