var $flexture=jQuery.noConflict();function mobileViewport(){if(((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))||(navigator.userAgent.match(/Android/))||(navigator.userAgent.match(/webOS/)))&&($flexture('#mobileMenuTab').is(':visible'))){$flexture('head').append('<meta name = "viewport" content = "width=device-width; initial-scale=1.0; maximum-scale=1.0;" />');}}
$flexture(function(){mobileViewport();});function menuFunctions(){if((typeof nhAccordionMenu!='function')&&!($flexture.browser.opera)){$flexture('<span class="currentMenuItemBorder"></span>').appendTo('#menu ul .current');$flexture('<span class="ancestorMenuItemBorder"></span>').appendTo('#menu ul .currentAncestor');var mb_currentItemWidth=$flexture('#menu ul .current').width();var mb_ancestorItemWidth=$flexture('#menu ul .currentAncestor').width();$flexture('.currentMenuItemBorder').css({'width':mb_currentItemWidth}).fadeIn(1000);$flexture('.ancestorMenuItemBorder').css({'width':mb_ancestorItemWidth}).fadeIn(1000);}
$flexture('#menu ul a').parent().prepend($flexture('<span class="menuDivider">&nbsp;/&nbsp;</span>'));$flexture('#menu ul .menuDivider:first').css({'display':'none'});}
function visitorInteractionPanel(){$flexture('<div id="visitorInteractionPanel"><ul></ul></div>').appendTo('#pageTopShadow');if($flexture('#visitorInteractionPanel').is(':visible')){$flexture('<li><p id="adjustWidth">< ></p></li>').appendTo('#visitorInteractionPanel ul');var aw_currentWidth=$flexture('#mainContentWrapper').width();var aw_headerImageBackgroundPosition=$flexture('.headerImage').css('background-position');var aw_changedWidth=false;$flexture('#adjustWidth').click(function(){if(!aw_changedWidth){$flexture('#mainContentWrapper, #footerWrapper').animate({width:"92%"},'normal',function(){var aw_browserHeight=$flexture(window).height();var aw_siteContentHeight=$flexture('body').height();var aw_adjustHeight=(aw_browserHeight- aw_siteContentHeight)/2;if(aw_browserHeight>aw_siteContentHeight){$flexture('#pageBottomShadow').animate({'height':'+='+ aw_adjustHeight},'normal');}});if($flexture('#titleSlogan').is(':visible')){$flexture('#pageTopContent').animate({width:"92%"},'normal');}
if($flexture('.headerImage').is(':visible')){$flexture('.headerImage').fadeTo('normal',0).animate({'backgroundPosition':'0px 0px','opacity':1},1100);}
if($flexture('#extraContainer1').is(':visible')){$flexture('#extraContainer1').animate({width:"92%"},'normal');}
aw_changedWidth=true;}else{$flexture('#mainContentWrapper, #footerWrapper').animate({width:aw_currentWidth},'normal');if($flexture('#titleSlogan').is(':visible')){$flexture('#pageTopContent').animate({width:aw_currentWidth},'normal');}
$flexture('.headerImage').animate({"backgroundPosition":aw_headerImageBackgroundPosition},1100);if($flexture('#extraContainer1').is(':visible')){$flexture('#extraContainer1').animate({width:aw_currentWidth},'normal');}
aw_changedWidth=false;}});$flexture('<li><div id="headerColor1"></div></li><li><div id="headerColor2"></div></li><li><div id="headerColor3"></div></li>').appendTo('#visitorInteractionPanel ul');var headerColor1=$flexture('#headerColor1').css('background-color');var headerColor2=$flexture('#headerColor2').css('background-color');var headerColor3=$flexture('#headerColor3').css('background-color');$flexture('#headerColor1').click(function(){$flexture('body').animate({'backgroundColor':headerColor1},500);});$flexture('#headerColor2').click(function(){$flexture('body').animate({'backgroundColor':headerColor2},500);});$flexture('#headerColor3').click(function(){$flexture('body').animate({'backgroundColor':headerColor3},500);});$flexture('<li><p id="adjustTextSize">a A</p></li>').appendTo('#visitorInteractionPanel ul');var textSize=1;var newFontSize='1em';$flexture('#adjustTextSize').click(function(){if(textSize==1){newFontSize='1.15em';textSize++;}else if(textSize==2){newFontSize='0.85em';textSize++;}else if(textSize==3){newFontSize='1em';textSize=1;}else{newFontSize='1em';textSize=1;}
$flexture('#contentContainer, #sidebarContainer, #footerWrapper, #extraContainer1, #extraContainer2, #extraContainer3, #extraContainer4, #extraContainer5, #extraContainer6').animate({fontSize:newFontSize},'normal');});}}
function iPadAdjustments(){$flexture('#visitorInteractionPanel').stop().fadeTo('fast',1);$flexture('#adjustWidth').css({'display':'none'});if($flexture('#mainContentWrapper').width()>'700'){if(window.orientation==0){$flexture('#pageTopContent, #mainContentWrapper, #footerWrapper, #extraContainer1').css({'width':'90%'});}else if((window.orientation==90)||(window.orientation==-90)){$flexture('#pageTopContent, #mainContentWrapper, #footerWrapper, #extraContainer1').css({'width':'86%'});}}
$flexture('<li><p id="iPadCloseButton">X</p></li>').appendTo('#visitorInteractionPanel ul');$flexture('#visitorInteractionPanel').click(function(){if(!($flexture('#visitorInteractionPanel ul').is(':visible'))){$flexture('#visitorInteractionPanel ul').slideDown('normal');}});$flexture('#iPadCloseButton').click(function(){$flexture('#visitorInteractionPanel ul').slideUp('normal');});}
function iPhoneDesktopAdjustments(){if(((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))||(navigator.userAgent.match(/Android/))||(navigator.userAgent.match(/webOS/)))){visitorInteractionPanel();$flexture('#adjustWidth').css({'display':'none'});$flexture('#pageTopContent, #mainContentWrapper, #footerWrapper, #extraContainer1').css({'width':'90%'});$flexture('<li><p id="iPadCloseButton">X</p></li>').appendTo('#visitorInteractionPanel ul');$flexture('#visitorInteractionPanel').click(function(){if(!($flexture('#visitorInteractionPanel ul').is(':visible'))){$flexture('#visitorInteractionPanel').stop().fadeTo('fast',1);$flexture('#visitorInteractionPanel ul').slideDown('normal');}});$flexture('#iPadCloseButton').click(function(){$flexture('#visitorInteractionPanel ul').slideUp('normal');$flexture('#visitorInteractionPanel').pulse({opacity:[0,1]},{duration:2000,times:1000});});}}
function mobileMenu(){var mobileMenuConfig={sensitivity:3,interval:50,over:revealMobileMenuChildren,timeout:300,out:hideMobileMenuChildren};function revealMobileMenuChildren(){$flexture(this).find("ul:first").css({visibility:"visible",display:"none"}).slideDown(400);}
function hideMobileMenuChildren(){$flexture(this).find("ul:first").slideUp(500);}
$flexture("#menu ul ul").parent().addClass("ddarrow");$flexture("#menu ul ul").parent().append("<span></span>");$flexture("#menu ul ul").css({display:"none"});$flexture("#menu ul li").hoverIntent(mobileMenuConfig);$flexture('#mobileMenuTab').click(function(){$flexture('#menu').slideToggle('medium',function(){if($flexture('#menu').is(':visible')){$flexture('#mobileMenuTab').animate({backgroundPosition:'0px 0px'},0);}else{$flexture('#mobileMenuTab').animate({backgroundPosition:'0px -50px'},0);}});});}
function mobileImageResize(){$flexture('.imageStyle').each(function(){if(window.orientation==0){if(($flexture(this).width()>280)){$flexture(this).width(280);}}else if((window.orientation==90)||(window.orientation==-90)){if(($flexture(this).width()>440)){$flexture(this).width(440);}}});$flexture('#logo img').each(function(){if(window.orientation==0){if(($flexture(this).width()>300)){$flexture(this).width(300);}}else if((window.orientation==90)||(window.orientation==-90)){if(($flexture(this).width()>460)){$flexture(this).width(460);}}});}
function extraContent(){var i=0;while(i<=10){$flexture('#myExtraContent'+i+' script').remove();$flexture('#myExtraContent'+i).appendTo('#extraContainer'+i);i++;}}
function standardRwPageEnhancements(){$flexture('<div class="entryDivider"></div>').insertAfter('.filesharing-item');$flexture('.filesharing-item').addClass('enhancedFilesharingItem');var browserHeight=$flexture(window).height();var siteContentHeight=$flexture('body').height();if(browserHeight>siteContentHeight){var adjustHeight=browserHeight- siteContentHeight;$flexture('#pageBottomShadow').animate({'height':'+='+ adjustHeight},0);}
setTimeout(function(){browserHeight=$flexture(window).height();siteContentHeight=$flexture('body').height();if(browserHeight>siteContentHeight){adjustHeight=browserHeight- siteContentHeight;$flexture('#pageBottomShadow').animate({'height':'+='+ adjustHeight},1000);}},1000);}
(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(!fx.colorInit){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);fx.colorInit=true;}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]- fx.start[0]))+ fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]- fx.start[1]))+ fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]- fx.start[2]))+ fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];if(result=/rgba\(0, 0, 0, 0\)/.exec(color))
return colors['transparent'];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};})(jQuery);jQuery.fn.pulse=function(prop,speed,times,easing,callback){if(isNaN(times)){callback=easing;easing=times;times=1;}
var optall=jQuery.speed(speed,easing,callback),queue=optall.queue!==false,largest=0;for(var p in prop){largest=Math.max(prop[p].length,largest);}
optall.times=optall.times||times;return this[queue?'queue':'each'](function(){var counts={},opt=jQuery.extend({},optall),self=jQuery(this);pulse();function pulse(){var propsSingle={},doAnimate=false;for(var p in prop){counts[p]=counts[p]||{runs:0,cur:-1};if(counts[p].cur<prop[p].length- 1){++counts[p].cur;}else{counts[p].cur=0;++counts[p].runs;}
if(prop[p].length===largest){doAnimate=opt.times>counts[p].runs;}
propsSingle[p]=prop[p][counts[p].cur];}
opt.complete=pulse;opt.queue=false;if(doAnimate){self.animate(propsSingle,opt);}else{optall.complete.call(self[0]);}}});};(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+ Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}
if(p==this){return false;}
var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}
if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
