//プリロード
preloadedImages=[];
function preloadImage(url){
	var p=preloadedImages;
	var l=p.length;
	p[l]=new Image;
	p[l].src=url;
};

$(function(){
	
	//class="over"にロールオーバーを設定（src属性を_f2付きのものに差し替える）
	$('img.over').each(function(){
		this.originalSrc=$(this).attr('src');
		this.rolloverSrc=this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, "_f2$1");
		preloadImage(this.rolloverSrc);
	}).hover(function(){
		$(this).attr('src', this.rolloverSrc);
	}, function(){
		$(this).attr('src', this.originalSrc);
	});
	
	//ポップアップ
	$('a.popup').click(function(){
		newWindow=window.open(this.href,'answers','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=400');
		$(newWindow).focus();
		return false;
	});

	$('a.popup2').click(function(){
		newWindow=window.open(this.href,'map','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=650');
		$(newWindow).focus();
		return false;
	});

	//ページ内リンクのスクロール
	//$('body').ScrollToAnchors(500);
	
	//ページ内リンクの色替え
	//$('a[@href^="#"]').addClass('anchorL').click(function(){
	//	$(this).addClass('anchorV');
	//});
	
});
