function fixWit() {
	//$('#containerShadow').height($(document).height());
	return true;

	var	totalHeight	= 0;
	$('#container').children().each(function() {
		totalHeight	+= parseInt($(this).height());
	});
	$('#containerShadow').height(totalHeight+30);
}

// External Links
// 19-01-2012 update: This function is not used anymore, functionality is
// implemented in ga_filetracking.js
function fixLinks() {
	if (arguments[0]==undefined || arguments[0]=='') arguments[0] = $(document);
	var obj	= arguments[0];

	$(obj).find('a').each(function() {
		var href	= $(this).attr('href');
		// Determin if external link
		if (
				href!=undefined &&
				(
					href.indexOf('http://')>=0 ||
					href.indexOf('https://')>=0 ||
					href.indexOf('www.')>=0
				) &&
				href.indexOf('www.vvv-maastricht.eu') == -1 &&
				href.indexOf('www.vvvmaastricht.eu') == -1
			) {
			$(this).unbind('click').click(function() {
				urchinTracker('/outgoing/'+$(this).attr('href'));
			});
		}
	});
}

function setHash(hash, hashName) {
	window.location.hash = ((hashName!='') ? hashName+':' : '') + hash;
}
function clearHash() {
	window.location.hash = '';
}

function getHashObject(hash) {
	var returnObj	= new Object();
	// check if start with #
	var hash 		= (hash.substr(0,1)=='#') ? hash.substr(1) : hash;
	// Split on ; to get all hash sets
	var hashSets	= (hash.indexOf(';')!==false) ? hash.split(';') : new Array(hash);
	// Loop trought hash sets and create object with name:value
	for (i in hashSets) {
		var hashData	= hashSets[i].split(':');
		returnObj[hashData[0]] = hashData[1];
	}
	return returnObj;
}

// create a loader on a specific object
function loader(id) {

	if ($('#'+id+'_loader').length==1) {
		return false;
	}

	var object		= $('#'+id);
	var position	= object.offset();
	var height		= object.outerHeight(true);
	var width		= object.outerWidth(true);

	$('<div class="loader"><img src="img/ajax_loader.gif" /></div>')
	.appendTo('body')
	.fadeOut(2000)
	.attr('id', id+'_loader')
	.css({
		top:		position.top,
		left:		position.left,
		height:		height,
		width:		width,
		opacity:	0.6
	}).fadeIn(2000);

	return true;
}

// Generic xmlHttp caller for xmlHttp applications
function xmlHttpApp(appName, postData, successCallback) {

	$.ajax({
		type:			'post',
		data:			postData,
		url:			'inc/xmlhttp.php?app='+appName,
		dataType:		'json',
		timeoutNumber:	5000,
		error:			function(XMLHttpRequest, textStatus, errorThrown) {
			/*console.log('an error occured, oh oooh:')
			console.log(XMLHttpRequest);
			console.log(textStatus);
			console.log(errorThrown);
			console.log('------------------------');*/
			alert('error');
		},
		success:		function(data, textStatus, XMLHttpRequest) {
			successCallback(data);
		},
		complete:		function() {

		}
	});
}
