jQuery(function(jQuery){
	jQuery('#pnavi').ptop();
	jQuery(window).resize(function() {
		jQuery('#pnavi').ptop();
	});
	jQuery('#pnavi a').click(function() {
		jQuery().scrollTo(0, 500, {easing:'easeOutExpo'});
		return false;
	});
	if (jQuery('pre').length) {
		jQuery('pre').lightSyntax();
	}
	if (jQuery('a.thickbox').length) {
		jQuery('a.thickbox').fancybox({
		'overlayShow'		: true,
		'imageScale'		: true,
		'zoomOpacity'		: true,
		'zoomSpeedIn'		: 600,
		'zoomSpeedOut'	: 500,
		'frameWidth'		: 640,
		'frameHeight'		: 400,
		//'easingIn'		: 'easeOutBack',
		//'easingOut'		: 'easeInBack',
		'hideOnContentClick': false
		});
	}
	if (jQuery('a.fancy').length) {
		jQuery('a.fancy').fancybox({
		'overlayShow'			: true,
		'imageScale': true,
		'zoomOpacity'			: true,
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'			: 500,
		'frameWidth'			: 800,
		'frameHeight'			: 400,
		//'easingIn'				: 'easeOutBack',
		//'easingOut'				: 'easeInBack',
		'hideOnContentClick': false
		});
	}
	if (analog) {
		jQuery('<div class="analog" title="ブラウザのアップグレードをおすすめします"></div>').appendTo(jQuery('body')).css({
			position: 'absolute',
			top: '0',
			right: '0',
			width: '6.0em',
			height: '3.0em',
			padding: '.5em 1.0em',
			background: 'transparent',
			color: '#ccc',
			fontSize: '82%',
			fontWeight: 'bold',
			cursor: 'pointer'
		}).html('<p>アナログ</p>');
		jQuery('html, body').css({
			width: '100%',
			margin: '0',
			padding: '0'
		});
	}

	// hatena Bookmark
	var rurl = document.URL;
	var urls = rurl.split("/");
	var seturi = urls[urls.length-1];
	if (seturi.indexOf('.',0)) {
		seturi= seturi.split(".")[0];
	}
	if (seturi) {
	var hbico = '<a href="http://b.hatena.ne.jp/entry/http://www.ichiro.to/item/'+seturi+'"><img src="http://www.ichiro.to/common/media/share/b_entry.gif" width="16" height="12" style="border: none;" alt="このエントリーを含むはてなブックマーク" title="このエントリーを含むはてなブックマーク" /></a>';
	var hbentry = ' <a href="http://b.hatena.ne.jp/entry/http://www.ichiro.to/item/'+seturi+'" title="はてブエントリー"><img src="http://b.hatena.ne.jp/entry/image/http://www.ichiro.to/item/'+seturi+'" alt="はてブエントリー" /></a>';
	jQuery(hbentry).prependTo('.itemdata:first').css({
		marginRight: '3px'
	});
	jQuery(hbico).prependTo('.itemdata:first').css({
		marginRight: '3px'
	});
	}

	// item/654
	jQuery('#omoshiroindamon').css({
		'color':'#00f',
		'fontWeight':'bold',
		'cursor':'pointer'
	});
	jQuery('#omoshiroindamon').toggle(
		function(){
			jQuery(this).animate({
				'fontSize':'200%'
			},2000,'easeInOutBounce');
		},
		function(){
			jQuery(this).animate({
				'fontSize':'100%'
			},2000,'easeInOutBounce');
		}
	);
	/*
	jQuery('a').hover(
		function(){
			jQuery(this).animate({color: 'pink' }, 1000).animate( { color: 'blue' }, 1000);
		},
		function(){
			jQuery(this).animate({color: 'blue' }, 1000);
		}
	);
	*/

	//jQuery('.entry p img').caps();
	jQuery('.contentbody .rightbox img, .entry .rightbox img').imgcaps({
		layer: 'outer',
		position: 'bottom'
	});

});
