/*
	Asktek scriptfil 
*/




/*
 * Clear Default Text: functions for clearing and replacing default text in
    "input" elements.
***** jQuery *****
    by Øystein Kjosavik, http://www.asktek.no/
 */
 
 // Clear default text from search form
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($) {

	// change background-color row 
	$("tr:even").css("background-color", "#CCCCFF");
	// wigets
	$('.widget .simpleimage').css({'background' : 'white', 'border-bottom-color' : '#fff'});
	$('.widget .simpleimage').parent().css({'border-bottom-color' : '#fff'});
	$('.widget .simpleimage').parent().css({'border-top-color' : '#fff'});
	$('.widget .simpleimage img').addClass("aligncenter");
	//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");
  });
});


