// <![CDATA[
	// DEFAULT USEFUL FUNCTIONS
	// opacity
	function opacity(element, value) {
		var value_noie = value / 100;
		$(element).css('filter', 'alpha(opacity=' + value + ')');	// IE
		$(element).css('-moz-opacity', value_noie);					// FF < 2
		$(element).css('-khtml-opacity', value_noie);				// KHTML
		$(element).css('opacity',value_noie);						// everyone else
	}
	// center horizontally
	function centerHoriz(lo_que) {
		var x = parseFloat($(window).width()) / 2 - parseFloat($(lo_que).width()) / 2;
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		x = x + 'px';
		y = y + 'px';
		$(lo_que).css({'left': x, 'top': y});
	}
	// center vertically
	function centerVert(lo_que) {
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		$(lo_que).css({'top': y});
	}
	// no dotted outline for IE in As
	if ($.browser.msie) {
		$('a').focus(
			function() {
				$(this).blur()
			}
		);
	}
	// image load
	function loadImg(sID, sURL) {
		$(sID).unbind("load");
		$(sID).bind("load", function() { $(this).fadeIn(); } )
		$(sID).stop(true, true).fadeOut("normal", function () { $(sID).attr('src', sURL); } );
	}
	// handles system's messages
	function handleMessage(msg, wait, hide) {
		var topBar = $('#elgg_topbar');
		if(topBar.length) { // if there's a topbar, we must adjust the 'top' property accordingly
			msg.css('top', parseFloat(msg.css('top')) + (topBar.height() + parseFloat(topBar.css('padding-top')) + parseFloat(topBar.css('padding-top')))); 
		}
		var msgHeight = msg.height() + parseFloat(msg.css('padding-top')) + parseFloat(msg.css('padding-top')) + 20; 

		msg.animate({opacity: 1.0}, wait);
		msg.animate({top: '-=' + msgHeight}, hide);

		msg.click(
			function () {
				msg.stop(true, true);
				msg.animate({top: '-=' + msgHeight}, hide);
				return false;
			}
		);
	}
	// END DEFAULT //
	$(document).ready(
		function() {
			/* custom functions */
			// clear inputs
			var input_values = Array();
			$('input[type=text].input-clear').each(
				function() {
					input_values[$('input[type=text]').index(this)] = $(this).val();
				}
			);
			$('input[type=text].input-clear').focus(
				function() {
					if($(this).val() == input_values[$('input[type=text]').index(this)]) {
						$(this).val('');
					}
				}
			);
			$('input[type=text].input-clear').blur(
				function() {
					if($(this).val() == '') {
						$(this).val(input_values[$('input[type=text]').index(this)]);
					}
				}
			);
		}
	);
// ]]>
