$(document).ready(function() {
	if (!Modernizr.fontface) {
		$.getScript("/css/type/helveneulig-cufon.js", function(){
			Cufon.replace('.HelveticaNeueUltraLight', {fontFamily: 'HelveticaNeueUltraLight'});
		});
		$.getScript("/css/type/helveneuthi-cufon.js", function(){
			Cufon.replace('.HelveticaNeueThin', {fontFamily: 'HelveticaNeueThin'});
		});
	}
	
	function featuredImageOver (el) {$('span', el).css('opacity', 1);$('.playButton', el).css('opacity', 0.3);$('.featuredImage', el).css('opacity', 0.75);}
	function featuredImageUp (el) {$('span', el).css('opacity', 0);$('.playButton', el).css('opacity', 0);$('.featuredImage', el).css('opacity', 0.75);}
	function highlightsImageOver (el) {$('span', el).css('opacity', 1);$('.playButton', el).css('opacity', 0.3);$('.highlightImage', el).css('opacity', 0.8);}
	function highlightsImageUp (el) {$('span', el).css('opacity', 0);$('.playButton', el).css('opacity', 0);$('.highlightImage', el).css('opacity', 0.4);}
	
	$('#home #featured a').each(
		function (i, el) {
			featuredImageUp(el);
			$(el).hover(function (evt) {featuredImageOver(this)}, function (evt) {featuredImageUp(this)});
			$(el).bind('touchstart', function(evt){featuredImageOver(this)});
			$(el).bind('touchend', function(evt){featuredImageUp(this)});
		}
	);

	$('#highlights ul li a').each(
		function (i, el) {
			highlightsImageUp(el);
			$(el).hover(function (evt) {highlightsImageOver(this)}, function (evt) {highlightsImageUp(this)});
			$(el).bind('touchstart', function(evt){highlightsImageOver(this)});
			$(el).bind('touchend', function(evt){highlightsImageUp(this)});
		}
	);
	
	$('#scroller').scroller();
	var es = $('#easySearch').easySearch();
	var as = $('#advancedSearch').advancedSearch();
	var ds = $('#designerSearch').designerSearch();
	$('.accordionContainer').fvtvAccordion();
	$('.accordionContainer').fvtvAccordion('openTab', 2);
});
