$(document).ready(function () {		
	var naviBarWidth = 960;//document.getElementById("navi-bar").width;	
	var naviBarHeight = 78;//document.getElementById("navi-bar").height;	
	var naviBarX = (screen.width - naviBarWidth)/2;
	
	// Container
	//document.getElementById('container').style.width = naviBarWidth + "px";
	
	//document.getElementById('ui-layout-north').style.width = naviBarWidth + "px";
	
	// Search box	
	//document.getElementById('search').style.left = naviBarX + 164 + "px";
	//document.getElementById('search').style.top = naviBarHeight - 26 + "px";	
	document.getElementById("search").value = searchHelpText;
	
	// AutoComplete setup	
	$('input#search').autocomplete("/vaerksted/soeg/").result(function(event, item) {
		  location.href = "/vaerksted/" + item[1];
	});

	// Navigation Menu
	
	// set opacity to nill on page load
	$("ul#menu span").css("opacity","0");
	// on mouse over
	$("ul#menu span").hover(function () {
		// animate opacity to full
		$(this).stop().animate({
			opacity: 1
		}, 'fast');
	},
	// on mouse out
	function () {
		// animate opacity to nill
		$(this).stop().animate({
			opacity: 0
		}, 'slow');
	});

	});

var searchHelpText = "S\u00F8g v\u00E6rksted her...";

// Removes the help text of the search field
function searchFieldGotFocus() {	
	var e = document.getElementById("search");
	if(e.value == searchHelpText){	
		 e.setAttribute("class", "text-search-input");
		 e.setAttribute("className", "text-search-input"); // for IE which does not recognize "class"
		 e.value = "";
	}
	 return;

}
