/* ------------------------------------------------------------------
@filename		ucl-cufon.js
@author:        Mark Howard mark.howard@akqa.com
@description:   UCL site Cufon replacements

*** NOTE ALTOUGH THE 'STYLE' AND META DATA SAYS FUTURA LT PRO MEDIUM COND this is actually FuturaLTPro-BoldCond
------------------------------------------------------------------- */

Cufon.headerNoGradientCufon = {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'normal',
    separate: 'none',
    hover: true,
    hoverables: { span: true }
}

Cufon.headerGradientCufon = {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'normal',
    color: '-linear-gradient(#fff, 0.65=#fff, #666)',
    separate: 'none'
};

Cufon.headerBreakCufon = {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'normal'
};

Cufon.headerBreakGradientCufon = {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'normal',
    color: '-linear-gradient(0=#bbb, 0.18=#fff, #fff, 0.82=#bbb)'
};

Cufon.greenHeaderCufon = {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'normal',
    color: '-linear-gradient(0=#90bd56, 0.18=#afe669, #afe669, 0.82=#90bd56)'
};

Cufon.defaultTextCufon = {
    fontFamily: 'Futura Condensed Medium',
    fontStretch: 'semi-condensed',
    hover: true
}

// automated selectors
// selectors for slide content - used in global js to minimise the Cufon.refresh
// headers with gradient, headers without gradient, paragraph text, links, game tout
Cufon.slideContentSelectors = [
    '',
    'div#hdp-disclaimer-front h1,div.hdp-star-stories h2,div.hdp-star-experiences h2, h1 span.ucl-header-no-gradient:not(.ucl-home span.ucl-header-no-gradient)',
    'p:not(div#hdp-disclaimer-content p,#ucl-tell-me-more-front p, .ucl-content-column .ucl-star-story-location, .cufon-ignore > p, .hdp-accordion p, #ucl-disclaimer-content p, #ucl-sp-faq p, #ucl-sp-private-league p, #ucl-sp-league-manage p, #ucl-sp-private-league, p #ucl-sp-overlay-body p, #ucl-sp-code-redemption p, #ucl-sp-error p),h5',
    '',
    'div.ucl-no-flash-div a, .ucl-star-experience div.ucl-category-page-flash-tout a, a.ucl-congratulations-link',
    'span.ucl-green-header,span.ucl-bottom-line-green'];

/* headers without gradient */
Cufon.replace(Cufon.slideContentSelectors[1], Cufon.headerNoGradientCufon);
/* green headers */
Cufon.replace(Cufon.slideContentSelectors[5], Cufon.greenHeaderCufon);
/* normal text */
Cufon.replace(Cufon.slideContentSelectors[2], Cufon.defaultTextCufon);

/* Banner Tout title */
Cufon.replace('div.ucl-banner-tout .title', {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'semi-condensed',
    color: '-linear-gradient(0=#bbb, 0.2=#fff, #fff, 0.8=#bbb)',
    separate: 'none'
});

/* game link */
Cufon.replace(Cufon.slideContentSelectors[4], {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'condensed',
    hover: true
});

/* new star-final - to be integrated above when finalised */
Cufon.replace('span.ucl-white-header,span.ucl-star-final-star-story-name', {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'condensed',
    color: '-linear-gradient(0=#bbb, 0.18=#fff, #fff, 0.82=#bbb)'
});
Cufon.replace('h4:not(.cufon-ignore > h4),span.ucl-star-final-star-story-location', {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'normal'
});
Cufon.replace('span.ucl-cta-subheader', {//,#ucl-tell-me-more-front h3
    fontFamily: 'Futura Condensed Medium'
});
Cufon.replace('span.ucl-cta-header', {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'normal',
    color: '-linear-gradient(0=#bbb, 0.18=#fff, #fff, 0.82=#bbb)'
});

// the following break IE 6
if (!/MSIE 6/i.test(navigator.userAgent)) {
    Cufon.replace('#ucl-tell-me-more-front h3', {
        fontFamily: 'Futura Condensed Medium'
    });
}

