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

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

// 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_1_page34 = (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_1_page34roar');


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

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


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

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

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

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

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

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



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

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



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




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

 
 });

} // end cookie check


deleteCookie('stacks_in_1_page34roar');


});





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


// Javascript for stacks_in_269_page34
// ---------------------------------------------------------------------

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

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

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

  

  jQuery(document).ready(function($){

function findPlainTextExceptInLinks(element, substring, callback) {
    for (var childi= element.childNodes.length; childi-->0;) {
        var child= element.childNodes[childi];
        if (child.nodeType===1) {
            if (child.tagName.toLowerCase()!=='a')
                findPlainTextExceptInLinks(child, substring, callback);
        } else if (child.nodeType===3) {
            var index= child.data.length;
            while (true) {
                index= child.data.lastIndexOf(substring, index);
                if (index===-1)
                    break;
                callback.call(window, child, index)
            }
        }
    }
}

var substring= 'TeleportMe';
findPlainTextExceptInLinks(document.body, substring, function(node, index) {
    node.splitText(index+substring.length);
    var span= document.createElement('span');
    span.className = "teleportHere";
    span.appendChild(node.splitText(index));
    node.parentNode.insertBefore(span, node.nextSibling);
});


var injectionStack = $("#stacks_in_269_page34 .teleportMe").html();


$(".teleportHere").replaceWith(injectionStack);
$("#stacks_in_269_page34 .teleportMe").hide();

});
	return stack;
})(stacks.stacks_in_269_page34);



