function constructionFramework() {
	var toolList = new Array("World Builder","Planet Locator","Mech Lab","Character Creator","Vehicle Factory","Hanger Bay","ShipYard","Space Dock","Structure Designer");
	toolID = new Array("map","galaxy","mechlab","char","vehicle","hanger","ship","space","structure");
	for(var i=0,len=toolList.length; value=toolList[i], i<len; i++) {
		var toolBar = $(document.createElement('div')).attr('id',toolID[i]+'Slider');
		toolBar.addClass('base shadow rad2 slider');
		var topCal = i*27+5;
		var mapCss = { 'top' : topCal + 'px' };
		toolBar.css(mapCss);
		toolBar.appendTo('#conPanel');
		var wLabel = $(document.createElement('label')).attr('id',toolID[i]+'Label');
		wLabel.addClass('helvetica12');
		wLabel.html(toolList[i]);
		wLabel.appendTo('#'+toolID[i]+'Slider');
			var hiddenLabel = $(document.createElement('label')).attr('id',toolID[i]+'HiddenLabel');
                	hiddenLabel.addClass('helvetica12');
                	hiddenLabel.html(toolList[i]);
                	hiddenLabel.appendTo('#'+toolID[i]+'Slider');
		var wButton = $(document.createElement('img')).attr('id',toolID[i]+'Button');
		wButton.addClass('worldOpener');
		wButton.attr('src','assets/images/drop.png');
		wButton.appendTo('#'+toolID[i]+'Slider');
			var hiddenButton = $(document.createElement('img')).attr('id',toolID[i]+'HiddenButton');
                	hiddenButton.addClass('worldOpener');
                	hiddenButton.attr('src','assets/images/drop.png');
                	hiddenButton.appendTo('#'+toolID[i]+'Slider');
		var slideMask = $(document.createElement('div')).attr('id',toolID[i]+'Mask');
		slideMask.addClass('sliderMask');
		slideMask.appendTo('#'+toolID[i]+'Slider');
		$('#'+toolID[i]+'HiddenLabel').hide();
		$('#'+toolID[i]+'HiddenButton').hide();
	}
	sliderNominalWidth = $('#mapSlider').width();
	sliderNominalHeight = $('#mapSlider').height();
	sliderNominalY = 0;
	conEmpty = false;
	mapOpen = false;	galaxyOpen = false;	mechlabOpen = false;	charOpen = false;	vehicleOpen = false;	hangerOpen = false;	shipOpen = false;	spaceOpen = false;	structureOpen = false;
	$('#mapMask').click(function() { if(mapOpen==true) { closeMapEditor(); }else{ openMapEditor(); } });
	$("#galaxyMask").click(function() { if(galaxyOpen==true) { closePlanetLocator(); }else{ openPlanetLocator(); } });
	$("#mechlabMask").click(function() { if(mechlabOpen==true) { closeMechLab(); }else{ openMechLab(); } });
	$("#charMask").click(function() { if(charOpen==true) { closeCharCreator(); }else{ openCharCreator(); } });
	$("#vehicleMask").click(function() { if(vehicleOpen==true) { closeVehFactory(); }else{ openVehFactory(); } });
	$("#hangerMask").click(function() { if(hangerOpen==true) { closeHangerBay(); }else{ openHangerBay(); } });
	$("#shipMask").click(function() { if(shipOpen==true) { closeShipYard(); }else{ openShipYard(); } });
	$("#spaceMask").click(function() { if(spaceOpen==true) { closeSpaceDock(); }else{ openSpaceDock(); } });
	$("#structureMask").click(function() { if(structureOpen==true) { closeStrucDesigner(); }else{ openStrucDesigner(); } });
	$("#mapMask").mouseover(function() { if($('#mapSlider').width()==14) { tempVal = "map";	tempExpand(tempVal); } });
	$("#galaxyMask").mouseover(function() { if($('#galaxySlider').width()==14) { tempVal = "galaxy";       tempExpand(tempVal); } });
	$("#mechlabMask").mouseover(function() { if($('#mechlabSlider').width()==14) { tempVal = "mechlab";       tempExpand(tempVal); } });
	$("#charMask").mouseover(function() { if($('#charSlider').width()==14) { tempVal = "char";       tempExpand(tempVal); } });
	$("#vehicleMask").mouseover(function() { if($('#vehicleSlider').width()==14) { tempVal = "vehicle";       tempExpand(tempVal); } });
	$("#hangerMask").mouseover(function() { if($('#hangerSlider').width()==14) { tempVal = "hanger";       tempExpand(tempVal); } });
	$("#shipMask").mouseover(function() { if($('#shipSlider').width()==14) { tempVal = "ship";       tempExpand(tempVal); } });
	$("#spaceMask").mouseover(function() { if($('#spaceSlider').width()==14) { tempVal = "space";       tempExpand(tempVal); } });
	$("#structureMask").mouseover(function() { if($('#structureSlider').width()==14) { tempVal = "structure";       tempExpand(tempVal); } });
	$("#mapMask").mouseout(function() { if(tempVal=='map') { tempContract(tempVal); } });
	$("#galaxyMask").mouseout(function() { if(tempVal=='galaxy') { tempContract(tempVal); } });
	$("#mechlabMask").mouseout(function() { if(tempVal=='mechlab') { tempContract(tempVal); } });
	$("#charMask").mouseout(function() { if(tempVal=='char') { tempContract(tempVal); } });
	$("#vehicleMask").mouseout(function() { if(tempVal=='vehicle') { tempContract(tempVal); } });
	$("#hangerMask").mouseout(function() { if(tempVal=='hanger') { tempContract(tempVal); } });
	$("#shipMask").mouseout(function() { if(tempVal=='ship') { tempContract(tempVal); } });
	$("#spaceMask").mouseout(function() { if(tempVal=='space') { tempContract(tempVal); } });
	$("#structureMask").mouseout(function() { if(tempVal=='structure') { tempContract(tempVal); } });
}
function tempExpand(target) { $('#'+target+'Slider').animate({'width':sliderNominalWidth},300); }
function tempContract(target) {
	$('#'+target+'Slider').delay(900);	
	$('#'+target+'Slider').animate({'width':'14px'},300); 
}
function expandSelf(target) {
	for(var i=0,len=toolID.length; value=toolID[i], i<len; i++) {
		if(toolID[i]!=target) {
			$('#'+toolID[i]+'Slider').animate({'width':'14px'},300); 
		}
	}
	for(var i=0,len=toolID.length; value=toolID[i], i<len; i++) {
                if(toolID[i]==target) {
			$('#'+toolID[i]+'Slider').animate({'left':'44px'}, 200);
			sliderNominalY = $('#'+toolID[i]+'Slider').position();
			$('#'+toolID[i]+'Slider').animate({'top':'5px'}, 300);
			$('#'+toolID[i]+'Slider').animate({'width':$('#conPanel').width()-49, 'height' : $('#conPanel').height()-10}, 400); 
		}
        }
}
function closeSelf(target) {
	for(var i=0,len=toolID.length; value=toolID[i], i<len; i++) {
		if(toolID[i]==target) {
			$('#'+toolID[i]+'Slider').animate({'width':sliderNominalWidth,'height':sliderNominalHeight},400);
			$('#'+toolID[i]+'Slider').animate({'top':sliderNominalY.top}, 300);
			$('#'+toolID[i]+'Slider').animate({'left':'18px'},200); 
		}
	}
	for(var i=0,len=toolID.length; value=toolID[i], i<len; i++) {
                if(toolID[i]!=target) {
			$('#'+toolID[i]+'Slider').delay(900);
			$('#'+toolID[i]+'Slider').animate({'width':sliderNominalWidth},300);
                }
        }
	tempVal = "";	
}
function openMapEditor() {
	if(galaxyOpen==true||mechlabOpen==true||charOpen==true||vehicleOpen==true||hangerOpen==true||shipOpen==true||spaceOpen==true||structureOpen==true) { mapEditorDelay() }
	expandSelf("map");
	mapOpen = true;
}
function closeMapEditor() {
	closeSelf("map");
	mapOpen = false;
}

