$(document).ready(function(){
		
	var timeout    = 500;
	var closetimer = 0;
	var ddmenuitem = 0;
	
	function jsddm_open()
	{  
	   
	   jsddm_canceltimer();
	   jsddm_close();
	   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}
	
	function jsddm_close(){
		if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}
	
	function jsddm_timer(){
		closetimer = window.setTimeout(jsddm_close, timeout);}
	
	function jsddm_canceltimer(){
		if(closetimer){
		window.clearTimeout(closetimer);
		  closetimer = null;}}
	
	 $('#cssdropdown > li').bind('mouseover', jsddm_open)
	 $('#cssdropdown > li').bind('mouseout',  jsddm_timer)
	 
	 document.onclick = jsddm_close;

	function filterPath(string) {
	return string
	.replace(/^\//,'')
	.replace(/(index|default).[a-zA-Z]{3,4}$/,'')
	.replace(/\/$/,'');
	}
	var locationPath = filterPath(location.pathname);
	$('a[href*=#]').each(function() {
	var thisPath = filterPath(this.pathname) || locationPath;
	if (  locationPath == thisPath
	&& (location.hostname == this.hostname || !this.hostname)
	&& this.hash.replace(/#/,'') ) {
	var $target = $(this.hash), target = this.hash;
		if (target) {
		var targetOffset = $target.offset().top;
			$(this).click(function(event) {
		event.preventDefault();
			$.scrollTo( target, 500, { offset:{ top:-100,left:0 } }); 
			});
		}
	}
	});


		$('a.nyroModal').nyroModal({width: 730});
		$('a.nyroModal.outcome').nyroModal({width: 890});
		$('a.nyroModal.office').nyroModal({width: 890});
	    $(".section-nav a").click(function() {
	    $(".section-nav a").removeClass("active");
	    $(this).addClass("active");
	    })

	   




  
})