//constructor
var Sarai = function() {};

//saraiClass
Sarai.prototype = {

	//トップページの初期設定
	initTop:function(){
		if(this.isMacOpera) return;
		imgs = $("#navi a img").not(".selected");
		this.preloadImages(imgs);
		this.setOverAction(imgs);
		
	},

	//画像のプリロード
   	preloadImages:function(imgs){
		$(imgs).each(function(){
			var preload = new Image;
			var img = $("img",this);
			preload.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
		})
	},
	//画像のロールオーバー、アウトのイベントを設定する。
	setOverAction:function(imgs){
		$(imgs)
			.bind("mouseover",function(){
				this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
			})
			.bind("mouseout",function(){
				this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, "$1$2");
			})
	},
	//ブログのリスト取得
	getBlogEntry:function(){
		$.ajax({
				url : "http://blog.goyou-anime.jp/?getthumbnaillink=1",
				dataType : "jsonp",
				jsonp : "sarai.setBlogEntry",
				error : function(){
					alert('err');
				}
		});
	},
	//ブログのリストをセット jsonpコールバック関数
	setBlogEntry:function(data){
		$("#blog ul").html(data);
	}
	
};