// BRAIN FORCE NL General Javascrip (JQuerey based)
//Styling Issues
var bfscriptversion = '1.4.02';
var bfscriptjqueryversion = '1.3.2';
var bfscriptjqueryuiversion = '1.7.1.custom'
var preloaderImage = $('<img/>').attr('src', '/images/ajaxpreloader.gif');

function BFNLStyling_init(){
	$("#Body").css("background-image", "url(http://www.brainforce.nl/images/bf-2009-bg-body.gif)");
	$('#SpecialLink').addClass('SpecialLink');
	$(".dialog").hide();
	$(':checkbox').css({
		"border-bottom-style": "none"
	});
	$(':radio').css({
		"border-bottom-style": "none"
	});
	$('#bfforms').css({
		"background-color": "#f4f8f9"
	
	});
	
	
	$('.ajaxNewsDialogLink').hover(function(){
		$(this).css({
			"background-color": "#d1dde6",
			"cursor": "pointer"
		
		
		});
	}, function(){
		$(this).css({
			"background-color": "#f4f8f9",
			"cursor": "default"
		
		
		});
	});
	$('.ajaxReferenceDialogLink').hover(function(){
		$(this).css({
			"background-color": "#d1dde6",
			"cursor": "pointer"
		
		
		});
	}, function(){
		$(this).css({
			"background-color": "#f4f8f9",
			"cursor": "default"
		
		
		});
	});
	
	$.ui.dialog.defaults.bgiframe = true;
	$.ui.dialog.defaults.autoOpen = false;
	$.ui.dialog.defaults.modal = true;
	
	//$("#dnn_ctr1098_ModuleContent").hide();
	
	$.datepicker.regional.nl = {
		clearText: 'Wissen',
		clearStatus: 'Wis de huidige datum',
		closeText: 'Sluiten',
		closeStatus: 'Sluit zonder verandering',
		prevText: '←',
		prevStatus: 'Bekijk de vorige maand',
		prevBigText: '«',
		nextBigStatus: 'Bekijk het vorige jaar',
		nextText: '→',
		nextStatus: 'Bekijk de volgende maand',
		nextBigText: '»',
		nextBigStatus: 'Bekijk het volgende jaar',
		currentText: 'Vandaag',
		currentStatus: 'Bekijk de huidige maand',
		monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
		monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
		monthStatus: 'Bekijk een andere maand',
		yearStatus: 'Bekijk een ander jaar',
		weekHeader: 'Wk',
		weekStatus: 'Week van het jaar',
		dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
		dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
		dayStatus: 'Stel DD in als eerste dag van de week',
		dateStatus: 'dd/mm/yy',
		dateFormat: 'dd/mm/yy',
		firstDay: 1,
		initStatus: 'Kies een datum',
		isRTL: false
	};
	$.datepicker.setDefaults($.datepicker.regional.nl);
	//$(".datepicker-DDdMMyy").datepicker({  });
	//$(".datepicker-ddmmyy").datepicker({ beforeShowDay: $.datepicker.noWeekends });
	$(".datepicker-DDdMMyy").datepicker({
		minDate: 0,
		maxDate: '+6M',
		showButtonPanel: true,
		dateFormat: 'DD, d MM, yy',
		beforeShowDay: $.datepicker.noWeekends
	});
	$(".datepicker-ddmmyy").datepicker({
		minDate: 0,
		maxDate: '+6M',
		showButtonPanel: true,
		dateFormat: 'dd-mm-yy',
		beforeShowDay: $.datepicker.noWeekends
	});
	
}
function referenceFilterTabs_init(){
// Tabs
	$("#tabs").tabs({
				collapsible: false,
				select: function(event, ui) { 
				document.getElementById('filterCombo').selectedIndex = 0; document.getElementById('oplossingenFilter').selectedIndex = 0; $('ul#filterThis li').show('normal').removeClass('hidden');
			}
});
}
//Toggles by class toggleDIV
function toggleDIV_init(){
	//hide the all of the element with class msg_body
	$("#toggleDIV_body").hide();
	//toggle the componenet with class msg_body
	$("#toggleDIV_head").click(function(){
		$(this).next("#toggleDIV_body").slideToggle(600);
	});
}


