﻿
jQuery(document).ready(function() {
    if (jQuery('#spnArchiveSearch').length > 0) {
        var url = document.location.href;

        var qs = '&archive=';

        if (url.indexOf('obituariesandmemorials') > 0) qs = '?archive=';
        if (url.indexOf('births') > 0) qs = '?archive=';
        if (url.indexOf('marriages') > 0) qs = '?archive=';
        if (url.indexOf('announcements') > 0) qs = '?archive=';

        var indx = url.indexOf(qs);
        if (indx > 0) {
            var archive = url.substring(indx).replace(qs, '');
            if (archive.indexOf('&') > 0) {
                archive = archive.substring(0, archive.indexOf('&'));
            }
            switch (archive) {
                case '0':
                    if (jQuery('#archiveToday').length > 0) {
                        jQuery('#archiveToday').css('text-decoration', 'none');
                        //                        jQuery('#archiveToday').css('border', 'solid 1px');
                    }
                    break;
                case '7':
                    if (jQuery('#archive7').length > 0) jQuery('#archive7').css('text-decoration', 'none');
                    break;
                case '30':
                    if (jQuery('#archive30').length > 0) jQuery('#archive30').css('text-decoration', 'none');
                    break;
                case '60':
                    if (jQuery('#archive60').length > 0) jQuery('#archive60').css('text-decoration', 'none');
                    break;
                case '90':
                    if (jQuery('#archive90').length > 0) jQuery('#archive90').css('text-decoration', 'none');
                    break;
                case 'all':
                    if (jQuery('#archiveAll').length > 0) jQuery('#archiveAll').css('text-decoration', 'none');
                    break;
            }
        }
        else {

            if (url.indexOf('EnterDate:') > 0) {
                if (jQuery('#archiveAll').length > 0) jQuery('#archiveAll').css('text-decoration', 'none');
            }
            else {
                if (jQuery('#archive30').length > 0) jQuery('#archive30').css('text-decoration', 'none');
            }
        }
    }
});