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

function clearError(element) {
	element.children('label.error').remove();
}

function showWarning(element, infoId, msg) {
	$(infoId).html('<img src="/images/warning.png" alt="warning" />');
	element.append('<label class="error" for="uporabniskoIme" generated="true">' + msg + '</label>');
}

function showSuccess(infoId) {
	$(infoId).html('<img src="/images/accept.png" alt="Ok" />');
}

$(document).ready(function() {
	$('.equalHeights').equalHeights();
	
	// inline label
	$("label.inlined + .input-text").each(function (type) {
     	$(this).focus(function () {
      		$(this).prev("label.inlined").addClass("focus");
     	});
     	$(this).keypress(function () {
      		$(this).prev("label.inlined").addClass("has-text").removeClass("focus");
     	});
     	$(this).blur(function () {
      		if($(this).val() == "") {
      			$(this).prev("label.inlined").removeClass("has-text").removeClass("focus");
      		}
     	});
    });
});
