$(document).ready(function(){

	// Open external links in new tab
	$("a.external, div.twitter a").attr({ target: "_blank" });
	
	// Remove outlines from clicked links
	$("a").click(function() {
		$(this).blur();
	});
	
	//disappearing default field values
	$("input.toggle, textarea.toggle").each(function() { this.defaultText = this.value; $(this).focus(function() { if (this.value == this.defaultText) this.value = ""; }).blur(function() { if (this.value == "" && this.defaultText) this.value = this.defaultText; });} );

	
	/** Client login box **/
	
	// show box on link hover
	$("a#client-login-link").mouseenter(function () {
		if (! $.browser.msie){
			// good browsers
			$("#client-login").stop(true, true);
			$("#client-login").css('display', 'block');
			$('#client-login').animate({
				opacity: '1',
				top: '20px'
			}, 400, function() {
				animating = false;
			});
		}
		else {
			// IE
			$("#client-login").css('display', 'block');;
		}
	});	
	
	// hide box when moving mouse away
	$("li.icon-client-login").mouseleave(function () {
		if (! $.browser.msie) {
			// good browsers
			$("#client-login").stop(true, true);
			$('#client-login').animate({
				opacity: '0',
				top: '10px'
			}, 400, function() {
				$("#client-login").css({'display' : 'none', 'top' : '28px'});
				animating = false;
			});
		}
		else {
			// IE
			$("#client-login").css('display', 'none');;			
		}
	});

});

