$(document).ready(function(){
						   
/* ACCORDION MENU */

    $("#accordion_producten").accordion({
		alwaysOpen: false,
		active: false,
		header: '.head'});
 

$("div#login").hide();

/* LOGIN MENU TEVOORSCHIJN */

$("a#loginBtn").click(function () {
      $("div#login").toggle("slow");
});

$("a#closeLogin").click(function () {
      $("div#login").hide("slow");
});


/* Menu toggle */
							
	$("ul.thuis, ul.workshops, ul.nascholingen, ul.mondiaal").hide();
    
    $("a.thuis").click(function () {
      $("ul.thuis").toggle("def");
    });    
    
    $("a.workshops").click(function () {
      $("ul.workshops").toggle("def");
    });    

    
    $("a.nascholingen").click(function () {
      $("ul.nascholingen").toggle("def");
    });    

    
    $("a.mondiaal").click(function () {
      $("ul.mondiaal").toggle("def");
    });
  });

function InsertLink(url)
{
	// Get the editor instance that we want to interact with.
	var oEditor = CKEDITOR.instances.t_tekst;
        var split = url.toString().split('/');
        var file = split[split.length-1];
        var filename = file.toString().split('/')

        var value = '<a href="'+url+'" />'+filename+'</a>';

	// Check the active editing mode.
	if ( oEditor.mode == 'wysiwyg' )
	{
		// Insert the desired HTML.
		oEditor.insertHtml( value );
	}
	else
		alert( 'You must be on WYSIWYG mode!' );
}

function InsertIMG(url)
{
	// Get the editor instance that we want to interact with.
	var oEditor = CKEDITOR.instances.t_tekst;
        var value = '<img src="'+url+'" style="width=350px;" />';

	// Check the active editing mode.
	if ( oEditor.mode == 'wysiwyg' )
	{
		// Insert the desired HTML.
		oEditor.insertHtml( value );
	}
	else
		alert( 'You must be on WYSIWYG mode!' );
}

