$(function() {

    //subNav add class Current
    $('#subNav li a').each(function(){
        var url = document.URL.split('/');
        // demo:4; real:3;
        if(url[4]){
            $('#subNav li [href*='+url[4]+']').parent().addClass("Current");
        } else {
            $('#subNav li:first').addClass("Current");            
        }
    });
    
    
    //flatHeights for ul.IconTtl li
    var sets = [], temp = [];
    $('#main .Section ul.IconTtl li').each(function(i) {
        temp.push(this);
        if (i % 2 == 1) {
            sets.push(temp);
            temp = [];
        }
    });
    if (temp.length) sets.push(temp);

    $.each(sets, function() {
        $(this).flatHeights();
    });
    

});
