// JavaScript Document


// Image Roll Over

SITE = {
	basepath : '/',
	preloader : {
		loadedImages: [],
		load: function (url){
			var img = this.loadedImages;
			var l = img.length;
			img[l] = new Image();
			img[l].src = url;
		}
	}
};



$(function(){
	//class="roll"はロールオーバーを設定 (src属性を_on付きのものに差し替える) 
	$('.roll').each(function(){
		this.originalSrc = $(this).attr('src');
		this.rolloverSrc = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, "_on$1" );
		SITE.preloader.load(this.rolloverSrc);
	});
	
	//通常ロールオーバー
	$('.roll').not($('.rollgroup .roll, .current .roll')).hover(function(){
		$(this).attr('src',this.rolloverSrc);
	},function(){
		$(this).attr('src',this.originalSrc);
	});

	
});

//COLOR BOX CUSTOMIZATION 
$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='cview']").colorbox({transition:"elastic", rel:"nofollow", speed:300});
				$("a[rel='cviewfull']").colorbox({transition:"elastic", rel:"nofollow", speed:300, width:"100%", height:"100%"});
				
			});



//特定の日数だけNewをつける
function NewMark(y,m,d){
	oldDay = new Date(y+"/"+m+"/"+d);
	newDay = new Date();
	n = (newDay - oldDay)/(1000*60*60*24);
	if (n <=30)document.write('<span class="iconNew">NEW!</span>');
} 

