/*
Author: Joe Tan (joetan54@gmail.com)
*/

jQuery(function($) {
	$('input[type=text]:not(.noclear), textarea:not(.noclear)').focus(function() {
		if ($(this).attr('defaultValue') == $(this).val()) $(this).val('')
	}).blur(function() {
		if ($(this).val() == '') { $(this).val($(this).attr('defaultValue'))}
	});
	
	$('blockquote p:has(img)').addClass('img')
	
	$('img.framed').each(function(i,obj) {
		var div = document.createElement('div')
		$(div).addClass('framed').addClass($(obj).attr('class'))
		$(obj).attr('class','')
		$(obj).wrap(div)
	})

});


if (typeof Cufon != 'undefined') {
	Cufon.replace('#sidebar .subnav h3', {fontSize:'40px', wordSpacing:'-11px'});
	Cufon.replace('h3.featured strong', {fontSize:'55px'});
	
	
	//Cufon.replace('h1');
} else {
	jQuery('#sidebar .subnav h3, h3.featured strong').addClass('alt')
}


// staff
jQuery(function($) {
	$('#staff li.profile .passion a').click(function() {
		$(this).siblings().slideToggle();
		return false;
	});
});


var tb_pathToImage = "/wp-includes/js/thickbox/loadingAnimation.gif";
var tb_closeImage = "/wp-includes/js/thickbox/tb-close.png";

jQuery(function($) { 
	if (typeof tb_init != 'function') return;


	tb_init(".popup");
	
	$('a[href*=integration.fellowshipone.com]:not(.thickbox)').each(function(i,obj) {
		//$(this).attr('href', $(this).attr('href')+'&TB_iframe=true&height=600&width=800');
		//tb_init(this);
		//$(this).attr('target', '_blank');
		$(this).click(function() {
			var w = window.open($(this).attr('href'), '_blank', 'width=700,height=700,scrollbars=1');
			return false;
		});
	});
});


jQuery(function($) {
	$('#quicklinks strong').mouseover(function() {
		$('#quicklinks ul').slideDown('fast');

	});
	$('#quicklinks ul').hover(function() {
	}, function() {
		$(this).slideUp('fast')
	});
});
