function popup(action,group_id,group_name,width, height, type)
{
 url='https://secure.boostcom.net/connect/html_popup/popup?action='+action+'&reset=true&group_id='+group_id;
settings= "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height;
window.open(url,group_name,settings);
}
$(document).ready(function(){
/*
var sURL = unescape(window.location.pathname);
$(window).bind("resize", function(){ 
if(!$.browser.msie) {  
	window.location.href = sURL;
}
});
*/

if(!$.browser.msie) {  
 var BrowserH = $(window).height()-119;
 $('#All').css({ height: BrowserH});
 var AllH = $('#Content').height()-319;
 $('.TheInnholdType').css({ height: AllH});
 $('.TheInnholdType').css({ height: AllH});
}else{
 var BrowserH = $('.MainMenySider').height();
 $('#CenterPage').css({ height: BrowserH});
}



$('.TextInnhold').children().hide(); 
$('.TextInnhold').animate({height:360});
$('.TextInnhold').children().fadeIn(); 

$('.SubText').find('a').click(function(){
  var hrefen = $(this).attr('href');
 $('.TextInnhold').children().fadeOut();
 $('.TextInnhold').animate({height:0});
  window.setTimeout(function(){document.location=hrefen;},300);
  return false;
});

$('.SubImg').click(function(){
  var hrefen = $(this).siblings('.SubText').find('a').attr('href');
// if(hrefen != '/kundeklubb.aspx')
// {
 $('.TextInnhold').children().fadeOut();
  $('.TextInnhold').animate({height:0});
  window.setTimeout(function(){document.location=hrefen;},300);
  return false;
// }
});

$('#SubLinkSelected').css({color:"#0E6765"});
$('.SubM').css('background-color','#0E6765');
$("#SubLinkSelected").parents('.SubM').css('background-color','#DCD0BA'); 
//alert($("#SubLinkSelected").parents('.SubM').children('.SubImg').find('img').attr('src'));

// Intro 

		 var LoadToppen = $("#Topp").offset().top+500;
		 var LoadLeften = $("#Topp").offset().left+300;
		 $("div#LoadingIntro").css({ position: "absolute", top: LoadToppen,left: LoadLeften});
		$('#LoadingIntro').fadeIn('slow');
		$('.introImages').hide();
		$.preload('.introImages img',{
			onFinish:finishIntro,
			placeholder:'media/9980/1.jpg',//this is the really important option
			threshold:4 //'1' is the default, how many at a time, to load.			
		});
		function finishIntro(){//hide the summary

			$('#LoadingIntro').hide();
			$('.introImages').show();
			$('.introImages').cycle({
				fx: 'fade',
				random: 0
			});
		
		}
	
//Legge til url for å få bildet til å vise i lightbox 
	$('.bImageSmall').find('a').each(function(){
		var hrefen = $(this).parent().find('.TheURL').attr('name');
		$(this).attr('href',hrefen);
	});

});