function openPlanetLocator() {
        if(mapOpen==true||mechlabOpen==true||charOpen==true||vehicleOpen==true||hangerOpen==true||shipOpen==true||spaceOpen==true||structureOpen==true) { planetLocDelay() }
        expandSelf("galaxy");
        galaxyOpen = true;
}
function closePlanetLocator() {
	closeSelf("galaxy");
        galaxyOpen = false;
}

function openMechLab() {
        if(galaxyOpen==true||mapOpen==true||charOpen==true||vehicleOpen==true||hangerOpen==true||shipOpen==true||spaceOpen==true||structureOpen==true) { mechlabDelay() }
        expandSelf("mechlab");
        mechlabOpen = true;
}
function closeMechLab() {
	closeSelf("mechlab");
        mechlabOpen = false;
}

function openCharCreator() {
        if(galaxyOpen==true||mechlabOpen==true||mapOpen==true||vehicleOpen==true||hangerOpen==true||shipOpen==true||spaceOpen==true||structureOpen==true) { charCreatorDelay() }
        expandSelf("char");
        charOpen = true;
}
function closeCharCreator() {
        closeSelf("char");
        charOpen = false;
}

function openVehFactory() {
        if(galaxyOpen==true||mechlabOpen==true||charOpen==true||mapOpen==true||hangerOpen==true||shipOpen==true||spaceOpen==true||structureOpen==true) { vehicleFactDelay() }
	expandSelf("vehicle");
	vehicleOpen = true;
}
function closeVehFactory() {
        closeSelf("vehicle");
	vehicleOpen = false;
}

