
// 'stacks' is the Stacks global object.
// All of the other Stacks related Javascript will 
// be attatched to it.
var stacks = {};


// this call to jQuery gives us access to the globaal
// jQuery object. 
// 'noConflict' removes the '$' variable.
// 'true' removes the 'jQuery' variable.
// removing these globals reduces conflicts with other 
// jQuery versions that might be running on this page.
stacks.jQuery = jQuery.noConflict(true);

// Javascript for stacks_in_1325_page9
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_1325_page9 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_1325_page9 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// notes Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.

$(document).ready(function() {



});
// End notes stack


	return stack;
})(stacks.stacks_in_1325_page9);


// Javascript for stacks_in_2318_page9
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_2318_page9 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_2318_page9 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

                    
                    
                    
                    $(document).ready(function() {
                    


// <!--([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1-->
(function($) {

  $.fn.expander = function(options) {

    var opts = $.extend({}, $.fn.expander.defaults, options);
    var delayedCollapse;
    return this.each(function() {
      var $this = $(this);
      var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
     	var cleanedTag, startTags, endTags;	
     	var allText = $this.html().replace(/<!--[^>]*>/g,"");
     	var startText = allText.slice(0, o.slicePoint).replace(/\w+$/,'');
     	startTags = startText.match(/<\w[^>]*>/g);
   	  if (startTags) {startText = allText.slice(0,o.slicePoint + startTags.join('').length).replace(/\w+$/,'');}
   	  
     	if (startText.lastIndexOf('<') > startText.lastIndexOf('>') ) {
     	  startText = startText.slice(0,startText.lastIndexOf('<'));
     	}
     	var endText = allText.slice(startText.length);    	  
     	// create necessary expand/collapse elements if they don't already exist
     	var endText = endText.replace(/^\s+|\s+$/g,"");
   	  if (!$('span.details', this).length && endText.length > 0) {
        // end script if text length isn't long enough.
       	if ( endText.replace(/\s+$/,'').split(' ').length < o.widow ) { return; }
       	// otherwise, continue...    
       	if (endText.indexOf('</') > -1) {
         	endTags = endText.match(/<(\/)?[^>]*>/g);
          for (var i=0; i < endTags.length; i++) {

            if (endTags[i].indexOf('</') > -1) {
              var startTag, startTagExists = false;
              for (var j=0; j < i; j++) {
                startTag = endTags[j].slice(0, endTags[j].indexOf(' ')).replace(/(\w)$/,'$1>');
                if (startTag == rSlash(endTags[i])) {
                  startTagExists = true;
                }
              }              
              if (!startTagExists) {
                startText = startText + endTags[i];
                var matched = false;
                for (var s=startTags.length - 1; s >= 0; s--) {
                  if (startTags[s].slice(0, startTags[s].indexOf(' ')).replace(/(\w)$/,'$1>') == rSlash(endTags[i]) 
                  && matched == false) {
                    cleanedTag = cleanedTag ? startTags[s] + cleanedTag : startTags[s];
                    matched = true;
                  }
                };
              }
            }
          }

          endText = cleanedTag && cleanedTag + endText || endText;
        }
     	  $this.html([
     		startText,
     		'<span class="read-more">',
     		o.expandPrefix,
       		'<a href="#">',
       		  o.expandText,
       		'</a>',
        '</span>',
     		'<span class="details">',
     		  endText,
     		'</span>'
     		].join('')
     	  );
      }
      var $thisDetails = $('span.details', this),
        $readMore = $('span.read-more', this);
   	  $thisDetails.hide();
 	    $readMore.find('a').click(function() {
 	      $readMore.hide();

 	      if (o.expandEffect === 'show' && !o.expandSpeed) {
          o.beforeExpand($this);
 	        $thisDetails.show();
          o.afterExpand($this);
          delayCollapse(o, $thisDetails);
 	      } else {
          o.beforeExpand($this);
 	        $thisDetails[o.expandEffect](o.expandSpeed, function() {
            $thisDetails.css({zoom: ''});
            o.afterExpand($this);
            delayCollapse(o, $thisDetails);
 	        });
 	      }
        return false;
 	    });
      if (o.userCollapse) {
        $this
        .find('span.details').append('<span class="re-collapse">' + o.userCollapsePrefix + '<a href="#">' + o.userCollapseText + '</a></span>');
        $this.find('span.re-collapse a').click(function() {

          clearTimeout(delayedCollapse);
          var $detailsCollapsed = $(this).parents('span.details');
          reCollapse($detailsCollapsed);
          o.onCollapse($this, true);
          return false;
        });
      }
    });
    function reCollapse(el) {
       el.hide()
        .prev('span.read-more').show();
    }
    function delayCollapse(option, $collapseEl) {
      if (option.collapseTimer) {
        delayedCollapse = setTimeout(function() {  
          reCollapse($collapseEl);
          option.onCollapse($collapseEl.parent(), false);
          },
          option.collapseTimer
        );
      }
    }
    function rSlash(rString) {
      return rString.replace(/\//,'');
    }    
  };
    // plugin defaults
    var length = 75;
                    // var minTrail = 10;
                    var moreText = "[Læs mere]";
                    var lessText = "[Luk]";
                    var ellipsisText = "...";
                    var dooOpenSpeed = "";
                    var dooCloseSpeed = "";
                    
                    
  $.fn.expander.defaults = {
    slicePoint:       75,  // the number of characters at which the contents will be sliced into two parts. 
                            // Note: any tag names in the HTML that appear inside the sliced element before 
                            // the slicePoint will be counted along with the text characters.
    widow:            1,  // a threshold of sorts for whether to initially hide/collapse part of the element's contents. 
                          // If after slicing the contents in two there are fewer words in the second part than 
                          // the value set by widow, we won't bother hiding/collapsing anything.
    expandText:       "[Læs mere]", // text displayed in a link instead of the hidden part of the element. 
                                      // clicking this will expand/show the hidden/collapsed text
    expandPrefix:     "... ",
    collapseTimer:    0, // number of milliseconds after text has been expanded at which to collapse the text again
    expandEffect:     'fadeIn',
    expandSpeed:      'slow',   // speed in milliseconds of the animation effect for expanding the text
    userCollapse:     true, // allow the user to re-collapse the expanded text.
    userCollapseText: "[Luk]",  // text to use for the link to re-collapse the text
    userCollapsePrefix: ' ',
    beforeExpand: function($thisEl) {},
    afterExpand: function($thisEl) {},
    onCollapse: function($thisEl, byUser) {}
  };
  
  $('#stacks_in_2318_page9 .trunky').expander();

})(jQuery);
                    
                    
                    
                    
                    
                    
                    });
                    
                    
                    
                    
                    
                    
                      
	return stack;
})(stacks.stacks_in_2318_page9);


