var prev_step = 1; 
function Comeon(current_step)
{
	$("#debate_Y"+prev_step).attr("src","./widgets/bbs/slide_gallery/image/off.gif");
	$("#debate_Y"+current_step).attr("src","./widgets/bbs/slide_gallery/image/on.gif");	
	$("#debate_content_Y"+prev_step).css('display','none');
	$("#debate_content_Y"+current_step).css('display','block');
	prev_step=current_step; 

} 
var current_step = 1; 
var interval_best; 
function best_change_Y() 
{ 
	if( current_step == over_wrap ) // 오버랩 갯수
		current_step = 1; 
	else 
		current_step++; 

	Comeon(current_step); 
} 
function setInterval_best() 
{ 
	interval_best = setInterval("best_change_Y()",4000);//속도조절 
} 
function clearInterval_best() 
{ 
	clearInterval(interval_best); 
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
 
addLoadEvent(setInterval_best);
