/**
 * 切替えテキストのセット
 */
function hotnews_set(){
	
	var array = new Array();
	
	array.push(['http://www.buddhanose.jp/shop/index.html', '_self', '都内バラエティショップでも販売拡大中！']);
	array.push(['http://www.buddhanose.jp/products/index.html', '_self', 'Girl Balm［ガールバーム］がUSDAオーガニック認証を取得しました！']);
	array.push(['http://be.tokyu-hands.co.jp/news/beauty/buddha-nose.html', '_self', 'hands beアトレ吉祥寺店にて　取り扱いスタート！！']);



	
	return array;
	
	
}

function hotnews(){
	// 処理スタート
	change_code();
	fade_news();
}

/**
 * フェードアウト処理
 */
function fade_news(){
	
	new Effect.Fade("HotNewsLink", {
		duration: 1,
		delay: 2.5,
		afterFinishInternal: function(effect) {
			change_code();
	    	appear_news(); 
	    } 
    }); 
}

/**
 * フェードイン処理
 */
function appear_news(){
	
	new Effect.Appear("HotNewsLink", {
		duration: 1,
		delay: 0,
		afterFinishInternal: function(effect) { 
	    	fade_news();
	    } 
	}); 
}

/**
 * コードの切り替え
 */
var index = 0;
function change_code(){

	var obj = $('HotNewsLink');
	var array = hotnews_set();
	
	obj.href = array[this.index][0];
	obj.target = array[this.index][1];
	obj.innerHTML = array[this.index][2];
	
	this.index++;
	// カウントリセット
	if(this.index >= array.length){
		this.index = 0;
	}
}

