
/*************************************************************************/
/*Fotos*/
/*************************************************************************/

function ShowImage(theTeller)
{
	if(timeouter!=null)
	{
		clearTimeout(timeouter);
	}
	if(fadeintimeouter!=null)
	{
		clearTimeout(fadeintimeouter);
	}
	if(fadeouttimeouter!=null)
	{
		clearTimeout(fadeouttimeouter);
	}
	
	
	nextSrc=myPics[theTeller];
	fadeouttimeouter=setTimeout(fadeItOut,0);
	$('.star').attr("src","images/starnotselected.jpg");
	document.getElementById('star' + (theTeller).toString()).src='images/starselected.jpg';
}
 
function ShowNextPicture()
{
 
	nextSrc=myPics[initImage];
	fadeItOut();
 
	
	
	$('.star').attr("src","images/starnotselected.jpg");
	document.getElementById('star' + (initImage).toString()).src='images/starselected.jpg';
	
	
	
	initImage++;
	
	if(initImage == myPics.length)
	{
		initImage=0;
	}
	
	timeouter=setTimeout(ShowNextPicture,5000);
}
 
 
 
 
 
function fadeItOut()
{
	document.getElementById('homeimage').style.opacity = value/10;
	document.getElementById('homeimage').style.filter = 'alpha(opacity=' + value*10 + ')';
	
	if(value>0)
	{
		value=value-1
		fadeouttimeouter=setTimeout(fadeItOut,20);
	}
	else
	{
		$("#homeimage").attr("src",nextSrc);
		
		fadeintimeouter=setTimeout(fadeItIn,0);
	}
}
function fadeItIn()
{
	document.getElementById('homeimage').style.opacity = value/10;
	document.getElementById('homeimage').style.filter = 'alpha(opacity=' + value*10 + ')';
	
	if(value<10)
	{
		value=value+1
		fadeintimeouter=setTimeout(fadeItIn,20);
	}
}




/*************************************************************************/
/*NIEUWS*/
/*************************************************************************/
function ShowNextNewsItem()
{
 
	var nextNewsId=myNews[initNews];
	
	
	
	initNews++;
	if(initNews == myNews.length)
	{
		initNews=0;
	}
	ShowNieuwsItemIntro(nextNewsId);
	newstimeouter=setTimeout(ShowNextNewsItem,5000);
}

function ShowNieuwsItemIntro(key)
{
	if(newstimeouter!=null)
	{
		clearTimeout(newstimeouter);
	}

	
	var oParams =  {};
	oParams["key"]=key;
	$.post("getters/getnieuwsitemintro.php",oParams,function(data){
			$("#nieuwsintro").html(data);   
			$(".newschooserselected").attr("class","newschooser");
			$("#nieuws" + key).attr("class","newschooserselected");
	});

}

function ShowAkoteeTVManual()
{
	clearTimeout(tvtimeouter);
	ShowAkoteeTV("man");
}
function ShowAkoteeInDePersManual()
{
	clearTimeout(tvtimeouter);
	ShowAkoteeInDePers("man");
}


function ShowAkoteeTV(soort)
{
	var oParams =  {};
	$.post("getters/akoteetv.php",function(data){
			$("#akoteetv").html(data);   
	});
	
	
		if(soort!="man")
			tvtimeouter=setTimeout(ShowAkoteeInDePers,5000);

}
function ShowAkoteeInDePers(soort)
{
	var oParams =  {};
	$.post("getters/akoteepers.php",function(data){
			$("#akoteetv").html(data);   
	});
	
	if(soort!="man")
		tvtimeouter=setTimeout(ShowAkoteeTV,5000);


}
 
