/* Scroll Code
 * Copyright (c) 2005 Marty Haught, Thomas Fuchs | See http://script.aculo.us for more info --------------------- */
(function(){if(!a){var a={}}a.Slider=Class.create();a.Slider.prototype={initialize:function(e,b,c){var d=this;if(e instanceof Array){this.handles=e.collect(function(f){return $(f)})}else{this.handles=[$(e)]}this.track=$(b);this.options=c||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(f){return $(f)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(g,f){f=d.handles.length-1-f;d.setValue(parseFloat((d.options.sliderValue instanceof Array?d.options.sliderValue[f]:d.options.sliderValue)||d.range.start),f);Element.makePositioned(g);Event.observe(g,"mousedown",d.eventMouseDown)});Event.observe(this.track,"mousedown",this.eventMouseDown);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var b=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(c){Event.stopObserving(c,"mousedown",b.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(b){if(this.allowedValues){if(b>=this.allowedValues.max()){return(this.allowedValues.max())}if(b<=this.allowedValues.min()){return(this.allowedValues.min())}var d=Math.abs(this.allowedValues[0]-b);var c=this.allowedValues[0];this.allowedValues.each(function(e){var f=Math.abs(e-b);if(f<=d){c=e;d=f}});return c}if(b>this.range.end){return this.range.end}if(b<this.range.start){return this.range.start}return b},setValue:function(c,b){if(!this.active){this.activeHandleIdx=b||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}b=b||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((b>0)&&(c<this.values[b-1])){c=this.values[b-1]}if((b<(this.handles.length-1))&&(c>this.values[b+1])){c=this.values[b+1]}}c=this.getNearestValue(c);this.values[b]=c;this.value=this.values[0];this.handles[b].style[this.isVertical()?"top":"left"]=this.translateToPx(c);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(c,b){this.setValue(this.values[b||this.activeHandleIdx||0]+c,b||this.activeHandleIdx||0)},translateToPx:function(b){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(b-this.range.start))+"px"},translateToValue:function(b){return((b/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(c){var b=this.values.sortBy(Prototype.K);c=c||0;return $R(b[c],b[c+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignY)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var b=this;if(this.spans){$R(0,this.spans.length-1).each(function(c){b.setSpan(b.spans[c],b.getRange(c))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(c,b){if(this.isVertical()){c.style.top=this.translateToPx(b.start);c.style.height=this.translateToPx(b.end-b.start+this.range.start)}else{c.style.left=this.translateToPx(b.start);c.style.width=this.translateToPx(b.end-b.start+this.range.start)}},updateStyles:function(){this.handles.each(function(b){Element.removeClassName(b,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(d){if(Event.isLeftClick(d)){if(!this.disabled){this.active=true;var e=Event.element(d);var f=[Event.pointerX(d),Event.pointerY(d)];var b=e;if(b==this.track){var c=Position.cumulativeOffset(this.track);this.event=d;this.setValue(this.translateToValue((this.isVertical()?f[1]-c[1]:f[0]-c[0])-(this.handleLength/2)));var c=Position.cumulativeOffset(this.activeHandle);this.offsetX=(f[0]-c[0]);this.offsetY=(f[1]-c[1])}else{while((this.handles.indexOf(e)==-1)&&e.parentNode){e=e.parentNode}this.activeHandle=e;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var c=Position.cumulativeOffset(this.activeHandle);this.offsetX=(f[0]-c[0]);this.offsetY=(f[1]-c[1])}}Event.stop(d)}},update:function(b){if(this.active){if(!this.dragging){this.dragging=true}this.draw(b);if(navigator.appVersion.indexOf("AppleWebKit")>0){window.scrollBy(0,0)}Event.stop(b)}},draw:function(c){var d=[Event.pointerX(c),Event.pointerY(c)];var b=Position.cumulativeOffset(this.track);d[0]-=this.offsetX+b[0];d[1]-=this.offsetY+b[1];this.event=c;this.setValue(this.translateToValue(this.isVertical()?d[1]:d[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(b){if(this.active&&this.dragging){this.finishDrag(b,true);Event.stop(b)}this.active=false;this.dragging=false},finishDrag:function(b,c){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}}})();

(function(){var a=Class.create();a.ids=new Object();a.i=0;a.prototype={initialize:function(b){this.outerBox=b;this.decorate()},decorate:function(){$(this.outerBox).makePositioned();a.i=a.i+1;this.myIndex=a.i;this.innerBox=document.createElement("DIV");this.innerBox.className="scroll-innerBox";$(this.innerBox).makePositioned();this.innerBox.style.cssFloat=this.innerBox.style.styleFloat="left";this.innerBox.id="scroll-innerBox-"+a.i;this.innerBox.style.top="0px";while(this.outerBox.hasChildNodes()){this.innerBox.appendChild(this.outerBox.firstChild)}this.innerBox.style.overflow="hidden";this.outerBox.style.overflow="hidden";this.track=document.createElement("div");this.track.className="scroll-track";$(this.track).makePositioned();this.track.style.cssFloat=this.track.style.styleFloat="left";this.track.id="scroll-track-"+a.i;this.track.appendChild(document.createComment(""));this.tracktop=document.createElement("div");this.tracktop.className="scroll-track-top";$(this.tracktop).makePositioned();this.tracktop.style.cssFloat=this.tracktop.style.styleFloat="left";this.tracktop.id="scroll-track-top-"+a.i;this.tracktop.appendChild(document.createComment(""));this.trackbot=document.createElement("div");this.trackbot.className="scroll-track-bot";$(this.trackbot).makePositioned();this.trackbot.style.cssFloat=this.trackbot.style.styleFloat="left";this.trackbot.id="scroll-track-bot-"+a.i;this.trackbot.appendChild(document.createComment(""));this.handle=document.createElement("div");this.handle.className="scroll-handle-container";this.handle.id="scroll-handle-container"+a.i;this.handle_middle=document.createElement("div");this.handle_middle.className="scroll-handle";$(this.handle_middle).makePositioned();this.handle_middle.id="scroll-handle-"+a.i;this.handle_middle.appendChild(document.createComment(""));this.handletop=document.createElement("div");this.handletop.className="scroll-handle-top";$(this.handletop).makePositioned();this.handletop.id="scroll-handle-top-"+a.i;this.handletop.appendChild(document.createComment(""));this.handlebot=document.createElement("div");this.handlebot.className="scroll-handle-bot";$(this.handlebot).makePositioned();this.handlebot.id="scroll-handle-bot-"+a.i;this.handlebot.appendChild(document.createComment(""));this.track.hide();this.tracktop.hide();this.trackbot.hide();this.outerBox.appendChild(this.innerBox);this.outerBox.appendChild(this.tracktop);this.handle.appendChild(this.handletop);this.handle.appendChild(this.handle_middle);this.handle.appendChild(this.handlebot);this.track.appendChild(this.handle);this.outerBox.appendChild(this.track);this.outerBox.appendChild(this.trackbot);this.slider=new Control.Slider($(this.handle).id,$(this.track).id,{axis:"vertical",minimum:0,maximum:$(this.outerBox).clientHeight});this.slider.options.onSlide=this.slider.options.onChange=this.onChange.bind(this);setTimeout(this.resetScrollbar.bind(this,false),10);this.domMouseCB=this.MouseWheelEvent.bindAsEventListener(this,this.slider);this.mouseWheelCB=this.MouseWheelEvent.bindAsEventListener(this,this.slider);this.trackTopCB=this.tracktopEvent.bindAsEventListener(this,this.slider);this.trackBotCB=this.trackbotEvent.bindAsEventListener(this,this.slider);$(this.outerBox).observe("DOMMouseScroll",this.domMouseCB);$(this.outerBox).observe("mousewheel",this.mouseWheelCB);$(this.tracktop).observe("mousedown",this.trackTopCB);$(this.trackbot).observe("mousedown",this.trackBotCB)},release:function(){$(this.outerBox).stopObserving("DOMMouseScroll",this.domMouseCB);$(this.outerBox).stopObserving("mousewheel",this.mouseWheelCB);$(this.tracktop).stopObserving("mousedown",this.trackTopCB);$(this.trackbot).stopObserving("mousedown",this.trackBotCB)},resetScrollbar:function(e){this.track.hide();this.tracktop.hide();this.trackbot.hide();this.enableScroll=false;this.innerHeight=$(this.outerBox).clientHeight;this.innerBox.style.height=this.innerHeight+"px";var d=$(this.outerBox).clientWidth;var c=Element.getStyle(this.tracktop,"height");if(c){c=c.replace("px","")}else{c=0}var f=Element.getStyle(this.handletop,"height");if(f){f=f.replace("px","")}else{f=0}if(this.innerHeight<this.innerBox.scrollHeight){this.viewportHeight=this.innerHeight-c*2;this.slider.trackLength=this.viewportHeight;this.track.style.height=this.viewportHeight+"px";this.handleHeight=Math.round(this.viewportHeight*this.innerHeight/this.innerBox.scrollHeight);if(this.handleHeight<(f*2)){this.handleHeight=(f*2)}if(this.handleHeight<10){this.handleHeight=10}this.handle.style.height=this.handleHeight+"px";this.handle_middle.style.height=this.handleHeight-f*2+"px";this.handletop.style.height=f+"px";this.slider.handleLength=this.handleHeight;this.track.style.display="inline";this.tracktop.style.display="inline";this.trackbot.style.display="inline";this.ieDecreaseBy=1;if(this.outerBox.currentStyle){var b=this.outerBox.currentStyle.borderWidth.replace("px","");if(!isNaN(b)){this.ieDecreaseBy=(b)*2}}d=($(this.outerBox).clientWidth-$(this.track).clientWidth-this.ieDecreaseBy);this.enableScroll=true}this.innerBox.style.width=d+"px";if(e){setTimeout(this.resetScrollbar.bind(this,false),10)}},MouseWheelEvent:function(c,b){var d=0;if(!c){c=window.event}if(c.wheelDelta){d=c.wheelDelta/120}else{if(c.detail){d=-c.detail/3}}if(d){b.setValueBy(-d/10)}Event.stop(c)},trackbotEvent:function(c,b){if(Event.isLeftClick(c)){b.setValueBy(0.2);Event.stop(c)}},tracktopEvent:function(c,b){if(Event.isLeftClick(c)){b.setValueBy(-0.2);Event.stop(c)}},onChange:function(b){if(this.enableScroll){this.innerBox.scrollTop=Math.round(b*(this.innerBox.scrollHeight-this.innerBox.offsetHeight))}}};a.setAll=function(){$$(".makeScroll").each(function(b){a.ids[b.id]=new a(b)})};a.reset=function(b){if($(b).className.match(new RegExp("(^|\\s)makeScroll(\\s|$)"))){if(a.ids[b]){a.ids[b].release()}a.ids[b]=new a($(b))}};a.updateAll=function(){$H(a.ids).each(function(b){a.ids[b.key].resetScrollbar(true)})};Event.observe(window,"load",a.setAll);Event.observe(window,"resize",a.updateAll)})();

/* Scrolling */
(function(){document.observe("dom:loaded",function(){$$("a[href^='#']:not([href='#'])").each(function(a){a.observe("click",function(b){new Effect.ScrollTo(this.hash.substr(1));Event.stop(b)}.bindAsEventListener(a))})})})();

/* Scriptaculous MouseOver Effect */
(function(){document.observe("dom:loaded",function(){$$("#rap").each(function(){var a=$("rap");var c=a.getElementsByTagName("img");for(var b=0;b<c.length;b++){c[b].onmouseover=function(){new Effect.Opacity(this,{from:1,to:0.5,duration:0.5})};c[b].onmouseout=function(){new Effect.Opacity(this,{from:0.5,to:1,duration:0.5})}}})})})();

/* Swap and Popup for prototype.js */
(function(){function b(){var c=$A(document.getElementsByClassName("swap"));c.each(function(e){e.imgsrc=e.src;var d=e.src.lastIndexOf(".");e.imgsrc_on=e.src.substr(0,d)+"_on"+e.src.substr(d,4);new Image().src=e.imgsrc_on;e.onmouseover=function(){this.src=this.imgsrc_on};e.onmouseout=function(){this.src=this.imgsrc}})}function a(){var c=$A(document.getElementsByTagName("a"));c.each(function(e){if(e.getAttribute("rel")){var d=e.getAttribute("rel");if(d.indexOf("popup")==0){e.onclick=function(){var f=this.rel.replace(/^[^\?]+\??/,"").replace(/&/g,",");var g=this.rel.replace(/\?.*$/,"").replace(/^popup_/,"");window.open(this.href,g,f).focus();return false}}}})}Event.observe(window,"load",b,false);Event.observe(window,"load",a,false)})();

/* Simple Accordion Script Requires Prototype and Script.aculo.us Libraries By: Brian Crescimanno <brian.crescimanno@gmail.com> http://briancrescimanno.com This work is licensed under the Creative Commons Attribution-Share Alike 3.0 http://creativecommons.org/licenses/by-sa/3.0/us/ */
if(typeof Effect=="undefined"){throw ("You must have the script.aculo.us library to use this accordion")}var Accordion=Class.create({initialize:function(c,a){if(!$(c)){throw ("Attempted to initalize accordion with id: "+c+" which was not found.")}this.accordion=$(c);this.options={toggleClass:"accordion-toggle",toggleActive:"accordion-toggle-active",contentClass:"accordion-content"};this.contents=this.accordion.select("div."+this.options.contentClass);this.isAnimating=false;this.maxHeight=0;this.current=a?this.contents[a-1]:this.contents[0];this.toExpand=null;this.checkMaxHeight();this.initialHide();this.attachInitialMaxHeight();var b=this.clickHandler.bindAsEventListener(this);this.accordion.observe("click",b)},expand:function(a){this.toExpand=a.next("div."+this.options.contentClass);if(this.current!=this.toExpand){this.toExpand.show();this.animate()}},checkMaxHeight:function(){for(var a=0;a<this.contents.length;a++){if(this.contents[a].getHeight()>this.maxHeight){this.maxHeight=this.contents[a].getHeight()}}},attachInitialMaxHeight:function(){this.current.previous("div."+this.options.toggleClass).addClassName(this.options.toggleActive);if(this.current.getHeight()!=this.maxHeight){this.current.setStyle({height:this.maxHeight+"px"})}},clickHandler:function(b){var a=b.element();if(a.hasClassName(this.options.toggleClass)&&!this.isAnimating){this.expand(a)}},initialHide:function(){for(var a=0;a<this.contents.length;a++){if(this.contents[a]!=this.current){this.contents[a].hide();this.contents[a].setStyle({height:0})}}},animate:function(){var c=new Array();var a={sync:true,scaleFrom:0,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleMode:{originalHeight:this.maxHeight,originalWidth:this.accordion.getWidth()},scaleX:false,scaleY:true};c.push(new Effect.Scale(this.toExpand,100,a));a={sync:true,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleX:false,scaleY:true};c.push(new Effect.Scale(this.current,0,a));var b=0.75;new Effect.Parallel(c,{duration:b,fps:35,queue:{position:"end",scope:"accordion"},beforeStart:function(){this.isAnimating=true;this.current.previous("div."+this.options.toggleClass).removeClassName(this.options.toggleActive);this.toExpand.previous("div."+this.options.toggleClass).addClassName(this.options.toggleActive)}.bind(this),afterFinish:function(){this.current.hide();this.toExpand.setStyle({height:this.maxHeight+"px"});this.current=this.toExpand;this.isAnimating=false}.bind(this)})}});

var site_flag = 0;
var siteUrl = new Array('std_info.php', 'site_info.php', 'sitemap.php'/* , 'inquiry.php' */);
var sPath = window.location.pathname;
sPath = sPath.replace(/^\//g, '');
if(sPath == siteUrl[0]|sPath == siteUrl[1]|sPath == siteUrl[2]){site_flag = 1;}

document.observe("dom:loaded",function(){accordion=(site_flag>0)?new Accordion("menu",2):new Accordion("menu",1)});



