$.fn.clear = function() {
		return this.focus(function() {
			if( this.value == this.defaultValue ) {
				this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
		});
};

$("#unit-case-study-body p:first, #unit-news-article .article-body p:first").addClass('first-child');
$('.template-news-article .article-body p:nth-child(3)').addClass('first-child');

$('#unit-client-list ol li').hover(function(){
	$(this).addClass('hover');
},function(){
	$(this).removeClass('hover');
})

$('.annotation-wrapper').each( function() {
	if( $(this).next().attr('href') ) {
		$(this).click(function(){
			window.location = $(this).next().attr('href');
		}).css('cursor','pointer');
	}
});


if (!($.browser.msie && $.browser.version=="6.0")) {
	$().bind('cbox_complete', function(){
		$('#cboxTitle').css('margin-top','4em').css('position','relative').css('color','white').css('padding', ' 0 0 1em 0').css('text-align', 'center'); $('#cboxContent,#cboxWrapper,#colorbox').css('overflow','visible');
	});
	$().bind('cbox_load', function(){
		$('#cboxTitle').css('margin-top','4em').css('position','relative').css('color','white').css('padding', ' 0 0 1em 0').css('text-align', 'center'); $('#cboxContent,#cboxWrapper,#colorbox').css('overflow','visible');
	});
}


$('input').clear();

try{
	$('#unit-article-videos li a, .article-images a').colorbox();
}catch(e){}

try{
	$('#unit-case-study-gallery a.slide').colorbox({current: "{current} of {total}"});
}catch(e){}

try{
	$('a.awardsbox').colorbox({width:500, height:300, iframe:true});
}catch(e){}

