jQuery(document).ready(function() {
	
	//tooltip
	jQuery('ul.works li a').each(function(){
		jQuery(this).addClass('imgTip');
		var t = jQuery(this).html();
		ttl = t.split(' ');
		var fileName = '';
		if(ttl.length > 1) fileName = ttl.join('-');
		else fileName = ttl[0];
		
		var img = '<img src="http://ryo.chohashi.com/wp-content/uploads/' + fileName + '-62x62.jpg" />';
		jQuery(this).tinyTips('dark', img);
	});

	
  //for single page
  jQuery('.content p img').each(
  	function(i){jQuery(this).attr({'class': 'list'}); }
  );
  jQuery('.content p .list').wrap('<div class="left imgs"></div>');
  
  $imgs = jQuery('.content p div');
  var imgLength = $imgs.length;
  
  
  var pWidth = 0;
  var margin = 10;
  $imgs.each(function(i){
    jQuery(this).attr({'id': i+1});
    var w = jQuery(this).children('.list').width();
    pWidth += w + margin; 
  });
  jQuery('.content p').css('width', pWidth + margin - 640);
  jQuery('.content').css('width', pWidth + margin + 100);
  
  
  /*var links = '';
  for(var i=1; i<imgLength+1; i++){
  	links += '<li><a href="#'+ i +'">'+ i +'</a></li>';
  }

  jQuery('.info').after('<div id="content_footer"><ul>'+ links +'</ul></div>');*/
  
});



jQuery(window).load(function(){
	jQuery('body').fadeTo(500, 1);
});
