﻿// NOTE ALTOUGH THE 'STYLE' AND META DATA SAYS LT PRO MEDIUM COND this is actually LTPro-BoldCond
// there are no h4,h5,h6 tags in the site
/*
    Results of optimisation experiments using IE:
   * If using Cufon.refresh('selector'), 'selector' must match exactly the original selector string
   I've replaced most calls with Cufon.replace('selector') for efficiency

   * Adding the 'separate' attribute to text we know will only spread across one line makes a measurable impact in IE because the browser creates fewer new elements - one canvas for the entire thing rather than one per word
   
   * Including selectors for elements that are not present has a small but measurable impact as the search is performed

    * jQuery class selectors are much more efficient when used with a tag-name, ie div.class rather than.class

    * using cufon.set then calling cufon.replace is less efficient than using separate cufon.replace calls

    * splitting selectors or chaining them doesn't make any consistently measurable difference to efficiency
    eg 
        Cufon.replace('a', {  });
        Cufon.replace('b', {  });
    is equivalent to
        Cufon.replace('a,b', {  });
    and
        Cufon.replace('a', {  }).replace('b', {  });
*/

// these style objects are used in cufon.replace calls elsewhere:
// global js, hdp-carousel.js, ucl-gallery.js, ucl-t3.js, ucl-t5.js
// (anywhere that ajax content may be loaded )
Cufon.defaultTextCufon = { fontFamily: 'Futura Condensed Medium', fontStretch: 'semi-condensed' };
Cufon.smlHeaderTextCufon = { fontFamily: 'Futura Condensed Medium', separate: 'none' };
Cufon.linkTextCufon = { fontFamily: 'Futura Condensed Medium', hover: true };
Cufon.headerNoGradientCufon = { fontFamily: 'Futura LT Pro Medium Cond', fontStretch: 'normal', separate: 'none' };

// 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 = ['span.ucl-header-gradient:not(h1.wnqa-designers span),span.gradient','h1 span.ucl-header-no-gradient,div#hdp-disclaimer-front h1,div#hdp-error-copy h1,div.hdp-star-stories h2,div.hdp-star-experiences h2','p:not(div#hdp-disclaimer-content p)','#hdp-viewport a:not(div.ucl-tout-play-star-match a),div.hdp-content a:not(div.ucl-no-flash-div a, div.ucl-play-star-match a, p a)','div.ucl-no-flash-div a, div.ucl-tout-play-star-match a'];
/* headers with gradient */
Cufon.replace(Cufon.slideContentSelectors[0], {
	fontFamily: 'Futura LT Pro Medium Cond',
	fontStretch: 'normal',
	color: '-linear-gradient(0=#bbb, 0.18=#fff, #fff, 0.82=#bbb)',
	separate: 'none'
});

Cufon.replace(Cufon.slideContentSelectors[1], Cufon.headerNoGradientCufon);
Cufon.replace(Cufon.slideContentSelectors[2], Cufon.defaultTextCufon);


/* star match tout */
Cufon.replace('div.ucl-play-star-match span.ucl-star-match-para', Cufon.defaultTextCufon);
Cufon.replace('div.ucl-play-star-match a .ucl-star-match-title', {
	fontFamily: 'Futura LT Pro Medium Cond',
	fontStretch: 'semi-condensed',
	color: '-linear-gradient(0=#bbb, 0.2=#fff, #fff, 0.8=#bbb)',
	separate: 'none'
});
/* star lounge tout titles, which need to wrap */
Cufon.replace('div.ucl-star-lounge-tout h2', {
	fontFamily: 'Futura LT Pro Medium Cond',
	fontStretch: 'condensed'
});

/* second level headers */
Cufon.replace('span.title:not(ul.hdp-touts span.title),h2:not(.hdp-star-stories h2,div.hdp-star-experiences h2,div.ucl-star-lounge-tout h2),h3,.cufonise,label.error', Cufon.smlHeaderTextCufon);

/* most links, which need to hover and may be multiline */
Cufon.replace(Cufon.slideContentSelectors[3], Cufon.linkTextCufon);
Cufon.replace('div.full-carousel div.close-tab a,div.full-carousel div.more-tab a,ul.hdp-footer-links a,div.ucl-signup-div a,div.hdp-share-link a,div.hdp-disclaimer-touts a,ul.ucl-t5-submenu li,span.hdp-default-touts-title', Cufon.linkTextCufon);

/* tout links : after previous selectors so rollovers work as expected */
Cufon.replace('div.ucl-star-lounge-tout a', {
	fontFamily: 'Futura Condensed Medium',
    hover: true,
	separate: 'none'
});

/* h2 and disclaimer headers */
Cufon.replace('div#hdp-disclaimer-front h1,div#hdp-error-copy h1,div.hdp-star-stories h2,div.hdp-star-experiences h2', Cufon.headerNoGradientCufon);

/* navigation links */
Cufon.replace('div#hdp-header ul#hdp-primary-menu a,div#hdp-breadcrumbs a', {
	fontFamily: 'Futura LT Pro Medium Cond',
	fontStretch: 'condensed',
    hover: true
});
/* game link */
Cufon.replace(Cufon.slideContentSelectors[4], {
	fontFamily: 'Futura LT Pro Medium Cond',
	fontStretch: 'condensed',
    hover: true
});

