function isArray(obj) {
    return obj.constructor == Array;
}



function in_array(needle, haystack, strict) {
		 var found = false, key, strict = !!strict;

		for (key in haystack) {
				if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
						found = true;
						break;
				}
		}

		return found;
}

function alertbox(message,redirect) {
	if ( $('#alert').size() == 0 ) $('<div id="alert"></div>').appendTo('body');
	var $alert = $('#alert');
	$('#alert').html(message);
				if($alert.length)
				{
					var alerttimer = window.setTimeout(function () {
						$alert.trigger('click');
					}, 3000);
					$alert.animate({height: $alert.css('line-height') || '50px'}, 200)
					
					.click(function () {
						window.clearTimeout(alerttimer);
						$alert.animate({height: '0'}, 200);
						if ((redirect) && (redirect!='')) {
						window.location = redirect;
						}
					});
				}

	
}

function addactie(tclass)
{
 $(tclass).click(function() { 
        $.getJSON(this.href+"",{json: 1, ajax: 'true'}, function(j){
				alertbox(j.message,j.redirect);				
			
		})
 
        return false; 
    }); 

}




function tabload(ident)
{
if (ident!=undefined) ident=ident+" ";
else ident='';
tb_init(ident+'a.thickbox');
//$(ident+'.rounded').corners();
addactie(ident+'.json');
}


function afterload(ident)
{
tabload(ident);
 $(ident+' .bigtarget').bigTarget({
    hoverClass: 'lijstover', // CSS class applied to the click zone onHover
    clickZone : 'div:eq(0)' // jQuery parent selector
  }); 
}


		 function isCheckedById(id)
		{
				var checked = $("input[id="+id+"]:checked").length;
				if (checked == 0)
				{
						return false;
				}
				else
				{
						return true;
				}
		}





