/*
 * newsticker.js 0.9
 * Copyright (c) 2007 C.M.A. Co.,Ltd.
 *
 * Last Added: 2007-01-15
 *
 */

$(function(){
	//ticker
	var	tickerLen = new Array();
	$.newsticker = function(len,num){
		if(len > tickerLen[num]-1)len=0;
		$('#ticker'+num+' li:eq('+len+')').each(function(){
			$(this).css('left',700)
				.animate({left:700},{duration:700,easing:'linear'})
				.animate({left:0},{duration:1000,easing:'easeOutExpo'})
				.animate({left:0},{duration:5000,easing:'linear'})
				.animate({left:-this.liWidth},{duration:700,easing:'easeInOutExpo',complete:function(){$.newsticker(++len,num)}});
		});
	}
	//ファイルの読み込み
	$('#ticker1'	 ).load('http://www.meitan.co.jp/news/ticker.html',function(){
		tickerLen[1] = $('#ticker1 li').length;
		$('.ticker li').each(function(){
			this.liWidth = $(this).width();
			$(this).css('left',700);
		});
		$.newsticker(0,1);
	});

});
