$(document).ready(function(){
	
	var first = 0;
	var speed = 700;	//
	var pause = 15000;	//
	
		function removeFirst(){
			first = $('ul#listticker li:first').html();
			$('ul#listticker li:first').animate({opacity: 0}, speed).fadeOut('slow', function() {$(this).remove();});
			addLast(first);
		}
		
		function addLast(first){
			last = '<li style="display:none">'+first+'</li>';
			$('ul#listticker').append(last);
			$('ul#listticker li:last').animate({opacity: 1}, speed)	.fadeIn('slow');
		}
	
	interval = setInterval(removeFirst, pause);
});

function ImgChg(src, no, info){
	$('#mv_info').load("info.php?no=" + no);

	//
		
	for(var i=1; i<6; i++){
		sel_bg = "img/frame.gif";
		if(i == no)	 sel_bg = "img/now_select.gif";
		$('#movie' + i).attr("src", sel_bg);
	}

	//
	mvimg = '<img src="' + src + '" alt="' + info + '" border="0" width="688" height="387" onclick="moving(' + no + ')" />';
	$('#move_area').html(mvimg);

}

function chigira_x(data, ID_NAME){
	
	var widther  = 688;
	var heighter = 387;

	swfTag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" width="' + widther + '" height="' + heighter + '"><param name="movie" value="../../clip/FLV_Player.swf" /><param name="salign" value="lt" /><param name="quality" value="high" /><param name="FlashVars" value="&MM_ComponentVersion=1&skinName=../../clip/Skin&streamName=' + data + '&autoRewind=true" /><param name="wmode" value="transparent" /><embed src="../../clip/FLV_Player.swf"flashvars="&MM_ComponentVersion=1&skinName=../../clip/Skin&streamName=' + data + '&autoRewind=true" wmode="transparent" quality="high" width="' + widther + '" height="' + heighter + '" name="../../clip/FLV_Player" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

	$(ID_NAME).html(swfTag);
}

function moving(name){
	chigira_x('mv' + name + '&autoPlay=true', '#move_area');
}

function moving2(){
	chigira_x('TOV' + '&autoPlay=true', '#move_area');
}
