var wit;
var header;
var confirmer='<p>Weet u zeker dat u dit venster wilt sluiten?</p><p>Eventuele veranderingen gaan verloren.</p>';

$(document).ready(function () {
	wit=$('#wit');
	header=$('#header');
});

jQuery.fn.hovering=function(){
    $(this).hover(
        function(){$(this).css({'cursor':'pointer','textDecoration':'underline'});},
        function(){$(this).css({'cursor':'auto','textDecoration':'none'});}
    );
}

jQuery.fn.sort = function() {
   return this.pushStack( [].sort.apply( this, arguments ), []);
 };

function sortAlpha(a,b){
    return a.html() > b.html() ? 1 : -1;
};

function show_wit(){
	wit.css('height',$(document).height()+'px');
	wit.css('display','block');
}
function hide_wit(){
	wit.hide();
}

function get_scrolled(){
	return -(header.scrollTop());
}

function confirmdialog(functie){
    if(arguments.length==2){tekst=arguments[1];}else{
        tekst=confirmer;
    }
    $('#confirmer').html(tekst);
    $('#dialog-confirm').dialog({
			resizable: false,
			modal: true,
			buttons: {
				"Venster sluiten": function() {
					$( this ).dialog( "close" );
                                        functie();
				},
				"Annuleren": function() {
					$( this ).dialog( "close" );
				}
			}
    });
}