// GetURLParameter
/* Copyright (c) 2006-2007 Mathias Bank (http://www.mathias-bank.de)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * Version 2.1
 * 
 * Thanks to 
 * Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing.
 * Tom Leonard for some improvements
 * 
 */
jQuery.fn.extend({
/**
* Returns get parameters.
*
* If the desired param does not exist, null will be returned
*
* To get the document params:
* @example value = $(document).getUrlParam("paramName");
* 
* To get the params of a html-attribut (uses src attribute)
* @example value = $('#imgLink').getUrlParam("paramName");
*/ 
 getUrlParam: function(strParamName){
	  strParamName = escape(unescape(strParamName));
	  
	  var returnVal = new Array();
	  var qString = null;
	  
	  if ($(this).attr("nodeName")=="#document") {
	  	//document-handler
		
		if (window.location.search.search(strParamName) > -1 ){
			
			qString = window.location.search.substr(1,window.location.search.length).split("&");
		}
			
	  } else if ($(this).attr("src")!="undefined") {
	  	
	  	var strHref = $(this).attr("src")
	  	if ( strHref.indexOf("?") > -1 ){
	    	var strQueryString = strHref.substr(strHref.indexOf("?")+1);
	  		qString = strQueryString.split("&");
	  	}
	  } else if ($(this).attr("href")!="undefined") {
	  	
	  	var strHref = $(this).attr("href")
	  	if ( strHref.indexOf("?") > -1 ){
	    	var strQueryString = strHref.substr(strHref.indexOf("?")+1);
	  		qString = strQueryString.split("&");
	  	}
	  } else {
	  	return null;
	  }
	  	
	  
	  if (qString==null) return null;
	  
	  
	  for (var i=0;i<qString.length; i++){
			if (escape(unescape(qString[i].split("=")[0])) == strParamName){
				returnVal.push(qString[i].split("=")[1]);
			}
			
	  }
	  
	  
	  if (returnVal.length==0) return null;
	  else if (returnVal.length==1) return returnVal[0];
	  else return returnVal;
	}
});



//URL Paramater for OpDeHoogteBlijven
function OpDeHoogteBlijven_init(){
	
	var email = $(document).getUrlParam("email");
	var contactnummer = $(document).getUrlParam("contactnr");
	//var contact = $(document).getUrlParam("contact");
	var campaignid = $(campaignid).getUrlParam("campaignid");	
	//alert(email);
	$("#dnn_ctr2825_XModFeedback_Info").hide();
	$(".ohbcampaignid").hide();
	$(".ohbcontact").hide();
	$(".ohbcontactnr").hide();

	$('.ohbemail').val(email);
	$('.ohbcontactnr').val(contactnummer);
	//$('.ohbcontact').val(contact);
	$('.ohbcampaignid').val(campaignid);
}