// Javascript for stacks_in_372_page9
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_372_page9 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_372_page9 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// TopBox is designed and developed by Will Woodgate

var $tb = jQuery.noConflict();
$tb(document).ready(function(){

	
// Append TopBox and window shade onto the page body tag
$tb('#topBoxContentstacks_in_372_page9').css({display: 'block'});
$tb('body').append('<div id="topBoxstacks_in_372_page9" class="topBox"></div><div id="shadestacks_in_372_page9"></div>');


// Move Stack content up into the TopBox and block display the hidden content
$tb('#topBoxContentstacks_in_372_page9').appendTo('#topBoxstacks_in_372_page9');

// Trigger TopBox when user clicks on a link with matching REL tag and prevent anchor jump
$tb('[class=topbox1]').click(function (e) {
		e.preventDefault();

// Fetches the screen height and width to calculate shade size
var shadeHeight = $tb(document).height();  
var shadeWidth = $tb(window).width();

// Centers the TopBox horizontally, based on screen size
var topboxHori = $tb('#topBoxstacks_in_372_page9');
topboxHori.css({left: '50%','margin-left': 0 - (topboxHori.width() / 2)
});

// Centers the TopBox vertically, based on screen size
var topboxVert = $tb('#topBoxstacks_in_372_page9');
topboxVert.css({top: '50%','margin-top': 0 - (topboxVert.height() / 2)
});
      
//Set height and width of shade to fill up the whole screen
$tb('#shadestacks_in_372_page9').css({'width':shadeWidth,'height':shadeHeight,'opacity':.85});

// Fade in window shade and TopBox on click and set fade speed
$tb('#shadestacks_in_372_page9, #topBoxstacks_in_372_page9').fadeIn(800);

// If the iFrame module is enabled, append generated iFrame to the iFrame container. Otherwise this line is commented out
//$tb('#iframeModulestacks_in_372_page9').append('<iframe id="generatediFramestacks_in_372_page9" src="http://www.bbc.co.uk/">Your web browser does not support iframes.</iframe>');

});


// Fade out window shade, TopBox by clicking on window shade  
$tb('#shadestacks_in_372_page9').click(function(){
$tb('#shadestacks_in_372_page9, #topBoxstacks_in_372_page9').fadeOut(800);
// If enabled, terminate the iFrame module also. Otherwise this line is commented out
//$tb('#generatediFramestacks_in_372_page9').remove();
})

// Fade out window shade and TopBox by clicking on a backwards link  
$tb('#topBoxstacks_in_372_page9 a').click(function(){
$tb('#shadestacks_in_372_page9, #topBoxstacks_in_372_page9').fadeOut(800);
// If enabled, terminate the iFrame module also. Otherwise this line is commented out
//$tb('#generatediFramestacks_in_372_page9').remove();
})

// Fade out window shade and TopBox by clicking on a forwards link  
$tb('#topBoxForwardsstacks_in_372_page9').click(function(){
$tb('#shadestacks_in_372_page9, #topBoxstacks_in_372_page9').fadeOut(800);
// If enabled, terminate the iFrame module also. Otherwise this line is commented out
//$tb('#generatediFramestacks_in_372_page9').remove();
})

// Fade out window shade and TopBox by clicking on close button  
$tb('.topBoxClose').click(function(){
$tb('#shadestacks_in_372_page9, #topBoxstacks_in_372_page9').fadeOut(800);
// If enabled, terminate the iFrame module also. Otherwise this line is commented out
//$tb('#generatediFramestacks_in_372_page9').remove();
})

// Fade out window shade and TopBox using keyboard ESC key
$tb(document).keydown( function( e ) { 
   if( e.which == 27) {
     $tb('#shadestacks_in_372_page9, #topBoxstacks_in_372_page9').fadeOut(800);
     // If enabled, terminate the iFrame module also. Otherwise this line is commented out
     //$tb('#generatediFramestacks_in_372_page9').remove();
   } 
 }); 
 
 // If an iOS device is detected, change TopBox position to absolute and scroll page to the top. 
 var deviceAgent = navigator.userAgent.toLowerCase();
 	var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
 	if (agentID) {
 	$tb('[class=topbox1]').each(function() { 
 		$tb('#topBoxstacks_in_372_page9').css({position: 'absolute'});
 		$tb(this).click(function() { 
 			setTimeout(scrollTo, 0, 0, 1); 
 			}); 
 		}); 
 	}

});

