
// '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_573_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_573_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_573_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;
	
/**
 * SymfoniP SimpleBox /sympleBox /symBox Core Helper Scripts for RapidWeaver Stacks
 * SimpleBox /sympleBox is copyright (c) 2010 by Ronan Cashell and Kevin Burns - SymfoniP.com
 * Version 1.1
 * Also with with integrated Cookie jQuery plugin Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * jQuery Cookie Plugin Dual licensed under the MIT and GPL licenses:
 */
jQuery.cookie=function(name,value,options){if(typeof value!="undefined"){options=options||{};if(value===null){value="";options.expires=-1}var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toUTCString)){var date;if(typeof options.expires=="number"){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires="; expires="+date.toUTCString()}var path=options.path?"; path="+(options.path):"";var domain=options.domain?"; domain="+(options.domain):"";var secure=options.secure?"; secure":"";document.cookie=[name,"=",encodeURIComponent(value),expires,path,domain,secure].join("")}else{var cookieValue=null;if(document.cookie&&document.cookie!=""){var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+"=")){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};(function($){$.fn.extend({sympleBox:function(options){var defaults={width:"",height:"",auto:null,opacity:0.8,cookie:null};var currentPop;var autoPop=false;if(typeof options=="object"){$.extend(defaults,options)}$("a.close, #symboxfade").live("click",function(){$("#symboxfade , .popup_block").fadeOut(function(){$("#symboxfade, a.close, #symClone").remove()});return false});$(document).keydown(function(e){if(e.which==27){$("a.close").click()}});return this.each(function(){var defaultOpts=new Object();$.extend(defaultOpts,defaults);var popID=$(this).attr("rel");var popHref=$(this).attr("href");var query="";if(popHref.length>2&&popHref.substr(1,1)=="?"){query=popHref.split("?")}var $this=$(this);$("#"+popID).addClass("sympleBoxPopup");if(query.length>1){var popOpts=query[1].split("&");for(key in popOpts){var opt=popOpts[key].split("=");switch(opt[0]){case"w":defaultOpts.width=opt[1];break;case"h":defaultOpts.height=opt[1];break;case"a":if($.cookie("symBoxPop")!="1"){if(!isNaN(opt[1])){defaultOpts.auto=Number(opt[1])}}break;case"c":if(!isNaN(opt[1])){defaultOpts.cookie=Number(opt[1]);if(defaultOpts.cookie<0){$.cookie("symBoxPop",null,{path:"/"})}}else{defaultOpts.cookie=1}break;case"o":if(!isNaN(opt[1])){defaultOpts.opacity=Number(opt[1])}}}}var popMargTop;var popMargLeft;var refObj=$("#"+$(this).attr("rel"));$("img",refObj).each(function(){$(this).load(function(){if(isNaN(defaultOpts.width)&&isNaN(defaultOpts.height)){if(defaultOpts.width==""||isNaN(defaultOpts.width)){defaultOpts.width=$(this).attr("width")}if(defaultOpts.height==""||isNaN(defaultOpts.height)){defaultOpts.height=refObj.height()}if(typeof defaultOpts.height=="undefined"||defaultOpts.height==""){popMargTop=(refObj.height()+80)/2}else{popMargTop=(parseInt(defaultOpts.height)+80)/2}if(typeof defaultOpts.width=="undefined"||defaultOpts.width==""){popMargLeft=(refObj.width()+80)/2}else{popMargLeft=(parseInt(defaultOpts.width)+80)/2}$(this).click(function(){var clone=$("#"+popID).clone(true);clone.attr("id","symClone");$("body").append(clone);if(typeof defaultOpts.height!="undefined"&&defaultOpts.height!=""){clone.css("height",defaultOpts.height)}clone.fadeIn().css({width:defaultOpts.width,"margin-top":-popMargTop,"margin-left":-popMargLeft}).prepend('<a href="#" class="close"><img src="index_files/symboximg/close_pop-1.png" class="btn_close" title="Close Window" alt="Close Window" /></a>');$("body").append('<div id="symboxfade"></div>');$("#symboxfade").css({filter:"alpha(opacity="+(defaultOpts.opacity*100)+")",opacity:defaultOpts.opacity}).fadeIn();return false})}})});if(defaultOpts.width==""||isNaN(defaultOpts.width)){if($.browser.msie&&parseInt($.browser.version)<=7){$("img, iframe, object, embed, video",refObj).each(function(){if($(this)[0].nodeName=="IMG"){var htmlText=$(this).parent().html();htmlText=htmlText.toLowerCase();var widthLoc=htmlText.indexOf("width");if(widthLoc<0){defaultOpts.width=""}else{defaultOpts.width=parseInt(htmlText.substr(widthLoc+6))}}else{defaultOpts.width=$(this).attr("width")}})}else{defaultOpts.width=refObj.width()}}if(defaultOpts.height==""||isNaN(defaultOpts.height)){if($.browser.msie&&parseInt($.browser.version)<=7){$("img, iframe, object, embed, video",refObj).each(function(){if($(this)[0].nodeName=="IMG"){var htmlText=$(this).parent().html();htmlText=htmlText.toLowerCase();var heightLoc=htmlText.indexOf("height");if(heightLoc<0){defaultOpts.height=""}else{defaultOpts.height=parseInt(htmlText.substr(heightLoc+7))}}else{defaultOpts.height=$(this).attr("height")}})}else{defaultOpts.height=refObj.height()}}if(typeof defaultOpts.height=="undefined"||defaultOpts.height==""){popMargTop=(refObj.height()+80)/2}else{popMargTop=(parseInt(defaultOpts.height)+80)/2}if(typeof defaultOpts.width=="undefined"||defaultOpts.width==""){popMargLeft=(refObj.width()+80)/2}else{popMargLeft=(parseInt(defaultOpts.width)+80)/2}$(this).click(function(){var clone=$("#"+popID).clone(true);clone.attr("id","symClone");$("body").append(clone);if(typeof defaultOpts.height!="undefined"&&defaultOpts.height!=""){clone.css("height",defaultOpts.height+"px")}clone.fadeIn();if(defaultOpts.width==""){defaultOpts.width=$("#"+popID).width()}clone.css({width:defaultOpts.width+"px","margin-top":-popMargTop+"px","margin-left":-popMargLeft+"px"});clone.prepend('<a href="#" class="close"><img src="index_files/symboximg/close_pop-1.png" class="btn_close" title="Close Window" alt="Close Window" /></a>');$("body").append('<div id="symboxfade"></div>');$("#symboxfade").css({filter:"alpha(opacity="+(defaultOpts.opacity*100)+")",opacity:defaultOpts.opacity}).fadeIn();return false});if(!autoPop&&typeof defaultOpts.auto!="undefined"&&defaultOpts.auto!=null){setTimeout(function(){$this.click()},parseInt(defaultOpts.auto)*1000);autoPop=true;if(!isNaN(defaultOpts.cookie)&&defaultOpts.cookie>0){$.cookie("symBoxPop","1",{expires:defaultOpts.cookie,path:"/"})}}})}})})(jQuery);$(document).ready(function(){$("a[rel^=symbox]").sympleBox({opacity:0.85})});
	return stack;
})(stacks.stacks_in_573_page0);



