

$(document).ready(function() {
$(function(){ $('.main-wrap').equalHeights(); });
$(function(){ $('.front-bottom-wrap').equalHeights(); });
$(function(){ $('.content-text').equalHeights(); });
$(function(){ $('.border-box').equalHeights(); });
});

$(document).ready(function() {
	if ($('.content-slideshow')) {
		$('.content-slideshow')
		.cycle({
			fx: 'fade',
			speed: 1500,
			timeout: 3500,
			pause: 1,
			pauseOnPagerHover: 1,
			pagerEvent: 'mouseover',
			pagerAnchorBuilder: function(idx, slide) {
			  return '<a href="#" class="nav-elm"></a>';
			}
		});
	}
/*	
	var index = 0, hash = window.location.hash;
	if (hash) {
		index = /\d+/.exec(hash)[0];
		index = (parseInt(index) || 1) - 1; // slides are zero-based
	}
*/
	if ($('.scrollitem')) {
		var $paneTarget = $('.content-ansatte');
		
		$('.scrollitem').each(function(index) {
			var id = '#' + $(this).context.name.replace('ansatt','ansatt_');
			$(this).click(function(){
				$paneTarget.stop().scrollTo( id , 2000 );
				
				$('.scrollitem').each(function(index) {
					$(this).removeClass('active');
					$(this).parent().parent().removeClass('arrow');
				});

				$(this).addClass('active');
				$(this).parent().parent().addClass('arrow');
			});

		});

	}

});





/***
Viser meny
*/
function getMenu (newid) {
	var newid = "menu_" + newid;

	var barn = $("#submenu").children('ul');

	for (var i = 0; i < barn.length; i++) {
		var id = barn[i].id;

		var change = document.getElementById(id);

		change.style.display='none';

		if (id == newid) {
			change.style.display='';
		}
	}
	return false;
}

function swapImg(obj, url) {
	$("#"+obj).attr("src",url);
}

jQuery(function() { jQuery("#formName")
      .focus(function() { if (jQuery(this).val() == "Navn") { jQuery(this).val(""); }})
      .blur(function(){ if (jQuery(this).val() == "") { jQuery(this).val("Navn"); }}) 
  });
jQuery(function() { jQuery("#formEmail")
      .focus(function() { if (jQuery(this).val() == "epost@epost.no") { jQuery(this).val(""); }})
      .blur(function(){ if (jQuery(this).val() == "") { jQuery(this).val("epost@epost.no"); }}) 
  });
jQuery(function() { jQuery("#formMessage")
      .focus(function() { if (jQuery(this).val() == "Beskjed") { jQuery(this).val(""); }})
      .blur(function(){ if (jQuery(this).val() == "") { jQuery(this).val("Beskjed"); }}) 
  });



