var bChanged = false;

function EnableSubmit()
{
	bChanged = true;
 	if (element('submitbutton'))
		element('submitbutton').disabled=false;
}

function CanContinue()
{
	if (bChanged)
		return confirm('Wijzigingen zijn nog niet opgeslagen. Toch doorgaan?');
}

function WriteFlash(obj,sFlash)
{
	if (obj)
		obj.innerHTML = sFlash;
}

var http=false;

// initiate an xmlhttp socket
function createXMLHTTPsocket()
{
// INIT XMLHTTP SOCKET
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E)
{
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}


function GetContent(cat,id)
{
	var el = element("content");
	var innerel = element('innercontent');
	if (el)
	{
		el.style.display = 'block';
		if (cat == 'i')
		{
			el.style.backgroundColor = '#FAD9DA';
			element("contentfill_l1").style.display = 'block';
			element("contentfill_l2").style.display = 'block';
			element("contentfill_l3").style.display = 'block';
			element("contentclose").style.display = 'block';
		}
		if (cat == 'g')
		{
			el.style.backgroundColor = '#FAD9DA';
			//element("contentfill_l1").style.display = 'block';
			//element("contentfill_l2").style.display = 'block';
			//element("contentfill_l3").style.display = 'block';
			element("contentclose").style.display = 'block';
		}
		if (cat == 'n')
		{
			el.style.backgroundColor = '#fff';
			element("contentfill_r1").style.display = 'block';
			element("contentfill_r2").style.display = 'block';
			element("contentfill_r3").style.display = 'block';
			element("contentclosewit").style.display = 'block';
		}
		//if (innerel) innerel.innerHTML = 'Artikel wordt geladen...';
	}
	if (!http)
		http = createXMLHTTPsocket();
	http.open('get', 'getcontent.php?cat=' + cat + '&id=' + id);
	http.onreadystatechange = dataHandle;
	http.send(null);
}

function dataHandle()
{
	if (http.readyState == 4)
	{
		if (element('innercontent'))
			element('innercontent').innerHTML = http.responseText;
	}
}

function element(ID)
{
	if (document.getElementById)
		return document.getElementById(ID);
	else
		return document.all[ID];
}

function OpenPopup(url,w,h)
{
	var nw = window.open(url, '_blank', 'width='+w+',height='+h);
}

function CloseAll()
{
	window.close();
}

