// JavaScript Document

/*NewsTABBER START*/

$(function () {                        
var tabContainers = $('div.tabs > div');                        
tabContainers.hide().filter(':first').show();                                                
$('div.tabs ul.tabNavigation a').click(function () {                                
tabContainers.hide();                                
tabContainers.filter(this.hash).show();                                


$('div.tabs ul.tabNavigation a').removeClass('selected');                                
$(this).addClass('selected');                                
return false;                        
}).filter(':first').click();                }); 

/*NewsTABBER SLUT*/



/*SlideNyheder START*/
var timeBetweenSlides = 6000;
var timeAnimation = 500;
var rowHeight = 0;

function initFrontPageNewsScroll() {
 var newslists = jQuery(".FrontPageSetup div.paragraph div").children("ul.newsList");
 newslists.each(function(){
 var ulen=jQuery(this);
 slideNewsList(ulen);
 });
}

function slideNewsList(ul) {
 ul.prepend(ul.children(":last"));
 if(rowHeight==0) rowHeight = jQuery(".FrontPageSetup div.paragraph div").height();
 ul.css("top", -rowHeight);
 setTimeout(function(){slideNewsList(ul);}, timeBetweenSlides+timeAnimation);
 ul.animate({
 top: parseInt(ul.css("top")) + rowHeight
 }, timeAnimation);
}

/*SlideNyheder SLUT*/

/*Forsideslider*/


/* slut*/



/*BilledGallery START*/
function initCo3Gallery() {
  var imageList = jQuery(".imageGallery");
  if (imageList.length > 0) {
    var settings = {
    Play: 'http://jscripts.s3.co3.dk/Co3Gallery/btn_play.png',
    Stop: 'http://jscripts.s3.co3.dk/Co3Gallery/btn_stop.png',
    BlankImage: 'http://jscripts.s3.co3.dk/Co3Gallery/x.gif',
    PlacePlayInside: true,
    PaddingBottom:26,
    ImageMarginTop: 2,
    ImageMarginBottom: 2,
    playSpeed: 4000,
    showImageList: true,
    imageListHeight: 60,
    imageInformationHeight: 15,
    imageInformationTemplate: '<a href="/admin/public/getimage.aspx?Image=[href]&Width=10000&Resolution=300&Compression=100&ForceDownload=True">Download billedet</a>',
    TempThumb: null
    };
    var co3Gallery = jQuery(".imageGallery img").CreateGallery(settings);
  }
}
/*BilledGallery SLUT*/


jQuery(document).ready(function(){
 initFrontPageNewsScroll() ;
 initCo3Gallery();
});


var url=location.href;
/*DW NewsV2 START*/
if(url.indexOf("&M=NewsV2")>-1) location.replace(url.replace("&M=NewsV2",""));
/*DW NewsV2 SLUT*/
jQuery(document).ready(function(){
 jQuery("#newsTabber a").click(function(){
  location.href=this.href.replace("&M=NewsV2","");
  return false;
 });
});


  