function openHangerBay() {
        if(galaxyOpen==true||mechlabOpen==true||charOpen==true||vehicleOpen==true||mapOpen==true||shipOpen==true||spaceOpen==true||structureOpen==true) { hangerBayDelay() }
	expandSelf("hanger");
	hangerOpen = true;
}
function closeHangerBay() {
        closeSelf("hanger");
	hangerOpen = false;
}

function openShipYard() {
        if(galaxyOpen==true||mechlabOpen==true||charOpen==true||vehicleOpen==true||hangerOpen==true||mapOpen==true||spaceOpen==true||structureOpen==true) { shipyardDelay() }
	expandSelf("ship");
	shipOpen = true;
}
function closeShipYard() {
        closeSelf("ship");
	shipOpen = false;
}

function openSpaceDock() {
        if(galaxyOpen==true||mechlabOpen==true||charOpen==true||vehicleOpen==true||hangerOpen==true||shipOpen==true||mapOpen==true||structureOpen==true) { spacedockDelay() }
	expandSelf("space");
	spaceOpen = true;
}
function closeSpaceDock() {
        closeSelf("space");
	spaceOpen = false;
}

function openStrucDesigner() {
        if(galaxyOpen==true||mechlabOpen==true||charOpen==true||vehicleOpen==true||hangerOpen==true||shipOpen==true||spaceOpen==true||mapOpen==true) { strucDesignerDelay() }
	expandSelf("structure");
	structureOpen = true;
}
function closeStrucDesigner() {
        closeSelf("structure");
	structureOpen = false;
}
function mapEditorDelay() { $('#mapSlider').delay(900); }
function planetLocDelay() { $('#galaxySlider').delay(900); }
function mechlabDelay() { $('#mechlabSlider').delay(900); }
function charCreatorDelay() { $('#charSlider').delay(900); }
function vehicleFactDelay() { $('#vehicleSlider').delay(900); }
function hangerBayDelay() { $('#hangerSlider').delay(900); }
function shipyardDelay() { $('#shipSlider').delay(900); }
function spacedockDelay() { $('#spaceSlider').delay(900); }
function strucDesignerDelay() { $('#structureSlider').delay(900); }

