/* 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)});


