document.write('<script type="text/javascript" src="/themes/chunichi/js/thickbox.js"></script>');

$(function(){
	if($('div').is('.photoAreaInner')){
		$(".photoAreaInner").easySlider({
			prevText: '<img src="/themes/chunichi/images/mark/icon-prev.gif" />',
			nextText: '<img src="/themes/chunichi/images/mark/icon-next.gif" />'
		});
	}
	
	
	$('#news .contentsBox,#linkColumnArea .linkBox,.hoveraction .contents').hover(function(){
		$(this).addClass('link')
			.css('cursor','pointer')
			.click(function(){
				window.location.href = $('a',this).attr('href');
			});												   
	},function(){
		$(this).removeClass('link');
	});
	
	$('#special a img,#blog a img').mouseover(function(){
		$(this).css({
			opacity: '0.2',
			filter: 'alpha(opacity=20)'
		}).fadeTo('slow',1.0);
	});
	
	
	var inputVal = $('.valset').next().val();
	$('.valset').val(inputVal);
	
	$('.newsPhoto').each(function(){
		if($('a',this).html() == ''){
			$(this).hide();
		}
	});
	
	$('#blog > dl dd').each(function(){
		if($(this).text().indexOf('PR') == 0){
			$(this).parent().remove();
		}
	});
	
});

window.onload = function(){
	var sets = [], temp = [];
	var column2Obj = '#linkColumnArea .linkBoxInner,.columnTwoBg .box';
	$(column2Obj).each(function(i) {
		temp.push(this);
		if (i % 2 == 1) {
			sets.push(temp);
			temp = [];
		}
	});
	if (temp.length) sets.push(temp);

	/* 各組ごとに高さ揃え */
	$.each(sets, function() {
		$(this).flatHeights();
	});
	
	sets = [], temp = [];
	var column3Obj = '#systemColumn .box,.columnThreeBg .box';
	$(column3Obj).each(function(i) {
		temp.push(this);
		if (i % 3 == 2) {
			sets.push(temp);
			temp = [];
		}
	});
	if (temp.length) sets.push(temp);

	/* 各組ごとに高さ揃え */
	$.each(sets, function() {
		$(this).flatHeights();
	});
}


