var $j = jQuery;

jQuery.fn.toggleDefault = function(){
	jQuery(this).each(function(){
		jQuery(this).bind('focus', function(){
			if (jQuery.trim(jQuery(this).val()) == this.defaultValue){
				jQuery(this).val('');
			}
		}).bind('blur', function(){
			if (jQuery.trim(jQuery(this).val()) == ''){
				jQuery(this).val(this.defaultValue);
			}
		});
	});
}

function sameHeight(c, scope){
	if (scope){
		$j(scope).each(function(){
			var set = $j(this).find(c);
			
			sameHeight(set);
		});
	}
	else {
		var h = 0;
		
		$j(c).each(function(){
			var th = $j(this).height();
			
			h = (th > h)? th : h;
		});
		
		$j(c).height(h);	
	}
}

function vCenterImg(container){
	$j(container).each(function(){
		var h1 = $j(this).height();
		var h2 = $j(this).find('img').outerHeight();
		$j(this).find('img').css('paddingTop', Math.floor((h1 - h2) / 2));
	});
}

$j(function(){
	$j('.quick-search input.text').toggleDefault();
	
	$j('#siteLeftBotColEditableArea').css({
		position: 'absolute',
		left: '8px',
		bottom: 0
	});
});

$j(window).bind('load', function(){
	$j('#siteBodyColLeft').css('paddingBottom',  $j('#siteLeftBotColEditableArea').height() + 'px')
});
