
///////////////////////////////////////
// Layer Scroll;
///////////////////////////////////////

var newx = 0;
var newy = 0;



function startAnime(target_id, newx, newy, eType, speed)
{
var boxObj = new YAHOO.util.Scroll(target_id, { scroll: { to:[newx, newy] } }, speed, eType , speed);
boxObj.animate();
}


///////////////////////////////////////

function arrow_move(target_id, newx, newy, eType, speed)
{
var boxObj = new YAHOO.util.Scroll(target_id, { scroll: { by:[newx, newy] } }, speed, eType , speed);
boxObj.animate();
}

function slider_arrow(go_right)
{
	var size = 486;
	var zero = YAHOO.util.Dom.getX("slidearea");
	var slider_x = YAHOO.util.Dom.getX("sliderThumb");

	var safe_L = zero + 175;
	var limit_L = zero;

	var safe_R = zero + 700 - 175;
	var limit_R = zero + 700;
	var handle_move;
	
	if(go_right){
		handle_move = 175;
		if(slider_x > safe_R){
			handle_move = limit_R - slider_x;
		}
	}else{
		size = 0-size;
		handle_move = -175;
		if(slider_x < safe_L){
			handle_move = (zero - slider_x);
		}
	}

	move_objectBy('sliderThumb', handle_move, 0);
	arrow_move('artist_slide', size, 0, YAHOO.util.Easing.easeBothStrong, 0.5);

}





function scroll_move(target_id, newx, newy, eType, speed)
{
var boxObj = new YAHOO.util.Scroll(target_id, { scroll: { to:[newx, newy] } }, speed, eType , speed);
boxObj.animate();
}

///////////////////////////////////////
// ALL Layer Scroll;
///////////////////////////////////////

/*function scroll_layer_chain(artist_id)
{
var newx1 = 0;
var newy1 = artist_id * 242; 

var newx2 = 0;
var newy2 = artist_id * 521 + 2075;

var newx3 = artist_id * 453;
var newy3 = 0;

startAnime('smb1', -166, 0, YAHOO.util.Easing.easeBothStrong, 0.5);

startAnime('art01', newx1, newy1, YAHOO.util.Easing.easeBothStrong, 0.5);

startAnime('store_main', newx2, newy2, YAHOO.util.Easing.easeBothStrong, 1);

startAnime('media_slide', newx3, newy3, YAHOO.util.Easing.easeBothStrong, 1.5); 

}*/


///////////////////////////////////////
// commu bannar motion;
///////////////////////////////////////

var commu_flg = 0;
var resize_id='';
var move_id='';
var resize_w, resize_h, add;

function resize_object(resize_id, resize_w, resize_h, add){
	var boxObj1 = new YAHOO.util.Anim(resize_id, {
		width: { to:resize_w, unit:"px" },
		height: { to:resize_h, unit:"px" } },0.5);
		boxObj1.onComplete.subscribe(function(){add});
		boxObj1.animate();
}

function move_object(move_id, move_x, move_y, add){
var boxObj2 = new YAHOO.util.Motion(move_id, {
points:{ by:[move_x, move_y]}
},0.5);
	boxObj2.onComplete.subscribe(function(){add});
	boxObj2.animate();
}

function move_objectBy(move_id, move_x, move_y){
var boxObj2 = new YAHOO.util.Motion(move_id, {
points:{ by:[move_x, move_y]}
},0.5);
	boxObj2.onComplete.subscribe(function(){
		var zero = YAHOO.util.Dom.getX("slidearea");
		var slider_x = YAHOO.util.Dom.getX("sliderThumb");
		num = slider_x - zero;
		chkCate(num);
	});
	boxObj2.animate();
}

function move_objectTo(move_id, move_x, move_y){
var boxObj2 = new YAHOO.util.Motion(move_id, {
points:{ to:[move_x, move_y]}
}, 0.5);
	boxObj2.animate();
}

function set_position_by_object(sp_id, spx, spy){
newx=YAHOO.util.Dom.getX(sp_id) + spx;
newy=YAHOO.util.Dom.getY(sp_id) + spy;
YAHOO.util.Dom.setXY(sp_id, [newx, newy], false);
}

function set_position_by_bannar(sp_id, spx, spy){
newx=YAHOO.util.Dom.getX(sp_id) + spx;
newy=YAHOO.util.Dom.getY(sp_id) + spy;
YAHOO.util.Dom.setXY(sp_id, [newx, newy], false);
}


function commu_fnc01(){
resize_object('commu_line', 246, 140);
resize_object('commu_main', 237, 290);
var boxObj2 = new YAHOO.util.Motion('blog_bannar', {
points:{ by:[0, 45]}
},0.6);
	boxObj2.onComplete.subscribe(function(){commu_fnc02()});
	boxObj2.animate();
}

function commu_fnc02(){
newx=YAHOO.util.Dom.getX('bbs_bannar');
newy=YAHOO.util.Dom.getY('blog_bannar');
var boxObj2 = new YAHOO.util.Motion('blog_bannar', {
points:{ to:[newx, newy]}
},0.3);
	boxObj2.onComplete.subscribe(function(){commu_fnc03()});
	boxObj2.animate();
}

function commu_fnc03(){
//resize_object('artists', 506, 180);
//resize_object('artists01', 506, 0);
YAHOO.util.Dom.addClass('bbs_bannar', "margin_right_15");
set_position_by_object('blog_bannar', 110, -45);
resize_object('commu_text', 237, 0);
resize_object('bbs_bannar', 220,80);
resize_object('blog_bannar', 220,80);
resize_object('commu_line', 246,300);
startAnime('all', 0, 1000, YAHOO.util.Easing.easeBothStrong, 3);
window.scroll(0,500);
}

function link_fnc(){
//resize_object('artists', 506, 180);
//resize_object('artists01', 506, 0);
resize_object('link_main', 237, 290);
resize_object('link_line', 246, 300 );
startAnime('link_main', 0, 105, YAHOO.util.Easing.easeBothStrong, 0.5);
//YAHOO.util.Dom.removeClass("box", "subContents");
window.scroll(0,500);
}

function commu_fnc04(){
resize_object('commu_main', 237, 290);
resize_object('commu_line', 246, 300 );
startAnime('commu_main', 0, 86, YAHOO.util.Easing.easeBothStrong, 0.5);
window.scroll(0,550);
//resize_object('artists', 506, 180);
//resize_object('artists01', 506, 0);
//YAHOO.util.Dom.removeClass("box", "subContents");
}

