// site specific javascript stuff

//alert("running jordans_hours.js");

$(document).ready( function(){
    $('div.node.store').each( format_hours );
});

function format_hours(){
    
    $('span.oh-display-hours').each( function(){
        var content = $(this).html();
        var p = content.split(/[ :-]/);

        // lower the second hour and build the new string
        // the split works differently for IE
        if( parseInt(p[2]) ){
            var hour = parseInt(p[2]) - 12;
            var minutes = p[3];
        }else{
            var hour = parseInt(p[4]) - 12;
            var minutes = p[5];
        }
        var new_content = p[0]+':'+p[1]+' - '+hour+':'+minutes;
        $(this).html( new_content);
    });
    
}

