/*---------------------------------------------
 [I[o[ݒ
---------------------------------------------*/

jQuery.fn.rollover = function(suffix) {
	suffix = suffix || '_on';
	return this.not('[src*="'+ suffix +'."]').each(function() {
		var img = jQuery(this);
		var src = img.attr('src');
		var _on = [
			src.substr(0, src.lastIndexOf('.')),
			src.substring(src.lastIndexOf('.'))
		].join(suffix);
		jQuery('<img>').attr('src', _on);
		img.hover(
			function() { img.attr('src', _on); },
			function() { img.attr('src', src); }
		);
	});
};


jQuery(function($) {
	$('a.on img').rollover();
	$('form input:image').rollover();
});



/*---------------------------------------------
 TChirݒ
---------------------------------------------*/
$( document ).ready( function () {
	$( '#side' ).scrollFollow( {
		speed: 500,
		offset: 0,
		container: 'scroll_area'
	} );
} );



/*---------------------------------------------
 PDFACRݒ
---------------------------------------------*/
$.fn.extend(
{
	addPdfIcon: function(param)
	{
		var pdfElem = $(this);
		if(param == "after")
		{
			pdfElem.not(".noIcon").after("<span class='pdfAfter'>&nbsp;</span>");
		}
		else if (param == "before")
		{
			pdfElem.not(".noIcon").before("<span class='pdfBefore'>&nbsp;</span>");
		}
		pdfElem.click(function()
		{
			this.target = "_blank";
		});
	}
});

$(function()
{
	//$("a[href$='pdf']").addPdfIcon("before");
	$("a[href$='pdf']").addPdfIcon("after");
});



