﻿$(function(){$("#address>span:last-child").addClass("last")});var animatedcollapse={divholders:{},divgroups:{},lastactiveingroup:{},show:function(a){if(typeof a=="object"){for(var b=0;b<a.length;b++){this.showhide(a[b],"show")}}else{this.showhide(a,"show")}},hide:function(a){if(typeof a=="object"){for(var b=0;b<a.length;b++){this.showhide(a[b],"hide")}}else{this.showhide(a,"hide")}},toggle:function(a){this.showhide(a,"toggle")},addDiv:function(b,a){this.divholders[b]=({id:b,$divref:null,attrs:a});this.divholders[b].getAttr=function(d){var c=new RegExp(d+"=([^,]+)","i");return(c.test(this.attrs)&&parseInt(RegExp.$1)!=0)?RegExp.$1:null}},showhide:function(c,b){var a=this.divholders[c].$divref;if(this.divholders[c]&&a.length==1){var d=this.divgroups[a.attr("groupname")];if(a.attr("groupname")&&d.count>1&&(b=="show"||b=="toggle"&&a.css("display")=="none")){if(d.lastactivedivid&&d.lastactivedivid!=c){this.slideengine(d.lastactivedivid,"hide")}this.slideengine(c,"show");d.lastactivedivid=c}else{this.slideengine(c,b)}}},slideengine:function(d,b){var a=this.divholders[d].$divref;if(this.divholders[d]&&a.length==1){var c={height:b};if(a.attr("fade")){c.opacity=b}a.animate(c,a.attr("speed")?parseInt(a.attr("speed")):500);return false}},generatemap:function(){var b={};for(var a=0;a<arguments.length;a++){if(arguments[a][1]!=null){b[arguments[a][0]]=arguments[a][1]}}return b},init:function(){var a=this;jQuery(document).ready(function(b){var f=a.getCookie("acopendivids");var e=a.getCookie("acgroupswithpersist");if(f!=null){f=(f=="nada")?[]:f.split(",")}e=(e==null||e=="nada")?[]:e.split(",");jQuery.each(a.divholders,function(){this.$divref=b("#"+this.id);if((this.getAttr("persist")||jQuery.inArray(this.getAttr("group"),e)!=-1)&&f!=null){var g=(jQuery.inArray(this.id,f)!=-1)?"block":"none"}else{var g=this.getAttr("hide")?"none":null}this.$divref.css(a.generatemap(["height",this.getAttr("height")],["display",g]));this.$divref.attr(a.generatemap(["groupname",this.getAttr("group")],["fade",this.getAttr("fade")],["speed",this.getAttr("speed")]));if(this.getAttr("group")){var h=a.divgroups[this.getAttr("group")]||(a.divgroups[this.getAttr("group")]={});h.count=(h.count||0)+1;if(!h.lastactivedivid&&this.$divref.css("display")!="none"||g=="block"){h.lastactivedivid=this.id}this.$divref.css({display:"none"})}});jQuery.each(a.divgroups,function(){if(this.lastactivedivid){a.divholders[this.lastactivedivid].$divref.show()}});var c=b("*[rel]").filter('[@rel^="collapse-"], [@rel^="expand-"], [@rel^="toggle-"]');var d=/(collapse-)|(expand-)|(toggle-)/;c.each(function(){b(this).click(function(){var j=this.getAttribute("rel");var g=j.replace(d,"");var h=(j.indexOf("collapse-")!=-1)?"hide":(j.indexOf("expand-")!=-1)?"show":"toggle";return a.showhide(g,h)})});b(window).bind("unload",function(){a.uninit()})})},uninit:function(){var b="",a="";jQuery.each(this.divholders,function(){if(this.$divref.css("display")!="none"){b+=this.id+","}if(this.getAttr("group")&&this.getAttr("persist")){a+=this.getAttr("group")+","}});b=(b=="")?"nada":b.replace(/,$/,"");a=(a=="")?"nada":a.replace(/,$/,"");this.setCookie("acopendivids",b);this.setCookie("acgroupswithpersist",a)},getCookie:function(a){var b=new RegExp(a+"=[^;]*","i");if(document.cookie.match(b)){return document.cookie.match(b)[0].split("=")[1]}return null},setCookie:function(c,d,a){if(typeof a!="undefined"){var b=new Date();b.setDate(b.getDate()+a);document.cookie=c+"="+d+"; path=/; expires="+b.toGMTString()}else{document.cookie=c+"="+d+"; path=/"}}};currentdiv="div1";function dtoggle(a){document.getElementById(currentdiv).style.display="none";document.getElementById(a).style.display="block";document.getElementById(currentdiv+"_b").className="classoff";document.getElementById(a+"_b").className="classon";currentdiv=a}$(document).ready(function(){$("#pageid3639").after("<br clear='all'>");$("li.current #pageid3639").after("<br clear='all'>")});function NewsletterEmailSignup(){if(document.sub_form.email.value!=""&&document.sub_form.email.value!="Enter Email Address"){var a;a="sign-up-for-specials.htm?disableemailpost=1&email="+document.sub_form.email.value;document.location=a}else{alert("You must supply an email address to sign up.")}return false}function AppendQuerystringToForm(k,j,h){var d=document.location.search.substring(1);var e=d.split("&");var f={};for(i=0;i<e.length;i++){var c=e[i];var g=c.split("=");f[g[0]]=g[1]}if(typeof(f[j])!="undefined"){var a=document.getElementById(k);var b=a.childNodes[0];b.src+="&"+h+"="+f[j]}};
