/**
 * JavaScript library
 * @update 7 July 2011
 */
$(function(){
	$('a[rel="external"]').click(function(){ window.open(this.href, '_blank'); return false; });
	$('img[class="rollover"]').mouseover(function(){ $(this).attr('src', $(this).attr('src').replace('_off.', '_on.')); }).mouseout(function(){ $(this).attr('src', $(this).attr('src').replace('_on.', '_off.')); });
	$('img[class="fade"]').mouseover(function(){ $(this).animate({opacity: 0.8}, 200, 'swing'); }).mouseout(function(){ $(this).animate({opacity: 1}, 200, 'swing'); });
	$('.lazylod').lazyload({effect:'fadeIn'});

	// Popup Window
	$('a[rel=popup]').click(function(e){
		var wObj = window.open('', 'subWin', 'width=540,height=540,scrollbars=1,resizable=1');
		wObj.document.clear();
		wObj.document.write('<!DOCTYPE html><html lang="ja"><head><meta charset="utf-8"><title>' + this.title + '</title></head>');
		wObj.document.write('<body style="margin:0;padding:20px;">');
		wObj.document.write('<p style="margin:0 0 5px;"><img style="vertical-align:bottom;" src="' + this.href + '"></p>');
		wObj.document.write('<p style="font-size:12px;text-align:center;margin:0;">' + this.title + '</p>');
		wObj.document.write('<p style="text-align:center;"><input type="button" value="このページを印刷" onClick="window.print();"></p>');
		wObj.document.write('</body></html>');
		wObj.document.close();
		e.preventDefault();
	});
});
