﻿Cufon.replace("h1", {fontFamily: 'Futura-Light'});
Cufon.replace("#subnav-title, .fontsizer-title", {fontFamily: 'Futura-Book'});

$('#util-explore').tooltip({
	offset: [407, 621],
	tip: '#brands-wrapper',
	relative: true,
	onShow: function() {
		$('#util-explore').addClass('hover');
	},
	onHide: function() {
		$('#util-explore').removeClass('hover');
	}			
});	

$('#cycling-banner')
.after('<div id="banner-tabs"><ul>') 
.cycle({ 
    fx:     'fade', 
    speed:  1000, 
    timeout: 8000, 
    pager:  '#banner-tabs ul',
	pagerEvent: 'mouseover', 
	pagerAnchorBuilder: function(idx, slide) {
		var anchor = '';
		anchor = '<li><a href="#" id="btn-cycle-' + (idx + 1) + '">' + (idx + 1) + '</a></li>';
		return anchor;
	}
});

$('#banner-tabs a').mouseover(function() { $('#cycling-banner').cycle('pause'); });
$('#banner-tabs a').mouseout(function() { $('#cycling-banner').cycle('resume'); });

function pagerLink() {
	location.href = $(this).attr('href');
}
function createLinks(query, href) {
	$(query).attr('href', href).click(pagerLink);
}
createLinks("#btn-cycle-1", '/painting/master-painters/');
createLinks("#btn-cycle-2", '/painting/faux-finish/');
createLinks("#btn-cycle-3", '/painting/painters-vancouver/');

$(document).ready(function(){
	$('#fontsizer').jfontsizer({
		applyTo: '#content',
		changesmall: '1',
		changelarge: '2',
		expire: 30
	});
});

