// JavaScript Document
/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+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('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;



//ポップアップ
function openwin (url,name,w,h) {
w = window.open(url,name,"width="+w+",height="+h+",left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,favorites=no,resizable=no");
w.focus();
}



// ポップアップ access map
function winOpen(url,w,h) {
  var winFig;
  var width = parseInt(w);
  var height = parseInt(h);

  st = "toolbar=no,location=no,directories=no,status=no,menubar=yes,scrolbars=auto,resizable=yes,";
  winFig = window.open("", "OpenWin", st+"width="+width+",height="+height);

  winFig.document.open();
  winFig.document.writeln("<html>");
  winFig.document.writeln("<head><title>Access Map</title></head>");
  winFig.document.writeln('<body style="margin:3px auto 0px auto;text-align:center;">');
  winFig.document.writeln('<img src="'+url+'" align="center" />');
  winFig.document.writeln('<div style="margin-top:15px;" align="center">');
  winFig.document.writeln('<input type="button" onclick="javascript:print()" value=" print " style="padding:2px">');
  winFig.document.writeln('<input type="button" onclick="self.window.close()" value=" close window " style="padding:2px">');
  winFig.document.writeln('</div>');
  winFig.document.writeln("</body>");
  winFig.document.writeln("</html>");
  winFig.document.close();

  var Win   = navigator.userAgent.indexOf("Win") != -1   ? true : false;
  var Mac   = navigator.userAgent.indexOf("Mac") != -1   ? true : false;

  if(Win) {
    if(navigator.userAgent.indexOf("Gecko")!=-1){
      winFig.location.reload();
    }
  }
}