//JQUeryUI
//Accordion
function accordion_init(){

		//$('#accordion').accordion({ header: '#accordion_head' });
		$("#accordion").accordion(
			{
				autoHeight: false,
				collapsible: true,
				active: false,
				//icons: false,
				icons: { 'header': '', 'headerSelected': '' }
			}
		);
}
//Ajax Reference Dialogs
function ajaxReferenceDialog_init()
{
    var linkIndex = 0;
	var dialogTitle = '';
	var ReferencePDFIcon = $('<img />').attr({
		src: "/images/PDF_Office_doc_trans.png",
		id: "referencePDFicon"	}	);
    var arrayReferenceDialogLinks = [];
    arrayReferenceDialogLinks = $.makeArray($('.ajaxReferenceDialogLink').get());
	function clearDialog() 
		{ 
			$('#reflink > *').remove();
			$('#projectdesc > *').remove();
			$('#bfproducts > *').remove();
			$('#sysintproducts > *').remove();
			$('#klantlogo > *').remove();
			$("#referencepdfimagelink").unbind("click");
			$('#referencepdfimagelink > *').remove();
			$('#klantlogo > *').remove();
			$('#klantlogo').prepend(preloaderImage);
            $('.ajaxReferenceDialog').dialog( 'close' );
			dialogTitle = '';
		};
		$('.ajaxReferenceDialog').dialog(
					{
		                autoOpen: false,
		               	bgiframe: true,
		                width: 800,
		                title: dialogTitle,
		                modal: true,
						resizable: false,
			            buttons: 
						{
		                'Sluit': function(){
							clearDialog()
						}
		                }
        });
	   	$.each(arrayReferenceDialogLinks, function(linkIndex) 
        {
            var thisDialogID = $(this).attr('recordID');
			var ProjectDesc;
			var BFProducts = [];
			var SysIntProducts = [];
			var PDFLinkRef = [];
			var HTMLLinkRef;
			var KlantLogoSource = [];
			var KlantLogo;
			var BFref = [];

			
            //var thisDialogTitle = $(this).attr('title');
            $(this).click(function() 
            {
				clearDialog();
				// Insert preloaded image into the DOM tree
				$('#klantlogo').prepend(preloaderImage);
				
                ApplicationService.getReferenceDataByRecordID(1, 19, thisDialogID, OnGetReferenceDataComplete, OnError);
                function OnGetReferenceDataComplete(result) 
                {
					//$('.ajaxReferenceDialog').remove(preloaderImage);
					
                    var customerItems = result[0];
                    ProjectDesc = customerItems.ProjectDesc;
					if (customerItems.BFProducts == null)
					{
						BFProducts = [""];
					}
					else
					{
						BFProducts = customerItems.BFProducts;					
					}
                    if (customerItems.SysIntProducts == null)
					{
						SysIntProducts = [""];
					}
					else
					{
							SysIntProducts = customerItems.SysIntProducts;					
					}
                    
				
					if (customerItems.KlantLogo == null)
					{
						KlantLogo = $('<img />').attr('src', '/images/spacer.gif');
					}
					else
					{
						KlantLogoSource = customerItems.KlantLogo;
						KlantLogo = $('<img />').attr('src', KlantLogoSource[1]);						
					}
					if (customerItems.PDFLinkRef == null)
					{
						BFref = ["nee", "0"];
						PDFLinkRef = ['nopdf'];
					}
					else
					{
							PDFLinkRef = customerItems.PDFLinkRef;
							if (customerItems.BFref != null)
							{
								BFref	= customerItems.BFref;
							}
							else
							{
								BFref = ["nee", "0"];					
							}
					}
					
					HTMLLinkRef = customerItems.HTMLLinkRef;
					dialogTitle = customerItems.Project;

					
					//Google
					// Google Analytics
					pageTracker._trackPageview("/referenties/"+customerItems.KlantNaam );
					
					//Plaatsen teksten in placeholders
					$('#projectdesc').html('<p>'+ProjectDesc+'<\/p>');
					if (BFProducts != null)
					{
					$('#bfproducts').html('<p style="font-size:9px"><strong>BRAIN FORCE producten: <\/strong>'+BFProducts+'<\/p>');
					}
					if (SysIntProducts != null & SysIntProducts[0] != 'Geen') {
						$('#sysintproducts').html('<p style="font-size:9px"><strong>System Integrator voor: <\/strong>' + SysIntProducts + '<\/p>');
					}
					$('#klantlogo > *').remove();
					$('#klantlogo').prepend(KlantLogo);
					$('#reflink').html('<a href="/Default.aspx?tabid='+HTMLLinkRef+'">Lees de volledige case study....<\/a>');
					if (BFref[1] == '1')
					{
						$('#referencepdfimagelink').html('<div style="padding-bottom:2px;"><a style="font-size:9px;" href="'+PDFLinkRef[1]+'" target="_blank">Download PDF<\/a></div>');		
						$('#referencepdfimagelink').prepend(ReferencePDFIcon)
						{
							$('#referencepdfimagelink').hover
									(
									function () 
												{
											      $(this).css(
												  {
												  	
													"cursor":"pointer"
													
												  
												  });
											    },
									function () 
												{
											       $(this).css(
												    {
												  	
													"cursor":"default"
													
												  
												  });
											    }
									);
							$('#referencepdfimagelink').click(function()
							{
								window.open(PDFLinkRef[1]);
								return false;
							});
							
						}	
					
					}
					$('.ajaxReferenceDialog').dialog('option', 'title', dialogTitle);
					$('.ajaxReferenceDialog').dialog('open');
					
					
                }
               
				});
				
			
                
				
				
				function OnError(result) 
               	{
	                alert(result.get_message());                
                } 
				
   });
   		
}
function ajaxNewsDialog_init()
{
    //$('.ajaxdialog').hide();
	var NewsPDFIcon = $('<img />').attr({
		src: "/images/PDF_Office_doc_trans.png",
		id: "NewsPDFicon"	}	);
    var linkIndex = 0;
	var dialogTitle = '';
    var arrayNewsDialogLinks = [];
	var ajaxNewsDialogVideoPlayer;
	var ajaxNewsDialogVideoPlayerNewState;
	arrayNewsDialogLinks = $.makeArray($('.ajaxNewsDialogLink').get());
	function clearDialog() 
		{ 
		    if (ajaxNewsDialogVideoPlayer != null)
			{
				function dummyTimeout(){return false;}
				//ajaxNewsDialogVideoPlayer.sendEvent('STOP');
				ajaxNewsDialogVideoPlayer = null;
				setTimeout(dummyTimeout,300);
				 
				
			}
			
			$('#newstitle > *').remove();
			$('#newsintro > *').remove();
			$('#newsdetails > *').remove();
			$('#newspdflink').unbind("click");
			$('#newspdflink > *').remove();
			$('#newsmediaspace > *').remove();
			
			dialogTitle = '';
			$('.ajaxNewsDialog').dialog( 'close' );
			//$('.ajaxNewsDialog').dialog('destroy')
		};
		$('.ajaxNewsDialog').dialog(
					{
						autoOpen: false,
		               	bgiframe: true,
						height: 550,
		                width: 800,
						title: dialogTitle,
		                modal: true,
						resizable: false,
						position: ['center','center'],
			            buttons: 
						{
		                'Sluit': function(){clearDialog()}
		                }
        });
	   	$.each(arrayNewsDialogLinks, function(newsLinkIndex) 
        {
            var thisDialogID = $(this).attr('recordID');
			var NewsCity;
			var RefPDFLink = [];
			var NewsTitle;
			var NewsIntro;
			var NewsDetails;
			var NewsDate;
			var LoadVideoPlayer = [];
			var VideoSourceURL;
			
			
			//var thisDialogTitle = $(this).attr('title');
            $(this).click(function() 
            {
				clearDialog();
				// Insert preloaded image into the DOM tree
				//Calling web service
                ApplicationService.getNewsDataByRecordID(1, 1, thisDialogID, OnGetNewsDataComplete, OnError);
				//On getData completed event trigger
                function OnGetNewsDataComplete(result) 
                {
					//$('.ajaxNewsDialog').remove(preloaderImage);
						
                    var newsData = result[0];
                    NewsDetails = newsData.NewsDetails;
					NewsTitle = newsData.NewsTitle;
					NewsIntro = newsData.NewsIntro;
					NewsCity = newsData.NewsCity;
					NewsDate = newsData.NewsDate;
					VideoSourceURL = newsData.VideoSourceURL;
					if (newsData.RefPDFLink == null || newsData.RefPDFLink[1] == '')
					{
						RefPDFLink = ['',''];
					}
					else
					{
							RefPDFLink = newsData.RefPDFLink;
					}
					if (newsData.LoadVideoPlayer == null)
					{
						LoadVideoPlayer = ['nee','0'];
					}
					else
					{
							LoadVideoPlayer = newsData.LoadVideoPlayer;
					}
					dialogTitle = NewsCity+", "+NewsDate;
					if (RefPDFLink[1] != "")
					{
						$('#newspdfimagelink').prepend(NewsPDFIcon)
						{
							$('#newspdflink').hover
									(
									function () 
												{
											      $(this).css(
												  {
												  	
													"cursor":"pointer"
													
												  
												  });
											    },
									function () 
												{
											       $(this).css(
												    {
												  	
													"cursor":"default"
													
												  
												  });
											    }
									);
							$('#newspdflink').click(function()
							{
								window.open(RefPDFLink[1]);
								return false;
							});
							
						}	
					
					}
					
					
					
					//Google
					// Google Analytics
					pageTracker._trackPageview("/nieuws/"+newsData.NewsTitle );
					
					
					$('#newstop').html('<div><a style="text-decoration:none;text-alignment:right;" href="#" >&nbsp;<\/a><\/div>');
					$('#newstitle').html('<h1>'+NewsTitle+'<\/h1>');
					$('#newsintro').html('<h5>'+NewsIntro+'<\/h5>');
					$('#newsdetails').html('<p>'+NewsDetails+'<\/p>');
					// loading video player
					// Silverlight must be added in to skin: <script type="text/javascript" src="/scripts/Silverlight.js"></script> 
					// the following must be added in the skin: <script type='text/javascript' src="/Portals/0/Silverlight/wmvplayer/wmvplayer.js"></script>
					// initiation videoplayer
					var cnt = document.getElementById("mediaspace");
					var src = 'http://www.brainforce.nl/Portals/0/Silverlight/wmvplayer/wmvplayer.xaml';
					var cfg = {
					file: VideoSourceURL,
					image:'',
					height:'240',
					width:'430'
					};
					
					//opening dialog
					$('.ajaxNewsDialog').dialog('option', 'title', dialogTitle);
					$('.ajaxNewsDialog').dialog('open');
					$('.ajaxNewsDialog').css('height', '550');
					$('.ajaxNewsDialog').css('vertical-align','middle');
					// adding video player
					ajaxNewsDialogVideoPlayer = new jeroenwijering.Player(cnt,src,cfg);
				
               }
                //alert(result[0].ProjectDesc);
				
				});
				function OnError(result) 
               	{
	                alert(result.get_message());                
                } 
   });
   
}

