$(document).ready(function(){
	
	$("#menu ul li").hover(function() {
   		$(this).children().removeClass("meny_flik");
   		$(this).children().addClass("meny_flik_hover");
   	}, function() {
   		$(this).children().removeClass("meny_flik_hover"); 
   		$(this).children().addClass("meny_flik");
   		$(this).removeClass("meny_hover"); 
   	});
	
	bannerRotator('#bannerRotator', 700, 4000);
	
	// DESCRIPTION BOXES
	
	$("div.description").hover(
   		function() {		
	   		$('div.description-box .inner-box').html($(this).find('div.text').html());
	   		
	   		var position = $(this).position();
	   		var top = position.top + 45;	
   			var shift = ($(this).hasClass('inkludert')) ? 0 : 10;
   			var left = position.left + shift - 42;
   			
   			
   			$('div.description-box').css("top", top);
   			$('div.description-box').css("left", left);
	   		$('div.description-box.under').stop(true, true).fadeIn("fast");
   		}, function() {
			$('div.description-box.under').stop(true, true).delay(100).fadeOut("fast");
   		}
   	);
	
   			   	
});


function changeClass (elementID, elementValue) {
	var element = document.getElementById(elementID);
				
	if (element.value == 'Epost' || element.value == 'Fornavn' || element.value == 'Etternavn' || element.value == 'S\u00f8k') {
		element.setAttribute("class", "regular"); //For Most Browsers
		element.setAttribute("className", "regular"); //For IE; harmless to other browsers.
		element.value = "";
	} else if (element.value == '') {
		element.value = elementValue;
		element.setAttribute("class", "grey"); //For Most Browsers
		element.setAttribute("className", "grey"); //For IE; harmless to other browsers.
	}
}
			
