document.write('\
<script type="text/javascript" src="/common/js/scrollsmoothly.js"></script>\
');
//FlashPlayerバージョン
var majorFlashVersion = '9';
// mouseover script
// @param なし
// @return なし
$(function imgOver() {
	$('img').each(function() {
		var node = this;
		if(node.src.match("_off.")) {
			node.originalSrc = node.src;
			node.temporarySrc = node.originalSrc.replace(/_off\./,'\.');
			node.rolloverSrc = node.temporarySrc.replace(/(\.gif|\.jpg|\.png)/,'_on'+"$1");
			node.activeSrc = node.temporarySrc.replace(/(\.gif|\.jpg|\.png)/,'_active'+"$1");
			//画像のプリロード処理開始
			preloadImage(node.rolloverSrc);
			//Mouseover
			node.onmouseover = function() {
				this.src = this.rolloverSrc;
			}
			//Mouseout
			node.onmouseout = function() {
				if(this.className!='active') {
					this.src = this.originalSrc;
				}
			}
		}
	});
});

// 画像のプリロードを行う関数
// @param string 画像のパス
// @return なし
preloadImages = [];
preloadImage = function(path) {
	var pre = preloadImages;
	var len = pre.length;
	pre[len] = new Image();
	pre[len].src = path;
}

// トップページ ニュースの一番古いトピックにクラスを付与
$(function addOldestTopics() {
	$('#index #news-area dd:last').addClass('last');
});

// global nav active
$(function setGlobalActive() {
	var urlList = [
		'/vision/',
		'/intro/',
		'/service/',
		'/subdivision/',
		'/lease/'
	];
	
	var url = document.URL;
	
	//画像のアクティブ・非アクティブ
	for(var i=0,len=urlList.length; i<len; i++) {
		if(url.indexOf(urlList[i])>-1) {
			var activeNode = $('#global-nav li img')[i];
			activeNode.src = activeNode.activeSrc;
			activeNode.onmouseover = function() {
			
			}
			activeNode.onmouseout = function() {
			
			}
		}
	}
});

//local nav active
$(function setLocalActive() {
	$('#local-nav li img').each(function(index) {
		if(index==activeLocalNav) {
			this.src = this.activeSrc;
			this.onmouseout = function() {
			
			}
			this.onmouseover = function() {
			
			}
		}
	});
});

// local nav active
// @param なし
// @return なし

//外部リンクにクラス名「external」、target="_blank"を追加
$(function addExtLink() {
	$('#main-area a').each(function() {
		var selfDomain = document.domain;
		if((this.href.indexOf(selfDomain)==-1) && (this.href.indexOf('mailto')==-1) && (this.href.indexOf('http://www.adobe.com/')==-1)) {
			$(this).addClass('external');
			$(this).attr('target','_blank');
		}
	});
});

//過去のJS
//====================================================================
$(function viewWin() {
	$('.popup').each(function() {
		this.onclick = function() {
			var href = this.href;
			var width = 740;
			var height = 530;
			var classArray = this.className.split(' ');
			for(var i=0,len=classArray.length; i<len; i++) {
				if(classArray[i].indexOf('width')>-1) {
					var width = classArray[i].split('width')[1];
				}
				if(classArray[i].indexOf('height')>-1) {
					var height = classArray[i].split('height')[1];
				}
			}
			newwin = window.open(href,"newWindow","width="+width+",height="+height+",toolbar=yes,location=yes,directories=yes,status=yes,menuebar=yes,scrollbars=yes,resizable=yes,left=20");
			if(newwin) {
				newwin.focus();
			}
			return false;
		}
	});
});

