$(document).ready(function() {
function slideSubNav(element) {
    if($(element).attr('href').indexOf('javascript:void') == -1){
        return;
    }
    if($(element).next('ul').css('display') == 'block') {
        $(element).next('ul').slideUp(400);
        
    }
    else {
        $('li.open ul').slideUp(400);
        $('li.on ul').slideUp(400);
        $('li.open').removeClass('open');
        $(element).next('ul').slideDown(400);
        $(element).parents('li').addClass('open');
    }
};

$('ul#nav-main').children('li').children('a').click(function() { slideSubNav(this); } );

$('a').click(function() {
    var http = $(this).attr('href').indexOf("http");
    //var www = this.href.indexOf("w.revds.com");
    //if( (http < 0 && this.href.indexOf("javascript:") == -1 && this.href.indexOf("mailto:") == -1)
    //&& (www < 0 && this.href.indexOf("javascript:") == -1 && this.href.indexOf("mailto:") == -1) ){
    if(http == 0){
        if (!confirm("You are now leaving revds.com.\nRDS is not responsible for content or privacy policies on other sites.")) {
            return false;
        }
    }
    });
});

