﻿var ddsmoothmenu={arrowimages:{down:["downarrowclass","Site/graphics/down.gif",23],right:["rightarrowclass","Site/graphics/right.gif"]},transition:{overtime:300,outtime:300},shadow:{enable:false,offsetx:0,offsety:0},showhidedelay:{showdelay:0,hidedelay:0},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,detectie6:document.all&&!window.XMLHttpRequest,getajaxmenu:function(c,b){var a=c("#"+b.contentsource[0]);a.html("Loading Menu...");c.ajax({url:b.contentsource[1],async:true,error:function(b){a.html("Error fetching content. Server Response: "+b.responseText)},success:function(d){a.html(d);ddsmoothmenu.buildmenu(c,b)}})},buildmenu:function(b,c){var a=ddsmoothmenu,d=b("#"+c.mainmenuid+">ul");d.parent().get(0).className=c.classname||"ddsmoothmenu";var e=d.find("ul").parent();e.hover(function(){b(this).children("a:eq(0)").addClass("selected")},function(){b(this).children("a:eq(0)").removeClass("selected")});e.each(function(g){var d=b(this).css({zIndex:100-g}),e=b(this).find("ul:eq(0)").css({display:"block"});e.data("timers",{});this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:e.outerWidth(),subulh:e.outerHeight()};this.istopheader=d.parents("ul").length==1?true:false;e.css({top:this.istopheader&&c.orientation!="v"?this._dimensions.h+"px":0});d.children("a:eq(0)").css(this.istopheader?{paddingRight:a.arrowimages.down[2]}:{}).append('<img src="'+(this.istopheader&&c.orientation!="v"?a.arrowimages.down[1]:a.arrowimages.right[1])+'" class="'+(this.istopheader&&c.orientation!="v"?a.arrowimages.down[0]:a.arrowimages.right[0])+'" style="border:0;" />');if(a.shadow.enable){this._shadowoffset={x:this.istopheader?e.offset().left+a.shadow.offsetx:this._dimensions.w,y:this.istopheader?e.offset().top+a.shadow.offsety:d.position().top};if(this.istopheader)$parentshadow=b(document.body);else{var f=d.parents("li:eq(0)");$parentshadow=f.get(0).$shadow}this.$shadow=b('<div class="ddshadow'+(this.istopheader?" toplevelshadow":"")+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+"px",top:this._shadowoffset.y+"px"})}d.hover(function(){var g=e,f=d.get(0);clearTimeout(g.data("timers").hidetimer);g.data("timers").showtimer=setTimeout(function(){f._offsets={left:d.offset().left,top:d.offset().top};var e=f.istopheader&&c.orientation!="v"?0:f._dimensions.w;e=f._offsets.left+e+f._dimensions.subulw>b(window).width()?f.istopheader&&c.orientation!="v"?-f._dimensions.subulw+f._dimensions.w:-f._dimensions.w:e;if(g.queue().length<=1){g.css({left:e+"px",width:f._dimensions.subulw+"px"}).animate({height:"show",opacity:"show"},ddsmoothmenu.transition.overtime);if(a.shadow.enable){var h=f.istopheader?g.offset().left+ddsmoothmenu.shadow.offsetx:e,i=f.istopheader?g.offset().top+a.shadow.offsety:f._shadowoffset.y;if(!f.istopheader&&ddsmoothmenu.detectwebkit)f.$shadow.css({opacity:1});f.$shadow.css({overflow:"",width:f._dimensions.subulw+"px",left:h+"px",top:i+"px"}).animate({height:f._dimensions.subulh+"px"},ddsmoothmenu.transition.overtime)}}},ddsmoothmenu.showhidedelay.showdelay)},function(){var b=e,c=d.get(0);clearTimeout(b.data("timers").showtimer);b.data("timers").hidetimer=setTimeout(function(){b.animate({height:"hide",opacity:"hide"},ddsmoothmenu.transition.outtime);if(a.shadow.enable){if(ddsmoothmenu.detectwebkit)c.$shadow.children("div:eq(0)").css({opacity:0});c.$shadow.css({overflow:"hidden"}).animate({height:0},ddsmoothmenu.transition.outtime)}},ddsmoothmenu.showhidedelay.hidedelay)})});d.find("ul").css({display:"none",visibility:"visible"})},init:function(a){if(typeof a.customtheme=="object"&&a.customtheme.length==2){var b="#"+a.mainmenuid,c=a.orientation=="v"?b:b+", "+b;document.write('<style type="text/css">\n'+c+" ul li a {background:"+a.customtheme[0]+";}\n"+b+" ul li a:hover {background:"+a.customtheme[1]+";}\n"+"</style>")}this.shadow.enable=document.all&&!window.XMLHttpRequest?false:this.shadow.enable;jQuery(document).ready(function(b){if(typeof a.contentsource=="object")ddsmoothmenu.getajaxmenu(b,a);else ddsmoothmenu.buildmenu(b,a)})}}
