function stopIt(e) {
	try {
		window.event.cancelBubble = true;
	}
	catch (err) {
		e.stopPropagation();
	}
}

jQuery(function($){
		// Zebra table
		/*$('table.data tr:even').addClass('even');*/
		
		var baloon,
					buildings = $('#buildings i'),
					baloonfxtime=400;
		
		//Self-executing funciton
		(function(){
				$('.nav-baloons').hover(
					function(){
						baloon=$(this).addClass('hover-baloon');
						buildings.removeClass();
						buildings.addClass(baloon.attr('id'));
						buildings.stop(true, false).fadeTo(baloonfxtime, 0.8);
					},
					function(){
						baloon.removeClass('hover-baloon');
						buildings.stop(true, false).fadeTo(baloonfxtime, 0);
					}
				);
		})();
		
		// When everything is loaded
		/*$(window).load(function(){
				$('.nav-baloons').each(function(){
						baloon = $(this);
						baloon.mouseenter();
						window.setTimeout(function(){ baloon.mouseleave() }, baloonfxtime);
				});
		});*/
});

function LoadForm(form) {
	jQuery.ajax({
		url: '/index.php',
		type: 'POST',
		data: jQuery('#'+form).formToArray(true),
		enctype: 'multipart/form-data',
		dataType: 'json',
		beforeSend: function() {
			return php.beforeSend();
		},
		success: function(data, textStatus) {
			return php.success(data, textStatus);
		},
		error: function (xmlEr, typeEr, except) {
			return php.error(xmlEr, typeEr, except);                  
		},
		complete: function (XMLHttpRequest, textStatus) {
			return php.complete(XMLHttpRequest, textStatus);
		}
	});
	return false;
}
