// ############
// tab box configuration
// ############

group = new Array();
config = new Array();


group['home'] 		= new Array();
group['home'][0] 	= 'top_vids';
group['home'][1] 	= 'most_viewed';
group['home'][2] 	= 'random';
group['home'][3] 	= 'evergreens';


config['top_vids'] 					= new Array();
config['top_vids']['action'] 		= 'ajax';
config['top_vids']['url'] 			= '/myspass/portal/macros/snippets/home/top_vids.html?ts=none&type=vote';
config['top_vids']['divid'] 		= 'tab_box_content_top_vids';

config['most_viewed'] 				= new Array();
config['most_viewed']['action'] 	= 'ajax';
config['most_viewed']['url'] 		= '/myspass/portal/macros/snippets/home/most_viewed.html?ts=none&type=hits';
config['most_viewed']['divid'] 		= 'tab_box_content_most_viewed';


config['random'] 					= new Array();
config['random']['action'] 			= 'ajax';
config['random']['url'] 			= '/myspass/portal/macros/snippets/home/random.html?type=random&ts=none';
config['random']['divid'] 			= 'tab_box_content_random';

config['evergreens'] 				= new Array();
config['evergreens']['action'] 		= 'ajax';
config['evergreens']['url'] 		= '/myspass/portal/macros/snippets/home/evergreens.html?ts=none&type=date';
config['evergreens']['divid'] 		= 'tab_box_content_evergreens';










// ############
// slide box for home
// ############
var pos_tv=0;
var anzahl_videos = 0;
var akt_pos_tvshows=0;
var modulo_tv=0;


function slideDIV(contentid){
		var attributes = {
		scroll: { to: [pos_tv, 0] }
		};

	var myanimation = new YAHOO.util.Scroll(contentid,attributes, 1, YAHOO.util.Easing.easeOut);
	myanimation.animate();
}


function slideDIVtoLeft(contentid,schrittweite){

	pos_tv-=schrittweite;
	if(pos_tv<=0){pos_tv=0;akt_pos_tvshows=0;}
	else{akt_pos_tvshows--;}
	slideDIV(contentid);

}



function slideDIVtoRight(anzahl_videos,contentid,schrittweite){

	slidelimit_tv=(Math.floor(anzahl_videos/3));
	modulo_tv=anzahl_videos%3;
	if(akt_pos_tvshows!=slidelimit_tv){
		akt_pos_tvshows++;	
		if(akt_pos_tvshows==slidelimit_tv)
		{
			pos_tv+=(schrittweite/3)*modulo_tv;
			//without the nexline, it will stopp if you click x-times forward, one click back and one click forward
			//akt_pos_tvshows--;
		}
		else{
			pos_tv+=schrittweite;
		}
		slideDIV(contentid);	
	
	}
	

}







