////////////////////////////////////////////////////////////////////////////////
/// Rollover image　--  V4 r1 --
////////////////////////////////////////////////////////////////////////////////

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	var imputBtn = document.getElementsByTagName('input');

	for (var i = 0; i < aImages.length; i++) {
		var imgclassName = aImages[i].className;
		if (imgclassName.indexOf("rollover") >= 0) {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_ov'+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('_ov'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}

	for (var i = 0; i < imputBtn.length; i++) {		
		var inpclassName = imputBtn[i].className;
		if (inpclassName.indexOf("rollover") >= 0) {
			var src = imputBtn[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_ov'+ftype);

			imputBtn[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			imputBtn[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			imputBtn[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_ov'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

// add onload
	try {
		window.addEventListener('load', initRollovers, false);
	} catch (e) {
		window.attachEvent('onload', initRollovers);
	}



////////////////////////////////////////////////////////////////////////////////
/// make Print page
////////////////////////////////////////////////////////////////////////////////

function pagePrint() {
	printwin = window.open('/print.html','printwindow','');
}
function printCheck() {
	if(document.getElementById("printFunction")) {
		document.getElementById("printFunction").innerHTML = '<a href="javascript:void(0);" onclick="pagePrint();">印刷用ページ</a>'
	}
}

// add onload
	try {
		window.addEventListener('load', printCheck, false);
	} catch (e) {
		window.attachEvent('onload', printCheck);
	}

