function init_cufon() {
	Cufon.replace('#navSite li > a, h1, h5, #summary p, .causeBlurb p, a.action, #respond label, .linkMe, #login-form h3 .login, #cause_box p, #lower_bar #store_box h3, #lower_bar #subscribe h3, #section-menu li a, .facts #lowercontent h3, #join-form h3 .join, #profile label, .applyCharity label, a.bigLink', {
		hover: true
	});	
}

init_cufon();
jQuery(document).ready(function($){  
	tb_init_cufon('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
});

function tb_init_cufon(domChunk){
	jQuery(domChunk).click(function(){
		var t = this.title || this.name || null;
		var a = this.href || this.alt;
		var g = this.rel || false;
		tb_show_cufon(t,a,g);
		this.blur();
		return false;
	});
}

function tb_show_cufon(caption, url, imageGroup) {
	tb_show(caption, url, imageGroup);
	init_cufon();
}

var validTimeout = null;
jQuery(function($) {
	// joinValidate = $("#join-form").validate({
	// 		rules: {
	// 			username: { required: true, alphanum: true, remote: '/?ajax-action=check-username', rangelength: [6,25] },
	// 			password: { required: true, rangelength: [6,20], remote: '/?ajax-action=check-password' },
	// 			email:    { required: true, email: true, remote: '?ajax-action=check-email' },
	// 		},
	//  		onkeyup: function(element) {
	// 			if( element.name == 'email' || element.name == 'username' ) {
	// 				if(validTimeout != undefined)
	// 					clearTimeout(validTimeout);
	// 					validTimeout = setTimeout(function() {
	// 					joinValidate.element(element);
	// 				}, 500);
	// 			}
	// 			else if ( element.name in this.submitted || element == this.lastElement ) {
	// 				this.element(element);
	// 			}
	// 		}
	// });
   
	// open links with rel="external" in new window
	$('a[rel*=external]').click( function() {
		window.open(this.href);
		return false;
	});
});

