$("#iphone2").ready(function(){$("#iphone2").animate({top:-16}, 1500, function(){$("#iphone2").fadeOut('slow'); $("#screen").fadeIn('slow'); }); });


function Icon(no){
	var icon_id = new Array('#icon0', '#icon1', '#icon2', '#icon3', '#icon4', '#icon5', '#icon6', '#icon7');
	var i_title = new Array('Diary of Works', 'Diary of Family', 'School days', 'Other diaries', 'Science Fiction', 'Comedy', 'Love Romances', 'Psycho');
	var icon_x = new Array(8, 71, 134, 197, 8, 71, 134, 197);
	var icon_y = new Array(80, 80, 80, 80, 163, 163, 163, 163);

//	alert($(icon_id[no]).offset().top);

	if($(icon_id[no]).offset().top != 173){
		$.get("max.php?id="+no, null, function(vmax){
			$("#ititle").html(i_title[no] + vmax);
		});

		$("#info").load("data.php?id="+no+"&no=0");
		$("#imess").animate({top:-100}, 300);										

		for(i=0; i<icon_id.length; i++){
			if(no != i){
				$(icon_id[i]).fadeOut('slow');
			}else{
				$(icon_id[no]).animate({top:8}, 300, function(){
						$("#ititle").animate({left:70}, 300);										
						$(icon_id[no]).animate({left:8}, 300, function(){
//							$("#info").animate({top:80}, 500,function(){$("#info").css("overflow-y","scroll");});											
							$("#info").animate({top:75}, 300);											
						})
				});
			}
		}
		$("#iname1").fadeOut('slow');
		$("#iname2").fadeOut('slow');
	}else{
		$("#ititle").animate({left:310}, 300);
//		$("#info").css("overflow","hidden");
		$("#info").animate({top:510}, 300);											
		$(icon_id[no]).animate({left:icon_x[no]}, 300, function(){
			$(icon_id[no]).animate({top:icon_y[no]}, 300, function(){
				for(i=0; i<icon_id.length; i++){
					if(no != i) $(icon_id[i]).fadeIn('slow');
				}
				$("#iname1").fadeIn('slow');
				$("#iname2").fadeIn('slow');
			})
			$("#imess").animate({top:8}, 300);										
		});
	}

	if(no == 0){
		$("#notebook").html("<div id='exper'><div class='cast'>ロ　ン：言わずと知れた当サイトの管理人、つまりはボキ。職場ではボケとプログラムを担当。笑いに貪欲で、会議であろうが常にオチのある話を要求する。</div><div class='cast'>アベノ：専門学校時代からの友人。主にツッコミとプログラムを担当。職場から人が居なくなるとアニソンを唄う習性有。アニメと呼ばれた漢（オトコ）が彼である。</div><div class='cast'>コスモ：職場の先輩。主にいぢられたり、スタイルシートを担当。時折、とんでもないボケを繰り出すことも。本人曰く、セブンセンシズ（第7の感覚）を持っているらしいｗ</div><div class='cast'>Ｏサマ：職場の先輩。主に大ボケとデザインを担当。一日一回は繰り出される難解なオヤジギャグに、誰も気づけないことがある。</div></div>");
	}else{
		$("#notebook").html("<div id='exper'></div>");
	}
	$("#ipage").html("");
}

function DiaryLoad(no){
	$("#notebook").load("diary.php?id="+no);
}

function NextPage(cat, page){
	$("#info").animate({left:-260}, 300, function(){
		$("#info").load("data.php?id="+ cat +"&no="+ page, function(){
			$("#info").animate({left:260}, 1, function(){ $("#info").animate({left:8}, 300); });
		});											
	});
	pag = page+1;
	$("#ipage").html(pag+" PAGE");
}

function PrevPage(cat, page){
	$("#info").animate({left:260}, 300, function(){
		$("#info").load("data.php?id="+ cat +"&no="+ page, function(){
			$("#info").animate({left:-260}, 1, function(){ $("#info").animate({left:8}, 300); });
		});											
	});											
	pag = page+1;
	$("#ipage").html(pag+" PAGE");
}