// Recalculate the window shade size when the window is resized.
$tb(window).resize(function() {

	//Fetches the screen height and width to calculate shade size
	var shadeHeight = $tb(document).height();  
	var shadeWidth = $tb(window).width();

    $tb('#shadestacks_in_372_page9').css({'width':shadeWidth,'height':shadeHeight,'opacity':.85});
});











	








/*

var $tb = jQuery.noConflict();
$tb(document).ready(function(){

//Scroll page up on iOS to bring TopBox into view
if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPad/i))) { 
$tb('[rel=basicstyledtext]').each(function() { 
	$tb(this).click(function() { 
		setTimeout(scrollTo, 0, 0, 1); 
		}); 
	}); 
}

*/
	return stack;
})(stacks.stacks_in_372_page9);


eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1(2 0===\'3\'){4 0=5}',6,6,'cosculture_dojoIsLoaded|if|typeof|undefined|var|false'.split('|'),0,{}));

writeDocs_stacks_in_1303_page9();
initDojo_stacks_in_1303_page9();

function writeDocs_stacks_in_1303_page9() {
	var widgetID = "stacks_in_1303_page9";
	var contentBackground = "";
	var titleFontColor = "#FFFFFF";
	var titleBGColor = "#CC0000";
	var titleHoverBGColor = "#000000";
	var borderColor = "#BFBFBF";
	var themeId = "tundra";
	var useDefaultBGColor = 0;
	var useDefaultHoverColor = 0;
	var useDefaultBorderColor = 1;
	switch (1) {
		case 1: 
			themeId = "tundra";
			break;
		case 2:
			themeId = "soria";
			break;
		case 3:
			themeId = "nihilo";
			break;
		case 4:
			themeId = "claro";
			break;
		default: 
			themeId = "tundra";
	}
	var themeURL = "http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dijit/themes/" + themeId + "/" + themeId + ".css" ;
	
	eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.1("<n"+"k t=\\"u\\" w=\\""+g+"\\"></h"+"i>");2.1("<0 7=\\"3/8\\" 4=\\"5\\">#"+6+" .y {a: "+j+";} </0>");9(!m){2.1("<0 7=\\"3/8\\" 4=\\"5\\">#"+6+" .c {b: "+o+";} </0>")}9(!p){2.1("<0 7=\\"3/8\\" 4=\\"5\\">#"+6+" .q {b: "+r+";} </0>")}9(!s){2.1("<0 7=\\"3/8\\" 4=\\"5\\">#"+6+" .c {d-a: "+e+";} </0>");2.1("<0 7=\\"3/8\\" 4=\\"5\\">#"+6+" .v {d-a: "+e+";} </0>")}9(f.x){2.1("<0 7=\\"3/8\\" 4=\\"5\\">#"+6+" .l {b: "+f+";} </0>")}',35,35,'style|write|document|text|media|screen|widgetID|type|css|if|color|background|dijitTitlePaneTitle|border|borderColor|contentBackground|themeURL|li|nk|titleFontColor||dijitTitlePaneContentInner|useDefaultBGColor|lin|titleBGColor|useDefaultHoverColor|dijitTitlePaneTitleHover|titleHoverBGColor|useDefaultBorderColor|rel|stylesheet|dijitTitlePaneContentOuter|href|length|dijitTitlePaneTextNode'.split('|'),0,{}));
}

