$(document).ready( function() {
	
	$("input[type=text], input[type=password], textarea").focus( function() {
		if ( $(this).val() == $(this).attr("title") ) {
			$(this).val("")
		}
	}).blur( function() {
		if ( $(this).val() == '' ) {
			$(this).val( $(this).attr("title") );
		}
	});
	
	$("a.fancyimage").fancybox({
		'hideOnContentClick': true,
		'zoomSpeedIn': 300,
		'zoomSpeedOut':	300,
		'overlayOpacity':0.7,
		'overlayColor':'#000',
		'transitionIn':'elastic'
	});
		
	$("a.fancypopup").fancybox({
		'type':'iframe',
		'width':800,
		'height':400,	
		'hideOnContentClick': true,
		'zoomSpeedIn': 300,
		'zoomSpeedOut':	300,
		'overlayOpacity':0.7,
		'overlayColor':'#000',
		'transitionIn':'elastic'
	});	
	
	
	//
	$(".ttab").click( function() {
		var rel = $(this).attr('rel');
		$(".ctab").hide();
		$(".ttab").removeClass("current");
		$("#tab_"+rel).show();
		$(this).addClass("current");
		return false;
	});
	$(".bttab").click( function() {
		var rel = $(this).attr('rel');
		$(".bctab").hide();
		$(".bttab").removeClass("current");
		$("#btab_"+rel).show();
		$(this).addClass("current");
		return false;
	});

});


$.fn.equalHeights = function(px) {
	var currentTallest = 0;
	$(this).each(function() {
		var currentHeight = $(this).height();
		if ( currentHeight > currentTallest) {
			currentTallest = currentHeight;
		}
	});
	currentTallest += 'px';
	// for ie6, set height since min-height isn't supported
	if ($.browser.msie && $.browser.version == 6.0) {
		$(this).css({'height': currentTallest});
	}
	$(this).css({'min-height': currentTallest}); 
	
	return this;
};
