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

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

// 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_386_page13 = (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() {

// COOKIE FUNCTIONS
function setCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires ;
}

function getCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function deleteCookie(name) {
    setCookie(name,"");
}



// GET THE FOLDER FROM THE URL 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 = ""};



// CUSTOM STACK SCRIPT

// check the cookie
var cooky = getCookie('stacks_in_386_page13roar');


// start the good stuff if there is no valid cookie
if (cooky != "stacks_in_386_page13roar"){

if(!$(".stacks_in_386_page13icon").find("img").attr("src")){
$(".stacks_in_386_page13icon").html('<img width="50" height="50" src="files/roar_files/alert.png" />');
}


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

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

$(".stacks_in_386_page13wrapper").css({
"display":"none",
"position":"fixed",
"top": "30px",
"right":"40px",
"z-index":"1000001"
});

if("right" == "center"){
var stacks_in_386_page13negleftmargin = 300 / 2;
var stacks_in_386_page13negtopmargin = $(".stacks_in_386_page13wrapper").height() / 2;

$(".stacks_in_386_page13wrapper").css({
"display":"none",
"position":"fixed",
"top":"50%",
"left":"50%",
"marginTop": -stacks_in_386_page13negtopmargin,
"marginLeft": -stacks_in_386_page13negleftmargin,
"z-index":"1000001"
});
}

$(".stacks_in_386_page13wrapper a").css({
"color":"#FFFFFF",
"textDecoration":"underline"
});

$(".stacks_in_386_page13wrapper a:hover").css({
"color":"#FFFFFF",
"textDecoration":"underline"
});

$(".stacks_in_386_page13wrapper a:visited").css({
"color":"#FFFFFF",
"textDecoration":"underline"
});



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

if(itsIEnine){
	$(".stacks_in_386_page13wrapper").css({
    "background" : "#333333"
    });
}
else{
    $(".stacks_in_386_page13wrapper").css({
    "-webkit-border-radius" : "10px",
    "-moz-border-radius" : "10px",
    "border-radius" : "10px",
    "behavior":"url(" + yourfolder + "files/chauffeur_files/RBPIE.htc)" 
    });
}



// LOAD THE ROARBOX FUNCTION
if("scroll" == "scroll"){
$(window).scroll(function() {
    if ($(this).scrollTop() > topquarter) {
        $(".stacks_in_386_page13wrapper").fadeIn();
    }
});
}else if("scroll" == "timed"){
$(".stacks_in_386_page13wrapper").delay("3" * 1000).queue(function(){ 
  $(".stacks_in_386_page13wrapper").fadeIn();
  $(this).dequeue(); 
});
}else{
	$(window).load(
    function() {
        $(".stacks_in_386_page13wrapper").fadeIn();
    }
);
}




// X BUTTON CLICK FUNCTION
 $('.stacks_in_386_page13thex').click(function(){
 
  $('.stacks_in_386_page13wrapper').fadeOut( function() { $(this).remove(); });

 
 });

} // end cookie check


deleteCookie('stacks_in_386_page13roar');


});





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


// Javascript for stacks_in_408_page13
// ---------------------------------------------------------------------

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

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

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
function setCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires ;
}

function getCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function deleteCookie(name) {
    setCookie(name,"");
}


$(document).ready(function() {



// Get lz cookie
var cooky = getCookie('doo_lz_cookie_set');

 // Create the new lz cookie and store it for 1 day
deleteCookie('doo_lz_cookie_set');

$("#stacks_in_408_page13").css("margin" , 0);
var orgonal = $("#stacks_in_408_page13");
var slidedelay = (3000) ;
var slidespeed = (2000) ;

var position = $("#stacks_in_408_page13").offset();

if (cooky == "lzcookyset"){

}

if (cooky != "lzcookyset"){
  
   
$("<div/>", {
  "class": "doosuperoverlay"
})
.prependTo("body")
.delay(2000)
.fadeOut(2000);


var orgStackWidth = $("#stacks_in_408_page13").width();
var tempClone = $("#stacks_in_408_page13").clone();
$(tempClone).css({
"position" : "relative",
"width" : orgStackWidth + "px",
"text-align" : "left"
});

$(tempClone).fadeIn(1000).appendTo(".doosuperoverlay").css(position)
.delay(2000)
.fadeOut(2000);
  // showstack once
var dooremoveoverlaytimer = 2000 + 2000 + 500;
setTimeout(function(){ $('.doosuperoverlay').remove(); }, dooremoveoverlaytimer);

}  // end if cookie exists

;

 
$('.lzeffect').remove();



if("" != ""){
var doodelaylz = slidedelay + slidespeed + 1000 + 2000 + 2000;
setTimeout(function(){ $("#stacks_in_408_page13").remove(); }, doodelaylz + 1000);
}

});


	return stack;
})(stacks.stacks_in_408_page13);