/* in UCL this file is used by star-lounge-gallery, star-players and trophy-tour-region */
Cufon.replace('#hdp-media-gallery h1, #hdp-media-gallery h2', {
    fontFamily: 'Futura Condensed Medium',
    fontStretch: 'normal',
    color: '-linear-gradient(0=#bbb, 0.18=#fff, #fff, 0.82=#bbb)',
    separate: 'none'
});

// UCL Previous Winners
Cufon.replace('.ucl-content-column.first .ucl-content-tout h3 span:even, .ucl-content-column .ucl-star-story-profile h3', {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'condensed',
    color: '-linear-gradient(#fff, 0.65=#fff, #666)'
});

Cufon.replace('.ucl-content-column.first .ucl-content-tout h3 span:odd', {
    fontFamily: 'Futura Condensed Medium',
    fontStretch: 'normal',
    color: '-linear-gradient(0=#90bd56, 0.18=#afe669, #afe669, 0.82=#90bd56)'
});

Cufon.replace('.ucl-content-column h5, .ucl-star-story-inner', Cufon.defaultTextCufon);
Cufon.replace('.ucl-content-column h4:not(.cufon-ignore > h4), p.ucl-star-story-location', Cufon.headerBreakCufon);

Cufon.replace('.ucl-text-panel h2', Cufon.headerNoGradientCufon);

/* star lounge tout titles, which need to wrap */
Cufon.replace('div.boxed-content-tout h2', {
    fontFamily: 'Futura LT Pro Medium Cond',
    fontStretch: 'condensed',
    separate: 'words'
});

Cufon.Caflisch = {
    fontFamily: 'Caflisch Script Pro',
    hover: true
};

Cufon.replace('.ucl-star-story-name', Cufon.Caflisch);

// UCL Star Player
Cufon.replace('#ucl-sp-profile-badges .badges li a', {
    fontFamily: 'Futura Condensed Medium',
    fontStretch: 'normal',
    separate: 'words',
    hover: true
});

Cufon.replace('#ucl-sp-profile-history .history p, .profile-stats h2, .profile-stats p strong, .score-bar .columnHeadings, .info-box h3, .playing-counter, .places-counter, #ucl-sp-content-footer p b, #ucl-sp-profile-tabs li.active a', {
    fontFamily: 'Futura LT Pro Medium Cond'
});

Cufon.replace('#badge-detail h1, #badge-detail p', {
    fontFamily: 'Futura LT Pro Medium Cond'
});

Cufon.replace('.ucl-sp-bold li a', {
    fontFamily: 'Futura LT Pro Medium Cond',
    hover:true
});

Cufon.replace('.info-box label, #ucl-sp-private-league label, #ucl-sp-league-manage label, .playing-counter span, .places-counter span, label#on-text, label#off-text', {
    fontFamily: 'Futura Condensed Medium'
});

Cufon.replace('div#ucl-sp-btn-primary a span', {
    fontFamily: 'Futura Condensed Medium',
    fontStretch: 'normal',
    textShadow: '1px 1px #333'
});

Cufon.replace('div#ucl-sp-error h1', {
    fontFamily: 'Futura LT Pro Medium Cond',
    textShadow: '2px 2px 4px rgba(0,0,0,0.6)'
});

Cufon.replace('div#ucl-sp-error p, div#ucl-sp-error p a', {
    fontFamily: 'Futura Condensed Medium',
    fontStretch: 'condensed',
    hover:true,
    textShadow: '2px 2px 4px rgba(0,0,0,0.6)'
});

// Futura Condensed Medium - with hover
Cufon.FuturaCondensedMediumHover = {
    fontFamily: 'Futura Condensed Medium',
    hover: true
}
Cufon.replace('ul.badges li.acquired a', Cufon.FuturaCondensedMediumHover);
Cufon.replace('a.ucl-sp-action-btn', Cufon.FuturaCondensedMediumHover);
Cufon.replace('div#ucl-sp-homepage div.profile ul li.name', Cufon.FuturaCondensedMediumHover);
Cufon.replace('.playbutton div', Cufon.FuturaCondensedMediumHover);
Cufon.replace('#ucl-sp-profile-tabs li a:not(#ucl-sp-profile-tabs li.active a)', Cufon.FuturaCondensedMediumHover);
Cufon.replace('div.manage-subtabs a', Cufon.linkTextCufon);
