<!--

$(document).ready(function() {
	if ($("body").is(":has(#wp-admin-bar-stats)")) {
		$("#wp-admin-bar-stats a img").addClass("no-over");
	}
	initRollOverImages();
	smoothS();
	//blank
    $('.blank').click(function(){
        window.open(this.href, '_blank');
        return false;
    });

	if ($("body").is(":has(#time-box)")) {
		$('#time-box').countdown({
			until: new Date(2011,09,15,00,00,00),
			//layout: 'あと <span class="num">{dn}</span>{dl}<span class="num">{hn}</span>{hl}<span class="num">{mn}</span>{ml}<span class="num">{sn}</span>{sl}'
			//layout: 'あと <strong>{dn}</strong>{dl}<strong>{hn}</strong>{hl}<strong>{mn}</strong>{ml}<strong>{sn}</strong>{sl}'
			layout: ' <strong>本日11時より開催！</strong>'
		});
	}

});

function initRollOverImages() {
	var image_cache = new Object();
	var postfix = '_o';
	$("a img").not('[src*="'+ postfix +'."], .no-over, .size-thumbnail, .alignnone, .attachment-900x9999, .size-medium, .size-full, .attachment-medium, .wp-post-image').each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + postfix + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; }
		);
	});
}

function smoothS() {
	$("a[href^=#]").click(function() {
		var hash = this.hash;
		if(!hash || hash == "#")
			return false;
		$($.browser.safari ? 'body' : 'html')
			.animate(
				{scrollTop: $(hash).offset().top},
				600,
				'swing'
			);
		return false;
	});
}

-->
