function clearDefault(el) {
	if (el.defaultValue==el.value) {
		el.value = "";
	}
}

$(document).ready(function() {
	
	$("#clientLogin").addClass("hidden");
	$("#searchBox").addClass("hidden");
	
	$(".clientLink").click(function(){
	  if ($("#searchBox").css("display")=="block") {
			$("#searchBox").animate({ 
				height: "toggle"
			}, 400 );
		}
	$("#clientLogin").animate({ 
		height: "toggle"
			}, 400 );
	});
	
	$(".searchLink").click(function(){
		if ($("#clientLogin").css("display")=="block") {
			$("#clientLogin").animate({
				height: "toggle"
			}, 400 );
		}
	$("#searchBox").animate({
			height: "toggle"
		}, 400 );
	});
	
	$("#portfolioThumbs img").mouseover(function(){
		$(this).animate({
			opacity: "0.5"
		},100);
		});
	
	$("#portfolioThumbs img").mouseout(function(){
		$(this).animate({
			opacity: "1.0"
		},100);
	});
	
	$("#portfolioThumbs a").click(function(){

	var largePath = $(this).attr("href");
	var largeAlt = $(this).attr("title");

	$("#portfolioLarge").attr({ src: largePath, alt: largeAlt });
	
	return false;

	});
	
	$("#search").bind("click",function(){ // clear default form values on submit
		clearDefault(this);
	});
	
	initSearch();
	
	$("#contactForm").validate();
	
	if ($.browser.msie && $.browser.version.substr(0,1)<7) { // add PNG Fix in IE6
		DD_belatedPNG.fix('.png'); // Belated PNG fix by Drew Diller - http://www.dillerdesign.com/experiment/DD_belatedPNG/
	}
	
	$(".flickrBox").fancybox({overlayOpacity:0.6});

});

var RecaptchaOptions = {
	theme: 'blackglass'
};
	
/* round some corners */
DD_roundies.addRule('.round3px', '3px', true);