// Another Filter
/**
 * Removes duplicates in the array 'a'
 * @author Johan Känngård, http://johankanngard.net/
 */
function unique(a) {
	tmp = new Array(0);
	for(i=0;i<a.length;i++){
		if(!contains(tmp, a[i])){
			tmp.length+=1;
			tmp[tmp.length-1]=a[i];
		}
	}
	return tmp;
}
/**
 * Returns true if 's' is contained in the array 'a'
 * @author Johan Känngård, http://johankanngard.net/
 */
function contains(a, e) {
	for(j=0;j<a.length;j++)if(a[j]==e)return true;
	return false;
}
function removeItems(array, item) {
	var i = 0;
	while (i < array.length) {
		if (array[i] == item) {
			array.splice(i, 1);
		} else {
			i++;
		}
	}
	return array;
}
function filterThis_init(){
	
	// everything hinges on creating a string of class names, 
	// so i'll create a variable to hold that first
	
	var stringOfClassNames = '';
	
	// grab the class name of each list item to build that string
	// 
	$('.filterThis > li').each( function (i) 
	{
		if ($(this).attr('class') != '') {
			var thisClassString = $(this).attr('class');
			stringOfClassNames = stringOfClassNames + '*' + thisClassString;
			//debug
			//alert('this classString:'+' '+thisClassString);
		}
		else
		{
			return;
		}
	});
	//debug
	//alert('strings of class names:'+' '+stringOfClassNames);
	// now i have a space-delimited string of all class names stored
	// in the stringOfClassNames variable.	
	// Trim spaces from the ends of that string:
	
	stringOfClassNames = jQuery.trim(stringOfClassNames);
	
	// i can't really do anything with it until it's an array, so
	// convert that string to an array.
	var arrayClasses = stringOfClassNames.split('*');
	//debug
	//alert('array of classes:'+' '+arrayClasses);
	

	
	// now for the isolating the filter that is common to all.
	// must do before extracting only the unique classes
	// one way to approach: count the number of times classes occur, and
	// if any occur the same number of times as how many list items i have,
	// assume that class is common to all list items, and remove it from
	// the filter list. duplicate class on same item = problem, but 
	// i'm not thinking about that right now.
	// i've also chosen sort the pre-unique'd array
	// instead of sorting the unique'd array.  i think i have to for the count.
	
	var arrayClasses = arrayClasses.sort();
	totalNumberOfItemsToFilter = $('.filterThis > li').length;
	
	// borrowed from http://stackoverflow.com/questions/348021/counting-results-in-an-array
	// for counting up items.  do i even need this?
	
	var result = new Object();
	for (var filterClass in arrayClasses) {
		if (result[arrayClasses[filterClass]] === undefined) {
			result[arrayClasses[filterClass]] = 1;
		} else {
			result[arrayClasses[filterClass]]++;
		}
	}
	var resultsToRemoveFromFilters = new Array();
	for (var item in result) {
		if (result[item] == totalNumberOfItemsToFilter) {
			resultsToRemoveFromFilters.push(item);
		}
	}
	
	// pull out only unique values from that array.  Otherwise
	// i'll end up with duplicate filter checkboxes.
	arrayUniqueClasses = (unique(arrayClasses));
	//debug
	//alert('array of unique classes:'+' '+arrayUniqueClasses);


	// and now remove classes that appear in every result from my 'unique
	// classes' array
	for (x in resultsToRemoveFromFilters) {
		arrayUniqueClasses = removeItems(arrayUniqueClasses,resultsToRemoveFromFilters[x]);
	}
	//$('.filterThis').before('<p><strong>Classes excluded from filters because they are common to all elements:<\/strong> '+resultsToRemoveFromFilters+'<\/p>');
	// we only want to create filters if there are multiple classes. check
	// length of that array to see if it worth going forward.  I need at least
	// two, so my value has to be greater than 1.
	if (arrayUniqueClasses.length > 1) {
		// it must be worth it, because everything else is
		// within the true side of this if statement.	
		// so since we're going to have some filters, 
		// lets give them a place to live
		//$('<div class="filters"><\/div>').insertBefore('.filterThis');
		// then build the filter checkboxes based on all the class names
		$('<div class="dropdownFilter"><select id="oplossingenFilter" />').appendTo('.filters');
		$('<option  value="filterAll">Toon alle referenties<\/option>').appendTo('#oplossingenFilter');	
		$.each(arrayUniqueClasses, function(){
			if (this != '') {
				// $('<div class="filter"><input class="dynamicFilterInput" type="checkbox" checked="checked" value="' + this + '" id="filterID' + this + '" /><label for="filterID' + this + '">' + this + '<\/label><\/div>').appendTo('.filters');
				$('<option  value="' + this + '">' + this + '<\/option>').appendTo('#oplossingenFilter');	
			}
			else {
				return;
			}
		});
		// lets throw in the 'show all' checkbox for giggles
		//$('<div class="filter"><input type="checkbox" checked="checked" value="filterAll" id="filterIDall" /><label for="filterIDall">Toon alle referenties<\/label><\/div>').appendTo('.filters');
		$('</select></div>').appendTo('.filters');
		// DropDown filter
		// now lets give those filters something to do
		$('#oplossingenFilter').change(function()
		{
		var dropdownFilterVal = $('#oplossingenFilter').val();
		var dropDownFilterStringValue = '.filterThis > li[class*=' + dropdownFilterVal + ']';
		var dropDownFilterStringValueOpposite = '.filterThis > li:not([class*=' + dropdownFilterVal + '])';	
		//debug
		//alert('dropdown Filter value: '+ dropdownFilterVal + ', '+$(dropDownFilterStringValue).length);
		$(window).scrollTo('#oplossingenFilter', 1000, {axis: 'y'});
		if (dropdownFilterVal == 'filterAll') 
		{
		$('.filterThis li').show('normal');
		}
		else 
		{
			$(dropDownFilterStringValue).show('normal');
			$(dropDownFilterStringValueOpposite).hide('normal');
		}
	});	
}
};

