﻿$(function(){
$(".menu li").removeClass("current");          
 var url = window.location.pathname, urlRegExp = new RegExp(url.replace(/\/$/,'')); // create regexp to match current url pathname and remove trailing slash if present as it could collide with the link in navigation in case trailing slash wasn't present there
        // now grab every link from the navigation
     
        var sPage = url.substring(url.lastIndexOf('/') + 1);
        var a = window.location.pathname;
      
       if(a.indexOf('aspx')!=-1)
       {
            $('.menu a').each(function(){
                // and test its href against the url pathname regexp
                //alert(this.href)
                var test = this.href;       
               
                 if(test.indexOf('#')==-1)
                 {                   
                    if(urlRegExp.test(this.href))
                    {  
                        $(this).parent().addClass('current');
                      
                    }
                 }          
            });
        }
        
        
//$(".menu ul li").removeClass("current");          
});
function popupAttachment(url,windowname,width,height,features) 
{ 
var screenX = (screen.width/2 - width/2); 
var screenY = (screen.height/2 - height/2); 
var features= "scrollbars=yes"; 
features +=  ",left=" + screenX; 
features += ",top=" + screenY; 
features += ",width=" + width; 
features += ",height=" + height; 
window.open(url, "Email", features); 
return false; 
}
