// ColorBox
$(document).ready(function(){
	$('ul a.photo').colorbox({transition: 'fade'}, function() {
    Cufon.replace('#cboxTitle');
    $('#colorbox, #cboxWrapper').css('overflow', 'visible');
  });
	//$('#gallery .letter a.movie').colorbox({width: '200px', height: '300px', iframe: true}, function() {Cufon.replace('#cboxTitle');});
	$('ul a.movie').each(function() {
    var mnWidth = 30 + parseInt($(this).css('width').split('px', 1)) + 'px';
    var mnHeight = 55 + parseInt($(this).css('height').split('px', 1)) + 'px';
    $(this).colorbox({width: mnWidth, height: mnHeight, iframe: true}, function() {
      Cufon.replace('#cboxTitle');
    });
  });
	$('ul a.music').colorbox({width: '320px', height: '16px', iframe: true}, function() {
    Cufon.replace('#cboxTitle');
  });
	$('ul a.text').each(function() {
    //var node = $(this).parent().find('div.text');
	  var nodeid = $(this).attr('id').split('link');
    nodeid = '#text' + nodeid[1];
    var node = $(nodeid);
    var tnWidth = 22 + parseInt(node.css('width').split('px', 1)) + 'px';
    var tnHeight = 86 + parseInt(node.css('height').split('px', 1)) + 'px';
    //if ($.browser.msie && $.browser.version < 7) {tnHeight = 90 + parseInt(node.css('height').split('px', 1)) + 'px';}
    $(this).colorbox({width: tnWidth, height: tnHeight, inline: true, href: nodeid}, function() {
      Cufon.replace('#cboxTitle');
    });
  });
});

