$.fn.j_headline = function(options){
/*default*/
var c = $.extend({
		interval: 5000,
		fade: 'fast'
  },options);

var $placebase = $(this);

$('li:first',$placebase).addClass('active');

setInterval(function slideSwitch() {

	var $active = $('li.active',$placebase);
	if ( $active.length == 0 ) $active = $placebase.find('li:last');
	var $next =  $active.next().length ? $active.next(): $placebase.find('li:first');
	$active.animate({'filter':'alpha(opacity=0)','-moz-opacity': '0.0','opacity': '0.0'}, c.fade).addClass('last-active');
	$next.css({'filter':'alpha(opacity=0)','-moz-opacity': '0.0','opacity': '0.0'})
		.addClass('active')
		.animate({'filter':'alpha(opacity=100)','-moz-opacity': '1.0','opacity': '1.0'}, c.fade, function() {
			$active.removeClass('active last-active');
	});
}, c.interval );
}

/* run_data (another_js_file can use) */

$(function(){
	//jidaikobo-headline
var areaheight = $('#slideshow li:first-child img').attr('height');
if(areaheight==''){
$('#slideshow').css({'height':'300px'});
}else{
$('#slideshow').css({'height':areaheight});
}

	$('#slideshow').j_headline({
	  interval: 5000,
	  fade: "normal"
	});
});
