Ext.onReady(function(){
	if (Ext.get("floorplan_1_link")) {
		var floorplan_1_popup = new Ext.BasicDialog("floorplan_1", {
			autoCreate: true,
			closable: true,
			collapsible: false,
			draggable: true,
			resizable: false,
			proxyDrag: true,
			shadow: true,
			modal: true,
			fixedcenter: true
		});
		
		floorplan_1_popup.setContentSize(Ext.get("floorplan_1_image").getWidth(),  Ext.get("floorplan_1_image").getHeight());
		
		Ext.get("floorplan_1_link").on("click", function() {
			floorplan_1_popup.show("floorplan_1_link");
			return false;
		});
	}
	
	if (Ext.get("floorplan_2_link")) {
		var floorplan_2_popup = new Ext.BasicDialog("floorplan_2", {
			autoCreate: true,
			closable: true,
			collapsible: false,
			draggable: true,
			resizable: false,
			proxyDrag: true,
			shadow: true,
			modal: true,
			fixedcenter: true
		});
		
		floorplan_2_popup.setContentSize(Ext.get("floorplan_2_image").getWidth(),  Ext.get("floorplan_2_image").getHeight());
		
		Ext.get("floorplan_2_link").on("click", function() {
			floorplan_2_popup.show("floorplan_2_link");
			return false;
		});
	}
	
	if (Ext.get("floorplan_3_link")) {
		var floorplan_3_popup = new Ext.BasicDialog("floorplan_3", {
			autoCreate: true,
			closable: true,
			collapsible: false,
			draggable: true,
			resizable: false,
			proxyDrag: true,
			shadow: true,
			modal: true,
			fixedcenter: true
		});
		
		floorplan_3_popup.setContentSize(Ext.get("floorplan_3_image").getWidth(),  Ext.get("floorplan_3_image").getHeight());
		
		Ext.get("floorplan_3_link").on("click", function() {
			floorplan_3_popup.show("floorplan_3_link");
			return false;
		});
	}
	
	if (Ext.get("floorplan_4_link")) {
		var floorplan_4_popup = new Ext.BasicDialog("floorplan_4", {
			autoCreate: true,
			closable: true,
			collapsible: false,
			draggable: true,
			resizable: false,
			proxyDrag: true,
			shadow: true,
			modal: true,
			fixedcenter: true
		});
		
		floorplan_4_popup.setContentSize(Ext.get("floorplan_4_image").getWidth(),  Ext.get("floorplan_4_image").getHeight());
		
		Ext.get("floorplan_4_link").on("click", function() {
			floorplan_4_popup.show("floorplan_4_link");
			return false;
		});
	}
});