<!--
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();
}

function getActiviteiten(datum, server_url)
{
	var act_result = document.getElementById("agenda_act");
	var url = server_url + "includes/page_agenda_act.php?act=" + datum;
	//
	xmlhttp.open("GET", url, true);
	xmlhttp.onreadystatechange = function() 
	{
		if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			act_result.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}

/* MENU FUNCTIES */
function menuInit()
{
	musicPopup();
	
	if (document.all && document.getElementById)
	{
		navRoot = document.getElementById("main_nav");
		for (i = 0; i < navRoot.childNodes.length; i++)
		{
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI")
			{
				node.onmouseover = function()
				{
					this.className += " over";
				}
				node.onmouseout = function()
				{
					this.className = this.className.replace(" over", "");
				}
			}
		}
	}
}

function musicPopup()
{
	var count = GetCookie("count");
	var exp = new Date();
	exp.setTime(exp.getTime() + (1 * 24 * 60 * 60 * 1000));	
	
	if (count == null)
	{
		if(openMusic())
		{
			count=1;
			SetCookie("count", count, exp);
		}
	}
	else
	{
		count++;
		SetCookie("count", count, exp);
	}		
}

function openMusic()
{
	var yes = window.open("player.php", "", "width=200,height=75,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");	
	return yes;
}

window.onload = menuInit;

/* EDITOR FUNCTIE */
function initEditor(ed_arr)
{
    xinha_editors = null;
    xinha_init    = null;
    xinha_config  = null;
    xinha_plugins = null;

    // This contains the names of textareas we will make into Xinha editors
    xinha_init = xinha_init ? xinha_init : function()
    {
      xinha_plugins = xinha_plugins ? xinha_plugins : [ ];

      // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
      if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      xinha_editors = xinha_editors ? xinha_editors : ed_arr;
      xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

      HTMLArea.startEditors(xinha_editors);
    }

	var oldOnload = window.onload;
	window.onload = function()
	{
		xinha_init();
		oldOnload();
	}
	
	/*tinyMCE.init({
			 mode : "textareas",
			 theme : "advanced",
			 language : "en",
			 theme_advanced_buttons1 : "bold,italic,underline,separator,bullist,separator,undo,redo,separator,link,unlink,separator,image,separator,styleselect,formatselect,separator,code",
			 theme_advanced_buttons2 : "",
			 theme_advanced_buttons3 : "",
			 theme_advanced_toolbar_align : "left",
			 extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|alt|title|width|height|onmouseover|onmouseout|name],hr[class|width|size|noshade],span[class|align|style]",
			 content_css : "http://www.kobeproesmans.be/templates/default/css/editorstyle.css",
			 theme_advanced_styles : "Normale tekst=txtNormaal; Kleine tekst=txtKlein; Grote tekst=txtGroot"
	});*/	
}

/* OPEN ARTIKEL */
function openArtikel(url)
{
	var popUpWin = open(url, 'ArtikelKobe', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,width=500,height=500,left=20,top=20,screenX=20,screenY=20');
}

function GetCookie (name)
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function SetCookie (name, value)
{
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

function DeleteCookie (name)
{
	var exp = new Date();
	exp.setTime (exp.getTime() - 1);
	var cval = GetCookie (name);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function getCookieVal(offset)
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
//-->