// Filter Framework 1.0
function filterCombo_init(){  
	var filterSelectCombo = $("#filterCombo");
	var filterOplossingen = $("#filterComboOplossingen");
	filterSelectCombo.change(function(){
		$(window).scrollTo('#filterCombo', 1000, {
			axis: 'y'
		});
		var filterVal = filterSelectCombo.val();
		if (filterVal == 'Alles') {
			$('ul#filterThis li.hidden').show('normal').removeClass('hidden');
			$('ul#filterThis').show('normal').removeClass('hidden');
		}
		else {
			
			$('ul#filterThis li').filter(function (filterIndex) {
                  return $(this).attr('sector') != filterVal;
                })
            .hide('normal').addClass('hidden');

			
			$('ul#filterThis li').filter(function (filterIndex) {
                 return $(this).attr('sector') == filterVal;
                }).show('normal').removeClass('hidden');
			
		}
	});	
	
		return false;
	
}
// Document Ready Function
$(document).ready(function()
						   {
						   		BFNLStyling_init();
								OpDeHoogteBlijven_init();
							  	toggleDIV_init();
								accordion_init();
								filterCombo_init();
								filterThis_init();
								referenceFilterTabs_init();
								//ajaxNewsDialog_init();
								//ajaxReferenceDialog_init();
								
						   });