$(function () {

    //script for adding the 'current' indicator above the main nav

    var path = location.pathname.split("/");

    path = path[1];

    $("#mainNav a[href*='" + path + "']").each(function () {
      if (path.length > 0) {
        $(this).addClass("current").parents('li').children('a').addClass('current');
      }
    });

   /* returnColor = $('#mainNav a').css('color');
    $('#mainNav li').hover(fadeIn, fadeOut);*/
  
    $(function () {
      $(".mapThumb img[rel]").overlay({ effect: 'apple' });
    });
  
});

function fadeIn() { 
    fadeNavToColor(this,'rgb(250,250,250)', '#0c5b88', 250);
}

function fadeOut() {                                        
    fadeNavToColor(this,returnColor, '#1283c3', 700);         
}

function fadeNavToColor(link, firstColor, secondColor, speed) {
    if ($(link).attr('id') != "makeAnAppointment") {
        $(link).children('a').animate({
            'color':  firstColor
        }, speed);
    } else {
        $(link).children('a').animate({
            'color': secondColor
        }, speed);
    }
}

function openCoupon(data) {
    window.open("/CustomControls/CouponViewer.aspx?cid=" + data.data.cid, "CouponWindow", "width=400, height=300");
}