function initDojo_stacks_in_1303_page9() {	
	var libraryURL = "http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js";
	var widgetID = "stacks_in_1303_page9";
	var thisFunction = "initDojo_stacks_in_1303_page9()";
	var themeId = "tundra";
	switch (1) {
		case 1: 
			themeId = "tundra";
			break;
		case 2:
			themeId = "soria";
			break;
		case 3:
			themeId = "nihilo";
			break;
		case 4:
			themeId = "claro";
			break;
		default: 
			themeId = "tundra";
	}
	
	eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1(m 2===\'E\'){1(!a){a=d;0.D("<8"+"9 C=\\"v/f\\" o=\\""+g+"\\" t-2-h=\\"i: j, k: d\\"></8"+"9>")}l(F,n)}5{2.p("q.r");2.s(c(){2.u(b,w);2.x("#"+b+" .y").z("A",c(e){1(B.3){1(0.3().4){0.3().4()}5 1(0.3().7){0.3().7()}}5 1(0.6){0.6.4()}})})}',42,42,'document|if|dojo|getSelection|empty|else|selection|removeAllRanges|scr|ipt|cosculture_dojoIsLoaded|widgetID|function|true||javascript|libraryURL|config|isDebug|false|parseOnLoad|setTimeout|typeof|50|src|require|dijit|TitlePane|addOnLoad|data|addClass|text|themeId|query|dijitTitlePaneTitleFocus|connect|onclick|window|type|write|undefined|thisFunction'.split('|'),0,{}));
}

