// JavaScript Document

// rollover 

/*
	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 == 'over') {
			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);
			}
		}
	}
}

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


// JavaScript Document
// subwindow open

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function subwin1(){
	window.open('img/ebina-map.gif','','scrollbar=auto,menubar=yes,resizable=yes,width=640,height=440');
}
function subwin2(){
	window.open('img/sagamihara-map.gif','','scrollbar=auto,menubar=yes,resizable=yes,width=640,height=500');
}
function subwin3(){
	window.open('img/ys-map.gif','','scrollbar=auto,menubar=yes,resizable=yes,width=630,height=630');
}
function subwin4(){
	window.open('map.html','','scrollbar=auto,menubar=yes,resizable=yes,width=630,height=480');
}
// yamato
function subwin5(){
	window.open('location.html','','scrollbar=auto,menubar=yes,resizable=yes,width=680,height=650');
}
// inner.html 
//show hide layers

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


//著作権表記の「年」表示を自動更新

function ShowNowYear() {
   var now = new Date();
   var year = now.getFullYear();
   document.write(year);
}

//5日間　new表示

function newM(y,m,d)
{
newday=new Date(y+"/"+m+"/"+d);
oldday= new Date();
n=(oldday-newday)/(1000*60*60*24);
if (n <=41)document.write("<div class='newmark'><img src='../img2/newmark.gif' alt='NEW' /></div>");
}

//相模原　New
function newMarkS(y,m,d)
{
newday=new Date(y+"/"+m+"/"+d);
oldday= new Date();
n=(oldday-newday)/(1000*60*60*24);
if (n <=35)document.write("<div class='newmark'><img src='../img2/newmark.gif' alt='NEW' /></div>");
}

//海老名　New
function newMarkE(y,m,d)
{
newday=new Date(y+"/"+m+"/"+d);
oldday= new Date();
n=(oldday-newday)/(1000*60*60*24);
if (n <=47)document.write("<div class='newmark'><img src='../img2/newmark.gif' alt='NEW' /></div>");
}
