function initNavigation(){
	// Get top level URL because of framebased embedded applications
	var path = window.top.location.pathname.substring(1);	
	var selected_item = jQuery("#menu a[href$='" + path + "']");	
	var cookieName = jQuery(".l0 a:first").attr("href");	
	var prevMenuRoot = jQuery.cookie(cookieName);	
	// If selected_item appears only once in navigation
	if (jQuery(selected_item).size()==1)
	{		
		// Set class selected for the current page in the menu		
		jQuery(selected_item).addClass("selected");		
	}
	
	// If selected_item appears more than once in navigation 
	if (jQuery(selected_item).size()>1)					    		
	{		
		var found = false;
		// Set all items selected in the next step we remove the ones that are not correct
		jQuery(selected_item).addClass("selected");
		// the href attr of the parent l1 item represents the menuRoot
		jQuery(".l1:has(a.selected)").each(function(){
			// if the  menuRoot of the selected page does not match the prevMenuRoot remove class selected again
			if (jQuery(">a", this).attr("href") != prevMenuRoot) {
				jQuery("a.selected", this).removeClass("selected");
			}else{
				// we need to know if we found a correctly selected item
				found = true;
			}
		});
		//If there none found in the cookie select the first		
		if (!found) jQuery(selected_item).eq(0).addClass("selected");		
	}
	//selected_item not found looking for a hidden match
	if (jQuery(selected_item).size()==0)				    			
	{		
		jQuery(".has_hidden").each(function(){
			//split the id into seperate wild cards and check if they match the current location
			var wildcards= jQuery(this).attr("id").split(";");
			var found = false;
			jQuery.each(wildcards, function(intIndex, objValue ){
				if(path.indexOf("/" + objValue)!=-1){
					found = true;
				}
			});
			//Set the menu_item that has an id that matches the current location to selected
			if (found)	{
				jQuery(this).children("a").addClass("selected").addClass("child");				
			}			
		});
		
	}
	// if the page is not matched we add it as hidden child of the webpage homepage
	if (jQuery("#menu a.selected").size()== 0){
		jQuery(".l0 a:first").addClass("selected").addClass("child");
	}
	//Format menu 
	jQuery(".is_parent>a").addClass("closed");              // Set is_parent items to closed  
  	jQuery(".l1 .item_group").css({display: "none"});       // Hide all item_groups beneath l1 (that is l2 and l3 items)
	jQuery(".l1:has(a.selected)>.item_group:has(.l2)").slideToggle(300); // Open l2 item_group if any descendents are selected		
	//Set parent l item of selected hidden item to bold
	jQuery(".hidden:has(a.selected)").parent().parent().children("a").css("font-weight", "bold"); 	
	jQuery(".l1:has(a.selected)>a").removeClass("closed");		
	//Set session cookie with menuRoot value
	var menuRoot = jQuery(".l1:has(a.selected)>a").attr("href");
	jQuery.cookie(cookieName, menuRoot);	
	// Write a breadcrumb
	// call to recursive function writeLink, pass parent of selected item to parse
	var strLink = writeLink(jQuery("#menu a.selected").parent());	
	//Check if current page is embedded application if so we have to write the breadcrumb to top_navigation frame 
	if (parent != self){
		// delay load of the breadcrumb otherwise frame based page won't show breadcrumbs
		setTimeout(function(){
			jQuery("#breadcrumb", window.parent.frames.top_navigation.document).html(strLink);
		}, 50);			
	}else{	
		jQuery("#breadcrumb").html(strLink);
	}
	
}
function writeLink(divObject){	
	var strLink = "";
	// as long as the parsed div is not the l0 menu_item, we also want to parse the parent menu item 
	// .parent().parent() is needed because current item is in nested <div class=item_group> from parent	
	if (jQuery(divObject).attr("class")!='l0'){			
		strLink = writeLink(jQuery(divObject).parent().parent());
	}
	var strText = jQuery(">a", divObject).text();		
	if (jQuery(">a", divObject).attr("class") == "selected"){
			// Change Requested by Steving Treurniet not to show hidden items in breadcrumb 
			// If statement added
			if (jQuery(divObject).attr("class") != "hidden"){
				strLink +="&nbsp;&nbsp;" + strText;
			}
	} else {
		var strHref = jQuery(">a", divObject).attr("href");		
		strLink += "<a href='" + strHref + "'>" + strText + "</a>>";
		// if the currently selected menu_item has selected child link the page was matched using a wildcard
		// Change requested by Stevin Treurniet not show hidden items or items match by wildcard or items not in navigation
			//if (jQuery(">a", divObject).attr("class") == "selected child"){	
				// if we have a page based on frames we want the title of the main frame
			//	if (parent != self){
			//		strLink +="&nbsp;&nbsp;" + window.parent.parent.document.title;
			//	}else{
			//		strLink +="&nbsp;&nbsp;" + document.title;		
			//	}		
		//} 
	}
	return strLink;
}