/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
	変数名など変更した箇所有り
	ロールオーバー画像のファイル名をfilename_over.[jpg,gif]拡張子とする
*/

//画像置き換え
function initRollovers() {
	if (!document.getElementById) return;
	var chimgLoad = new Array();
	var defSrc;
	var chImages = document.getElementsByTagName('img');

	for (var i = 0; i < chImages.length; i++) {
		if (chImages[i].className == 'imgover') {
			var src = chImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'),src.length);
			var hsrc = src.replace(ftype, '_over'+ftype);
			
			chImages[i].setAttribute('hsrc', hsrc);
			
			chimgLoad[i] = new Image();
			chimgLoad[i].src = hsrc;
			
			chImages[i].onmouseover = function() {
				defSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}
			
			chImages[i].onmouseout = function() {
				if (!defSrc) defSrc = this.getAttribute('src').replace('_over'+ftype,ftype);
				this.setAttribute('src',defSrc);
			}
		}
	}
}

/*window.onload = function () {
initRollovers();
}*/

//ポップアップウィンドウ
function opw(theURL,winName,winW,winH,topPos,leftPos) {
var ua = navigator.userAgent;
if(ua.indexOf('Safari') != -1) {
//winH = winH + 10;
topPos = topPos + 20;
}
features = "toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes,width="+winW+",height="+winH+",top="+topPos+",left="+leftPos;
Middle = window.open(theURL,winName,features);
Middle.focus();
}

//ポップアップウィンドウ 各種設定
function opwfea(theURL,winName,features) {
window.open(theURL,winName,features);
}

