//Slider related
//Video Handing Scripts
var vLoader = 'loaderVideos';
var disPrevButton = 'disabledPrevButton';
var disNextButton = 'disabledNextButton';

function moveVideoSetToLeft(block)
{
	videoSlider('vLeft_'+block+'=&vFetch_'+block+'=', block);	
}
function moveVideoSetToRight(block)
{
	videoSlider('vRight_'+block+'=&vFetch_'+block+'=', block);	
}
function videoSlider(pars, block)
{
	$(vLoader).show();
	block='selIndex_'+block;
	//new Ajax.Request(homeUrl, {method:'post',parameters:pars, onComplete:refreshVideoBlock});
	var myAjax = new Ajax.Updater(
								block,
								homeUrl,
								{
									method: 'post',
									parameters: pars, evalScripts : true
								});
	$(vLoader).hide();									
}

//article 
var aLoader = 'loaderArticles';
//Article handling script
function moveArticleSetToLeft(block)
{
	articleSlider('aLeft_'+block+'=&aFetch_'+block+'=', block);	
}
function moveArticleSetToRight(block)
{
	articleSlider('aRight_'+block+'=&aFetch_'+block+'=', block);	
}
function articleSlider(pars, block)
{
	$(aLoader).show();
	block='selIndex_'+block;
	//new Ajax.Request(homeUrl, {method:'post',parameters:pars, onComplete:refreshVideoBlock});
	var myAjax = new Ajax.Updater(
								block,
								homeUrl,
								{
									method: 'post',
									parameters: pars, evalScripts : true
								});
	$(aLoader).hide();									
}



//photos 
var pLoader = 'loaderPhotos';
//Article handling script
function movePhotoSetToLeft(block)
{
	photoSlider('pLeft_'+block+'=&pFetch_'+block+'=', block);	
}
function movePhotoSetToRight(block)
{
	photoSlider('pRight_'+block+'=&pFetch_'+block+'=', block);	
}
function photoSlider(pars, block)
{
	$(pLoader).show();
	block='selIndex_'+block;
	//new Ajax.Request(homeUrl, {method:'post',parameters:pars, onComplete:refreshVideoBlock});
	var myAjax = new Ajax.Updater(
								block,
								homeUrl,
								{
									method: 'post',
									parameters: pars,evalScripts:true
								});
	$(pLoader).hide();									
}


//musics 
var mLoader = 'loaderMusics';
//Article handling script
function moveMusicSetToLeft(block)
{
	musicSlider('mLeft_'+block+'=&mFetch_'+block+'=', block);	
}
function moveMusicSetToRight(block)
{
	musicSlider('mRight_'+block+'=&mFetch_'+block+'=', block);	
}
function musicSlider(pars, block)
{
	$(mLoader).show();
	block='selIndex_'+block;
	//new Ajax.Request(homeUrl, {method:'post',parameters:pars, onComplete:refreshVideoBlock});
	var myAjax = new Ajax.Updater(
								block,
								homeUrl,
								{
									method: 'post',
									parameters: pars,evalScripts:true
								});
	$(mLoader).hide();									
}


//games 
var gLoader = 'loaderGames';
//Article handling script
function moveGameSetToLeft(block)
{
	gameSlider('gLeft_'+block+'=&gFetch_'+block+'=', block);	
}
function moveGameSetToRight(block)
{
	gameSlider('gRight_'+block+'=&gFetch_'+block+'=', block);	
}
function gameSlider(pars, block)
{
	$(gLoader).show();
	block='selIndex_'+block;
	//new Ajax.Request(homeUrl, {method:'post',parameters:pars, onComplete:refreshVideoBlock});
	var myAjax = new Ajax.Updater(
								block,
								homeUrl,
								{
									method: 'post',
									parameters: pars,evalScripts:true
								});
	$(gLoader).hide();									
}

/*refreshVideoBlock = function(resp)
	{
		$('selSliderVideos').update(resp.responseText);
		$(vLoader).hide();
	}*/



function setClassName(id, class_name)
	{
		if($(id))
			$(id).className=class_name;
	}	

//Show Hide related
function showIndexTabs(id_to_fetch)
	{
		var videoBaseIndex='selIndex_';
		var liBase='li_';
		var spBase='sp_';

		var liActiveClass='clsActiveVideoLink';
		var spActiveClass='clsActiveVideoLinkRight';
		
		var thisparent=$(videoBaseIndex+id_to_fetch).parentNode;
		var someNodeList = thisparent.getElementsByTagName('li');
		var nodes = $A(someNodeList);
		nodes.each(function(node)
			{
				setClassName(node.id,'');
			});

		var someNodeList = thisparent.getElementsByTagName('SPAN');
		var nodes = $A(someNodeList);
		nodes.each(function(node)
			{
				setClassName(node.id,'');
			});

		var someNodeList = thisparent.getElementsByTagName('DIV');
		var nodes = $A(someNodeList);
		nodes.each(function(node)
			{
				if(node.id.substring(0,9)==videoBaseIndex)
					hide(node.id);
			});							
			
		setClassName(liBase+id_to_fetch,'clsActiveVideoLink');
		setClassName(spBase+id_to_fetch,'clsActiveVideoLinkRight');
		show(videoBaseIndex+id_to_fetch);		
	}	
	

			
	function recentViewedSlideShowRepeat()
		{
			var pars1='get_list=';
			/*var myAjax = new Ajax.Updater(
								'selRandomVideosList',
								homeUrlRecentlyViewed,
								{
									method: 'post',
									parameters: pars1,evalScripts:true
								});*/
			new Ajax.Request(homeUrlRecentlyViewed, {method:'post',parameters:pars1, onComplete:refreshVideosBlock});
			recentViewedSlideShow();					
		}
	
	function recentViewedSlideShow()
		{
			setTimeout('recentViewedSlideShowRepeat()', 9000);
			
		}	