/*! jquery.fap.ui */



(function($) {

    //TODO: $('a[rel*=external]').attr({ target: '_blank' }); // open external links in new window
    //TODO:?   $('.jqRemove').remove(); // remove elements not needed if script is running

    window.FAP.UI.selection = window.getSelection ? window.getSelection() : document.selection || undefined;
    window.FAP.UI.deselectAll = (window.FAP.UI.selection.removeAllRanges) ? function(e) {
        if (window.FAP.UI.selection.rangeCount !== 0) { window.FAP.UI.selection.removeAllRanges(); }
    } : (window.FAP.UI.selection.type) ? function(e) {
        if (window.FAP.UI.selection.type !== 'None') { window.FAP.UI.selection.empty(); }
    } : undefined;

    window.FAP.form.jQueryInit();
    if ($.browser.msie6) {
        window.FAP.UI.editorialMenuInit();
    }

    $('.majorButtonOuter').each(window.FAP.UI.addHoverToButton);
    $('a.majorButton').each(window.FAP.UI.addHoverToLink);
    $('label.inlined + input.initialValue').each(function() {
        $(this).focus(window.FAP.UI.inlineLabelFocus);
        $(this).keypress(window.FAP.UI.inlineLabelKeyPress);
        $(this).blur(window.FAP.UI.inlineLabelBlur);
    });

    $('#SiteMapConcertina').concertina({ autoCollapse: false });
     if ($.browser.msie6) { IE6PngFix(); }

    $.extend($.fn, {
        BTToolTip: function(options) {
            
            function SetUPBTTooltip() {
                window.bt = $('<div id="BTToolTip" class="tooltip"><h3>How much does it cost to call this number?</h3><div class="body">Calls to this number will be charged at 4 pence per minute from BT landlines. Calls from other networks may vary. Calls from mobiles and outside the UK will be higher.</div><div class="closer"></div></div>').appendTo('body');

            }
            function Show(e) {

                if (e.target.className === "callRate") {
                    if (!window.bt) { SetUPBTTooltip(); }; 
                    window.bt.css({ left: parseInt(e.pageX, 10) + 'px', top: parseInt(e.pageY, 10) + 'px' });
                    window.FAP.UI.openToolTip(window.bt);
                    return false;
                }
            }

            return $(this).each(function(i, v) {  $(v).click(Show); });
        }
    });

})(jQuery);

$(document).ready(
function () {

    $('label.inlined + input.initialValue').each(function () { if (this.value != '') { $(this).prev('label.inlined').addClass('has-text'); } });
    pageLoaded = true;
});

AssignValidatorUpdateDisplay();

//if (window.Maps) {
//    Maps.prototype.handlePovChanged = function() { };
//    Maps.prototype.initNavigation = function (id, showTypeView) {
//        if (this.mapOptions.ShowDashboard) {
//            this.dash = new GoogleMapDashboard(this.map, this.mapOptions.EnableBirdseye, this.streetview.myPano)
//            this.dash.dashboard = this.mapContainer;
//            this.dash.dashboard.before(
//         this.mapTabs = $(MapDashboard.createDiv('mapTabs'))
//        .append($('<ul id="mapViewControl" class="tab_list">' + ((this.streetview.hasStreetView) ? '<li id="streetviewbutton"><span>Street View</span></li>' : '') + '<li id="roadbutton"><span>Map</span></li><li id="satellitebutton"><span>Satellite</span></li><li id="hybridbutton"><span>Satellite &amp; Map</span></li><li id="terrainbutton"><span>Terrain</span></li></ul>')
//        ))

//            this.BindViewHandlers(this.mapTabs, showTypeView);

//        }
//    }
//}
//if (window.GoogleMapDashboard) {
//    GoogleMapDashboard.prototype.getPanoZoomControls = function() { }
//}




