jQuery.noConflict();

function pagegoud(pagina)
{
	var xmlHttp = check();
	
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState == 4)
		{
			document.getElementById('advertentiegroot').innerHTML = xmlHttp.responseText;
		}
	}
	
	if(pagina == "")
	{
		pagina = "1";
	}
	
	xmlHttp.open("GET", "modules/advertentie.php?id="+pagina, true);	
	
	xmlHttp.send(null);
}

function check()
{
	var xmlHttp;
	try
	{
	// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	return xmlHttp;
}

function onadclick(id)
{
	pagegoud(id);
	jQuery("#advertentieachter").fadeIn(1000);
	jQuery("#advertentiegroot").fadeIn(1000);
}

function onad2click()
{
	jQuery("#advertentieachter").fadeOut(1000);
	jQuery("#advertentiegroot").fadeOut(1000);
}

function start()
{
	jQuery("#ad01").show();
	jQuery("#ad11").show();
	jQuery("#ad21").show();
	setTimeout(function(){
		slideshowadvent()
	}, 5000);
}

function repeat()
{
	setTimeout(function(){
		slideshowadvent()
	}, 4000);
}

function slideshowadvent()
{
	setTimeout(function(){
		jQuery("#ad01").hide(1000);
		jQuery("#ad02").show(1000);
	}, 0);
	setTimeout(function(){
		jQuery("#ad02").hide(1000);
		jQuery("#ad03").show(1000);
	}, 10000);
	setTimeout(function(){
		jQuery("#ad03").hide(1000);
		jQuery("#ad04").show(1000);
	}, 20000);
	setTimeout(function(){
		jQuery("#ad04").hide(1000);
		jQuery("#ad05").show(1000);
	}, 30000);
	setTimeout(function(){
		jQuery("#ad05").hide(1000);
		jQuery("#ad06").show(1000);
	}, 40000);
	setTimeout(function(){
		jQuery("#ad06").hide(1000);
		jQuery("#ad01").show(1000);
	}, 50000);

	setTimeout(function(){
		jQuery("#ad11").hide(1000);
		jQuery("#ad12").show(1000);
	}, 3000);
	setTimeout(function(){
		jQuery("#ad12").hide(1000);
		jQuery("#ad13").show(1000);
	}, 13000);
	setTimeout(function(){
		jQuery("#ad13").hide(1000);
		jQuery("#ad14").show(1000);
	}, 23000);
	setTimeout(function(){
		jQuery("#ad14").hide(1000);
		jQuery("#ad15").show(1000);
	}, 33000);
	setTimeout(function(){
		jQuery("#ad15").hide(1000);
		jQuery("#ad16").show(1000);
	}, 43000);
	setTimeout(function(){
		jQuery("#ad16").hide(1000);
		jQuery("#ad11").show(1000);
	}, 53000);

	setTimeout(function(){
		jQuery("#ad21").hide(1000);
		jQuery("#ad22").show(1000);
	}, 6000);
	setTimeout(function(){
		jQuery("#ad22").hide(1000);
		jQuery("#ad23").show(1000);
	}, 16000);
	setTimeout(function(){
		jQuery("#ad23").hide(1000);
		jQuery("#ad24").show(1000);
	}, 26000);
	setTimeout(function(){
		jQuery("#ad24").hide(1000);
		jQuery("#ad25").show(1000);
	}, 36000);
	setTimeout(function(){
		jQuery("#ad25").hide(1000);
		jQuery("#ad26").show(1000);
	}, 46000);
	setTimeout(function(){
		jQuery("#ad26").hide(1000);
		jQuery("#ad21").show(1000);
		repeat();
	}, 56000);
}
