function UpdateClicks(Id)
{
	$.ajax({
	type: "POST",
	url: "./index.php/block/updateClicks/",
	data: "advertentie=" + Id,
		success: function(msg){}
	});
}
function GoTo(Location)
{
	window.location = Location;
}

function GetCategories(source)
{
	$('#category').attr("disabled", true);
	$('#category').children().remove();
	Id = $(source).val();
	$.ajax({
	type: "POST",
	url: "./bhrbc.php/category/getXML/",
	data: "uitzending=" + Id,
		success: function($xml){
			$('#category').append('<option>---</option>');
			$($xml).find('categories').find('category').each(function(){
				$('#category').append('<option value="' + $(this).find('CategorieId').text() + '">' + $(this).find('Naam').text() + '</option>');
			});
			$('#category').attr("disabled", false);
		}
	});
}

function GetArticles(source)
{
	$('#article').attr("disabled", true);
	$('#article').children().remove();
	Id = $(source).val();
	$.ajax({
	type: "POST",
	url: "./bhrbc.php/article/getXML/",
	data: "category=" + Id,
		success: function($xml){
			$('#article').append('<option>---</option>');
			$($xml).find('articles').find('article').each(function(){
				$('#article').append('<option value="' + $(this).find('ArtikelId').text() + '">' + $(this).find('Naam').text() + '</option>');
			});
			$('#article').attr("disabled", false);
		}
	});
}

function getSuzebij(source)
{
	Id = $(source).val();
	$.ajax({
	type: "POST",
	url: "./index.php/block/suzebijXML/",
	data: "uitzending=" + Id,
		success: function($xml){
			$('#suzebij').val($xml);
		},
		error: function()
		{
			alert('Niet geladen');
		}
	});
}


function GetVideo(source)
{
	$('.videoPlayer').html('');
	$('.videoPlayer').fadeOut('slow', function(){
		$('.videoPlayerLoader').fadeIn('slow');
	});

	$('.videoPlayerContainer').slideDown('slow');

	$.ajax({
		type: "POST",
		url: "./index.php/video/bekijk",
		data: "videoId="+source,
			success: function(html)
			{
				$('.videoPlayerLoader').fadeOut('slow', function() {
					$('.videoPlayer').fadeIn('slow', function(){
						$('.videoPlayer').html(html);
					});
				});
			},
			error: function()
			{
				alert('Niet geladen');
			}

	});

}

function getBanners()
{
	$.ajax({
		type: "POST",
		url: "./index.php/getbanners",
			success: function(html)
			{
				$('#skyscrapers').after(html).remove();
			}
	});
	setTimeout("getBanners()",15000);
}

$(function() {
	$("#tabs").tabs();
	setTimeout("getBanners()",15000);
});