/************************************************/
/* SNS3 Javascript								*/
/* -------------------------------------------- */
/* nhk.whatson.js - Topic view code				*/
/* (c) NHK, Inc 2009							*/
/* -------------------------------------------- */
/* Author: N.H.K								*/
/************************************************/

var _whatson = window.SNSoard;

var cur_ws = 1;

_whatson.prototype.whatson = {
	
	init: function()
	{
		Debug.write("Initializing nhk.whatson.js");
		
		document.observe("dom:loaded", function(){
			sns.whatson.initEvents();
		} );
	},
	
	initEvents: function()
	{
	},

	wsClick: function(new_ws)
	{
		document.getElementById('whatson_comment_'+cur_ws).style.display='none';
		document.getElementById('whatson_'+cur_ws).style.background='#666666';
		document.getElementById('whatson_comment_'+new_ws).style.display='block';
		document.getElementById('whatson_'+new_ws).style.background='#66cc33';
		cur_ws = new_ws;
	},

	moveDown: function()
	{
		cur_height = parseInt(document.getElementById('whatsonContent').style.top);
		if (cur_height >=(document.getElementById('whatsonContent').offsetHeight*-1)+120)
		{
			document.getElementById('whatsonContent').style.top=cur_height-5+'px';
			movedownvar=setTimeout("sns.whatson.moveDown()",20);
		}
	},

	moveUp: function()
	{
		cur_height = parseInt(document.getElementById('whatsonContent').style.top);
		if (cur_height <= 0)
		{
			document.getElementById('whatsonContent').style.top=cur_height+5+'px';
			moveupvar=setTimeout("sns.whatson.moveUp()",20);
		}
	}

};

sns.whatson.init();
