// JavaScript Document
$(function() {
	//run the currently selected effect
	function runEffect(){
		var preid = currentId;
		var selectedEffect = "clip";
		var options = {};
		$("#head_line_news_img"+preid).effect(selectedEffect,options,300,callback);
		//$("#head_line_news_title"+preid).effect(selectedEffect,options,300);
		$("#head_line_news_title"+preid).hide(300);
		//$("#head_line_news_desc"+preid).hide(300);
		$("#head_line_news_desc"+preid).fadeOut(300);
	};
                
	function runShow(){
		var id = getThisID(); 
		var selectedEffect = "slide";
		var options = {};
		$("#head_line_news_img"+id).show(selectedEffect,options,500);
 		//$("#head_line_news_title"+id).show("clip",options,500);
		$("#head_line_news_title"+id).show(500);
		//$("#head_line_news_desc"+id).show(500);
		$("#head_line_news_desc"+id).fadeIn(500);
	};
		
	function callback(){
		setTimeout(function(){
			runShow();
		}, 50);
	};	
                
	var start_Int = function(e) {
		timerId = window.setInterval(function(){
			runEffect();
		}, 10000);
	};
	
	start_Int();
                
	function getThisID() {
		currentId++
	if (currentId > idCount) {
		currentId = 1;
	}
		return currentId;
	};
});