function getParameter(p) {
	// returns NULL if the parameter p is not found
	var re = new RegExp('&' + p + '=([^&]*)', 'i');
	var c = window.location.search;
	return (c = c.replace(/^\?/, '&').match(re)) ? c = c[1] : c = 'NULL';
};

Ext.onReady( function() {
	
	var tabs = new Ext.TabPanel({
	    renderTo: 'tabs',
        defaults:{autoScroll: false, autoHeight:true},
	    items:[{
	    	title:'Information',
	    	id: 'infoTabPage',
	    	autoLoad: {
	    		url: 'locationInfo.php?locationId='+locationId, 
	    		scripts:true,
	    		nocache:true
	    	}
	    },{
	    	title: 'Comments ('+locationCommentCount+')',
	    	id: 'commentsTabPage',
	    	autoLoad: {
	    		url: 'locationComments.php?locationId='+locationId, 
	    		scripts:true,
	    		nocache:true
	    	}
	    },{
	    	title: 'Float Plans ('+floatPlanLocationCount+')',
	    	id: 'floatPlansTabPage',
	    	autoLoad: {
	    		url: 'locationFloatPlans.php?locationId='+locationId, 
	    		scripts:true,
	    		nocache:true
	    	}
    	},{
	    	title: 'Nearby Locations',
	    	id: 'nearbyLocationsTabPage',
	    	autoLoad: {
	    		url: 'locationNearbyLocations.php?locationId='+locationId, 
	    		scripts:true,
	    		nocache:true
    		}
    	}]
	});
	
	if (tab != '') {
		tabs.activate(tab);
	}

});
