jQuery(document).ready(function() { 
	
	// Get Tooltips from the component
	var tooltips = jQuery(".tooltip");
	var tooltipText = {};
	
	for(var i=0; i <= tooltips.size(); i++){ 
		var strings = tooltips.eq(i).text();
		var splits = strings.split(":");
		var nodename = splits[0];
		var tooltip = splits[1];
		tooltipText[nodename] = tooltip;
	}
	
	// Render the Tooltips
	jQuery('#subNavigation a.menuLink span').each(function(index, span) {
		//if ( == value[0])
		var nodeName = jQuery.trim(jQuery(span).text());
		var tooltip = tooltipText[nodeName];
		
		if (tooltip) {
			jQuery(span).closest('li.menuListItem').append('<div class="tt">' + tooltip + '</div>');
		}
	});
	
	// Build the Mouseover and out
	jQuery("#subNavigation li li li").live('mouseover mouseout', function(event) {
		if (event.type == 'mouseover') {
			jQuery(this).find(".tt").show();
		}
		else{
			jQuery(this).find(".tt").hide();
		}
	});
	
	// Render the Dropdown to the first menu
	
	jQuery("#bd .menuList li:first").append('<div class="secondNavi"><a href="/nanofilm_brewster_angle_microscopes">Brewster Angle Microscopes</a><a href="/nanofilm_imaging_ellipsometry">Imaging Ellipsometry</a><a href="/uv_vis_reflectometry">UV/VIS Reflectometry</a><a class="last" href="/nanofilm_accessories">Accessories</a></div>');
	
	
	
});


