﻿window.onload = function() {
	if(document.getElementById("currentYear")) {
		document.getElementById("currentYear").innerHTML = new Date().getFullYear();
	}
}

function newM(y,m,d) {
	newday=new Date(y+"/"+m+"/"+d);
	oldday= new Date();
	n=(oldday-newday)/(1000*60*60*24);
	if (n <=360) document.write("<img src='images/top/icon_news.gif' alt='NEWS' title='NEWS' />");
}

function newC(y,m,d) {
	newday=new Date(y+"/"+m+"/"+d);
	oldday= new Date();
	n=(oldday-newday)/(1000*60*60*24);
	if (n <=360) document.write("<img src='images/top/icon_case_company.gif' alt='導入事例' title='導入事例' />");
}

function newO(y,m,d) {
	newday=new Date(y+"/"+m+"/"+d);
	oldday= new Date();
	n=(oldday-newday)/(1000*60*60*24);
	if (n <=360) document.write("<img src='images/top/icon_case_owner.gif' alt='加盟店事例' title='加盟店事例' />");
}

function newMember(y,m,d) {
	newday=new Date(y+"/"+m+"/"+d);
	oldday= new Date();
	n=(oldday-newday)/(1000*60*60*24);
	if (n <=360) document.write("<img src='images/top/icon_member.gif' alt='加盟店情報' title='加盟店情報' />");
}

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}else {
	window.onload = smartRollover;
}
