jQuery.urlParam = function(name){
	var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
	if(!results) return
	return results[1] || 0;
}



//var nk_openContent
//



function initMenu() {
	var $ = jQuery
	
	$('#mainmenu > ul.menu > li > ul.menu').each(function() {
		var s = $(this)
		var h = s.height()
		if(!jQuery.browser.msie) {
			s.height(0)
		}
		var moving = false
		s.parent().hover(function() {
			if(jQuery.browser.msie) {
				s.show(); return;
			}
		if(!moving) {
			moving = true
			//s.parent().addClass('active')
			s.animate({height: h}, {duration:400, easing:'easeOutQuad', complete:function() {
				moving = false
			}})
		}
		}, function() {
			if(jQuery.browser.msie) {
				s.hide(); return;
			}
		//s.parent().removeClass('active')
		s.animate({height: 0}, {duration:200, easing:'easeOutQuad', complete:function() {
			s.hide()
		}})
		})
		
	}) 
	$('#mainmenu ul.menu ul.menu').each(function() {
		var s = $(this)
		var isActive = s.parent().hasClass('active')
		s.parent().hover(function() {
			s.parent().addClass('active')
		}, function() {
			if(!isActive) {

				s.parent().removeClass('active')
			}
		})
	})
}


jQuery(document).ready(function() {
	var $ = jQuery
	// $('body').append('<div id="ordecker"></div>')
	
	initMenu()
	var endw = $('#highlite img').width()
	var endh = $('#highlite img').height()
	$('#highlite img').css('width','1px')
	$('#highlite img').css('height','1px')
	$('#highlite img').css('marginLeft',(endw/2)+'px')
	$('#highlite img').delay(600).animate({marginLeft:0,width:endw,height: endh}, {duration:1600, easing:'easeOutQuad', complete:function() {

	}})
	
});



