/*
	Asktek scriptfil 
*/




/*
 * Clear Default Text: functions for clearing and replacing default text in
    "input" elements.
***** jQuery *****
    by Øystein Kjosavik, http://www.asktek.no/
 */
 
jQuery(document).ready(function($) {
		$('.cleardefault').each(function() {
			var default_value = this.value;
			$(this).focus(function() {
				if(this.value == default_value) {
					this.value = '';
				}
			});
			$(this).blur(function() {
				if(this.value == '') {
					this.value = default_value;
				}
			});
		});
	});
	
jQuery(document).ready(function($)
	{
	//add forside top
	$('.twidget ul:not(.children) li:first').before('<li><a href="/">Forside</a></li>');
	//hide child page
	$('.twidget ul li.page_item ul').hide(); 
	//when navigate to a child page show all pages
	$('.twidget ul li.current_page_item').parent("ul").show();
	//show page list when toggle
	$('.twidget ul li.active ul').show();
	//show cerrent page's child page
	$('.twidget ul li.current_page_item ul').show();
 
$('.twidget ul li').click(function() { 
	$(this).addClass("active");
		$(this).children('ul li').slideToggle('slow'); 
	});
	
});

jQuery(document).ready(function($) {
 $('li').each(function() {
  if ($(this).children('ul').length > 0) 
    $(this).children(':first').addClass("down");
  });
});



