﻿/*	--------------------------------	Created: 2008.03.20	Last Modified: 2008.06.19	--------------------------------	- Table of Contents -	ガネーシャのお告げ	リニューアル	スプラッシュ	--------------------------------*//* --------------------------------	ガネーシャのお告げ-------------------------------- */function prophecy() {	var so = new SWFObject('default/flash/ganesa.swf', 'swf_ganesa', '350', '120', '9', '#ffffff');	so.addParam('allowScriptAccess', 'sameDomain');	so.addParam('allowFullScreen', 'false');	so.addParam('wmode', 'transparent');	so.write("ganesa");}/* --------------------------------	リニューアル-------------------------------- */var renewal = new Renewal();$_.addEvent(window, 'load', function() { renewal.init('renewal'); }, false);function Renewal() {	// クエリに [ renewal=1 ] が指定されている場合はクッキーの状態にかかわらずリニューアルを表示	this.skip = !location.search.match('(^[?]|&)renewal=1(&|$)') && $_.getCookie('webtaiRenewal');	// 初期化	this.init = function(id) {		if (this.skip) {			$_.setCookie('webtaiRenewal', 1, 1000 * 60 * 60 * 24 * 7, '/');			prophecy();		} else {			this.container = $_.element('div', { id: id });// コンテナ			var body = document.getElementsByTagName('body')[0];			body.appendChild(this.container);			var so = new SWFObject('default/flash/renewal.swf', 'renewal_swf', '100%', '400', '9', '#ffffff');			so.addParam('allowScriptAccess', 'always');			so.addParam('allowFullScreen', 'false');			so.addParam('wmode', 'transparent');			so.write(id);			this.show();		}	}	// リニューアルを表示	this.show = function() {		this.container.style.display = 'block';	}	// リニューアルを非表示	this.hide = function() {		$_.setCookie('webtaiRenewal', 1, 1000 * 60 * 60 * 24 * 7, '/');		this.container.style.display = 'none';		prophecy();	}}/* --------------------------------	スプラッシュ-------------------------------- *///var splash = new Splash();//$_.addEvent(window, 'load', function() { splash.init('splash', 'topbg'); }, false);function Splash() {	// 初期化	this.init = function(foreground, background) {		// クエリに [ splash=1 ] が指定されている場合はクッキーの状態にかかわらずスプラッシュを表示		if (!location.search.match('(^[?]|&)splash=1(&|$)') && $_.getCookie('webtaiSplash')) {			$_.setCookie('webtaiSplash', 1, 1000 * 60 * 60 * 24 * 7, '/');			document.getElementById(background).style.visibility = 'visible';		} else {			var self = this;			var availH = this.getWindowSize('h') - this.getSize($_('#head'), 'h') - this.getSize($_('#gnav'), 'h');			this.isIE5 = navigator.userAgent.match('MSIE 5');			this.isIE5 = navigator.userAgent.match('MSIE 5');			this.foreground = $_.element('div', { id: foreground });// 前景			$_('#body').appendChild(this.foreground);			this.background = $_('#' + background);// 背景			this.size = this.getSize(this.background);			this.foreground.style.height = this.size.height + 'px';			this.setForegroundPosition();			$_.addEvent(window, 'resize', function() { self.setForegroundPosition(); }, false);			var so = new SWFObject('default/flash/splash.swf', 'splash_swf', this.size.width - 2, this.size.height - 1, '9', '#FFFFFF');			so.addParam('allowScriptAccess', 'always');			so.addParam('allowFullScreen', 'false');			so.addParam('wmode', 'transparent');			so.addVariable('height', this.size.height);			so.addVariable('availHeight', availH);			so.write(this.foreground.id);			this.show();		}	}	// スプラッシュを表示	this.show = function() {		if (this.isIE5) $_('#bigad').style.visibility = 'hidden';		this.foreground.style.display = 'block';	}	// スプラッシュを非表示	this.hide = function() {		$_.setCookie('webtaiSplash', 1, 1000 * 60 * 60 * 24 * 7, '/');		if (this.isIE5) $_('#bigad').style.visibility = 'visible';		this.foreground.style.display = 'none';		renewal.show();	}	// スプラッシュのポジションをセット	this.setForegroundPosition = function() {		var position = this.getPosition(this.background);		this.foreground.style.left = (position.left + ((document.all) ? 2 : 1)) + 'px';		this.foreground.style.top = position.top + 'px';	}	// 背景（HTMLコンテンツ）を可視化	this.setBackground = function() {		this.background.style.visibility = 'visible';	}	// サイズの取得	this.getSize = function(elm, mode) {		var w = elm.offsetWidth || elm.clientWidth || 0;		var h = elm.offsetHeight || elm.clientHeight || 0;		return (mode == 'w') ? w : (mode == 'h') ? h : { width: w, height: h }	}	// オフセットポジションを取得	this.getPosition = function(elm, mode) {		var l = (!elm) ? null :  elm.offsetLeft;		var t = (!elm) ? null : elm.offsetTop;		if (elm) {			while (elm.offsetParent) {				elm = elm.offsetParent;				l += elm.offsetLeft;				t += elm.offsetTop;			}		}		return (mode == 'l') ? l : (mode == 't') ? t : { left: l, top: t }	}	// ウインドウサイズを取得	this.getWindowSize = function(mode) {		var w = document.documentElement.clientWidth || window.innerWidth || document.body.clientWidth || 0;		var h = document.documentElement.clientHeight || window.innerHeight || document.body.clientHeight || 0;		return (mode == 'w') ? w : (mode == 'h') ? h : { width: w, height: h }	}}