// JavaScript Document
/*■■index.html用JavaScriptファイル■■*/

/*最初の処理*/
var menuImg=new Array;

/*▼画像ロールオーバー*/


function imgRoll(img) { ImgSW(img,'over' );}
function imgOut(img) { ImgSW(img,'');}

function ImgSW(img,code) {
	if( !menuImg[img.name] ) { menuImg[img.name]=img.src; }
	var re=/(.+)(\.\w+)$/;
	re.exec( menuImg[img.name] );
	var head=RegExp.$1;
	var tail=RegExp.$2;
	if( code ) { img.src = head + "-" + code + tail; }
	else { img.src = head + tail; }
}

var blogatc, blogmenu;

function resize(){
	blogatc = document.getElementById('blog-atc');
	blogmenu = document.getElementById('blog-menu');
	if(blogmenu.clientHeight > 400 && blogmenu.clientHeight > blogatc.clientHeight){
		blogatc.style.height = blogmenu.clientHeight + 30 + 'px';
	}
}

function newmark(Eyear,Emonth,Edate) {
	
	delay = 31; //NEWマークを付ける日数
	
	now = new Date();
	compNyear = (now.getYear() < 2000) ? now.getYear()+1900 : now.getYear() ;
	compN = compNyear*366 + now.getMonth()*31+31 + now.getDate();
	compE = Eyear*366 + Emonth*31 + Edate;
	if(compN - compE < delay){
		document.write( '<img src="/img/new.gif" alt="NEW" class="newmark" />' );
	}
}
