
// '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_329_page0
// ---------------------------------------------------------------------

// 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_329_page0 = {};

// 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_329_page0 = (function(stack) {

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

$(document).ready(function() {

var totalbulletproitems = 2 - 1;
var totalcontracteditems = 2 - 1;

if (totalbulletproitems <= totalcontracteditems){$("#stacks_in_329_page0moreorless").hide();}

$(".stacks_in_329_page0thelist:gt(" + totalcontracteditems + ")").hide();

$("#stacks_in_329_page0moreorless a").click(function() {
if ($(this).text() == "Show More"){
	$(this).text("Show Less");
	$(".stacks_in_329_page0thelist").slideDown("slow");
}
else {
	$(this).text("Show More");
	$(".stacks_in_329_page0thelist:gt(" + totalcontracteditems + ")").slideUp("slow");
}
		
});



});
// End bullet pro stack


	return stack;
})(stacks.stacks_in_329_page0);


// Javascript for stacks_in_324_page0
// ---------------------------------------------------------------------

// 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_324_page0 = {};

// 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_324_page0 = (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_324_page0').css({display: 'block'});
$tb('body').append('<div id="topBoxstacks_in_324_page0" class="topBox"></div><div id="shadestacks_in_324_page0"></div>');


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

// 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_324_page0');
topboxHori.css({left: '50%','margin-left': 0 - (topboxHori.width() / 2)
});

// Centers the TopBox vertically, based on screen size
var topboxVert = $tb('#topBoxstacks_in_324_page0');
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_324_page0').css({'width':shadeWidth,'height':shadeHeight,'opacity':.75});

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

// If the iFrame module is enabled, append generated iFrame to the iFrame container. Otherwise this line is commented out
//$tb('#iframeModulestacks_in_324_page0').append('<iframe id="generatediFramestacks_in_324_page0" 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_324_page0').click(function(){
$tb('#shadestacks_in_324_page0, #topBoxstacks_in_324_page0').fadeOut(800);
// If enabled, terminate the iFrame module also. Otherwise this line is commented out
//$tb('#generatediFramestacks_in_324_page0').remove();
})

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

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

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

// Fade out window shade and TopBox using keyboard ESC key
$tb(document).keydown( function( e ) { 
   if( e.which == 27) {
     $tb('#shadestacks_in_324_page0, #topBoxstacks_in_324_page0').fadeOut(800);
     // If enabled, terminate the iFrame module also. Otherwise this line is commented out
     //$tb('#generatediFramestacks_in_324_page0').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_324_page0').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_324_page0').css({'width':shadeWidth,'height':shadeHeight,'opacity':.75});
});











	








/*

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_324_page0);


// Javascript for stacks_in_336_page0
// ---------------------------------------------------------------------

// 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_336_page0 = {};

// 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_336_page0 = (function(stack) {

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

// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// Chauffeur STACK BY http://www.doobox.co.uk XXXXXXX
// COPYRIGHT@2010 MR JG SIMPSON, TRADING AS DOOBOX
// ALL RIGHTS RESERVED XXXXXXXXXXXXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx




// DOCUMENT READY FUNCTIONS
$(document).ready(function() {


jQuery.url=function()
{var segments={};var parsed={};var options={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var parseUri=function()
{str=decodeURI(options.url);var m=options.parser[options.strictMode?"strict":"loose"].exec(str);var uri={};var i=14;while(i--){uri[options.key[i]]=m[i]||"";}
uri[options.q.name]={};uri[options.key[12]].replace(options.q.parser,function($0,$1,$2){if($1){uri[options.q.name][$1]=$2;}});return uri;};var key=function(key)
{if(!parsed.length)
{setUp();}
if(key=="base")
{if(parsed.port!==null&&parsed.port!=="")
{return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";}
else
{return parsed.protocol+"://"+parsed.host+"/";}}
return(parsed[key]==="")?null:parsed[key];};var param=function(item)
{if(!parsed.length)
{setUp();}
return(parsed.queryKey[item]===null)?null:parsed.queryKey[item];};var setUp=function()
{parsed=parseUri();getSegments();};var getSegments=function()
{var p=parsed.path;segments=[];segments=parsed.path.length==1?{}:(p.charAt(p.length-1)=="/"?p.substring(1,p.length-1):path=p.substring(1)).split("/");};return{setMode:function(mode)
{strictMode=mode=="strict"?true:false;return this;},setUrl:function(newUri)
{options.url=newUri===undefined?window.location:newUri;setUp();return this;},segment:function(pos)
{if(!parsed.length)
{setUp();}
if(pos===undefined)
{return segments.length;}
return(segments[pos]===""||segments[pos]===undefined)?null:segments[pos];},attr:key,param:param};}();

var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};




var h = $("body").height();
var topquarter = h / 4;

var thebutton = $(".stacks_in_336_page0wrapper").clone();
$(".stacks_in_336_page0wrapper").remove();
$(thebutton).prependTo("body");

$(".stacks_in_336_page0wrapper").css({
"display":"none",
"position":"fixed",
"bottom":"20px",
"right":"30px",
"z-index":"1000001"
});



var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;

if(itsIEnine){
	$(".stacks_in_336_page0wrapper .stacks_in_336_page0bulter").css({
    "background" : "#B3B3B3",
    "-webkit-border-radius" : "27px",
    "-moz-border-radius" : "27px",
    "border-radius" : "27px"
    });
}
else{
    $(".stacks_in_336_page0wrapper .stacks_in_336_page0bulter").css({
    "-webkit-border-radius" : "26px",
    "-moz-border-radius" : "26px",
    "border-radius" : "26px",
    "behavior":"url(" + yourfolder + "files/chauffeur_files/RBPIE.htc)" 
    });
}




$(window).scroll(function() {
    if ($(this).scrollTop() > topquarter) {
        $(".stacks_in_336_page0wrapper").fadeIn();
    }
    else {
        $(".stacks_in_336_page0wrapper").fadeOut();
    }
});




 $('.stacks_in_336_page0wrapper').click(function(){
 
 $('html, body').animate({scrollTop:0}, 'slow');
 
 return false;
 
 });





});





// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// END DOOBOX Chauffeur STACK XXXXXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	return stack;
})(stacks.stacks_in_336_page0);



