// This is a combination of library.js, console.js, flags.js, achievements.js.php, behaviors.js, objects.js.php, roommanager.js, init.js, localization.json generated at 1328489401



/**
 * library.js
 */

/*function notice(str){
	if(opera){
		opera.postError(str);
	} else {
		alert(str);
	}
}*/

function localize(id){
	var arguments = Array.prototype.slice.call(arguments);
	var str = localization[id] || "** Missing string **";
	var requiredSlots = 0;
	str.scan('_', function(){requiredSlots++;});
	if(arguments.length - 1 != requiredSlots){
		return "** Bad string **";
	}

	arguments.slice(1).each(function(x){
		str = str.sub('_', x);
	});
	return str;
}

Array.prototype.sentenceJoin = function(delim){
	if(this.length == 0){
		return '';
	} else if(this.length == 1){
		return this[0];
	} else if(this.length == 2){
		return this[0]+" and "+this[1];
	} else {
		return this.slice(0,-1).join(delim)+", and "+this[this.length-1];
	}
}


/**
 * console.js
 */

var Noticer = {

	noticerEl: null,

	timeToShow: 4, //seconds

	currentEffect: null,

	vanishTimer: null,

	noticeDone: function(){
		if(this.currentEffect == null){
			this.currentEffect = new Effect.Fade(this.noticerEl, {
				transition: Effect.Transitions.fi,
				duration: 2,
				afterFinish: (function(){
					this.currentEffect = null;
					}).bind(this)
			});
		}
		
	},

	notice: function(str, isError){

		if(!isError){
			Scrollback.add(str, false);
		}

		if(this.currentEffect != null){
			this.currentEffect.cancel();
			this.currentEffect = null;
		}

		if(this.vanishTimer != null){
			window.clearTimeout(this.vanishTimer);
			this.vanishTimer = null;
		}

		this._setText(str);
		
		this.currentEffect = new Effect.Appear(this.noticerEl, {
			transition: Effect.Transitions.fi,
			duration: 0.5,
			afterFinish: (function(){
				this.currentEffect = null;
				this.vanishTimer = this.noticeDone.bind(this).delay(this.timeToShow);
				}).bind(this)
		});
		
	},

	init: function(){
		this.noticerEl = $('noticer');
		
		this.noticerEl.hide();
		this.noticerEl.observe('click', Noticer.noticeDone.bind(this));
	},

	_setText: function(str){
		this.noticerEl.down('.content').update(str);
	}

}

var Scrollback = {

	scrollbackArray: new Array(),

	displayLimit: 6,
	
	scrollback: null,

	nthLast: 0,

	init: function(){
		this.scrollback = $('scrollback');
		$$('.bottom')[0].observe('click', function(){
			$('prompt').focus();
		});
	},

	add: function(str, isUserCmd){
		if(typeof isUserCmd == 'undefined'){
			isUserCmd = true;
		}
		this.scrollbackArray.push({str: str, isUserCmd: isUserCmd});
		this._updateScrollback();
		this.nthLast = 0;
	},

	getLastUserCmd: function(nthLastOffset){
		this.nthLast += nthLastOffset;
		if(this.nthLast < 1){
			this.nthLast = 0;
			return '';
		}
		
		var tempNthLast = this.nthLast;
		for(var i=this.scrollbackArray.length-1; i >= 0; i--){
			var item = this.scrollbackArray[i];
			//alert('item = scrollbackArray['+i+'] = '+item.str);
			if(item.isUserCmd){
				if(tempNthLast == 1){
					return item.str;
				} else {
					tempNthLast--;
				}
			}
		}
		return this.getLastUserCmd(-1);
	},

	_updateScrollback: function(){

		this.scrollback.childElements().invoke('remove');

//		var maxHeight = (new Number(this.scrollback.getStyle('max-height').sub('px', '')) + 8 - 1); // oh god hax 8 is the padding
		var maxHeight = 97;

		var content;
		var itemsWritten = 0;
		var length = this.scrollbackArray.length;
		while(itemsWritten < length){
//		while(itemsWritten < this.displayLimit && itemsWritten < length){

			var item = this.scrollbackArray[length-itemsWritten-1];

			content = new Element('div');

			if(item.isUserCmd){
				content.addClassName('userCmd');
				content.update("» "+item.str);
			} else {
				content.addClassName('systemResponse');
				content.update(item.str);
			}

			this.scrollback.insert({top: content});

			if(this.scrollback.getHeight() > maxHeight){
				//opera.postError('pruning since '+this.scrollback.getHeight() + ' > '+maxHeight);
				this.scrollback.down().remove();
				return;
			} else {
				//opera.postError('not pruning: '+this.scrollback.getHeight() + ' <= '+maxHeight);
			}

			itemsWritten++;

		}

	}


};

function notice(str, isError){
	if(typeof isError == 'undefined'){
		isError = false;
	}
	Noticer.notice.bind(Noticer)(str, isError);
}


/**
 * flags.js
 */

var flags = {
	testFlag: false,
	have101key: false
}

var Notifier = {
	queue: new Array(),
	isNotifying: false,
	timeToShow: 5,
	timeToFadeIn: 1,
	timeToFadeOut: 1,
	timeWhenBlank: 1,

	/**
	 * notifyParams: object with keys title, leftmessage, rightmessage, icon (relative to site root)
	 */
	notify: function(notifyParams){
		this.queue.push(notifyParams);
		if(!this.isNotifying){
			this.showNext();
		}
	},

	showNext: function(){
		if(this.queue.length == 0){
			this.isNotifying = false;
		} else {
			this.isNotifying = true;
			var notifyParams = this.queue.shift();

			var notifier = $('notifier');
			notifier.down('h1').update(notifyParams.title);
			notifier.down('.subtext1').update(notifyParams.leftmessage);
			notifier.down('.subtext2').update(notifyParams.rightmessage);
			//notifier.down('object').replace('<object data="'+notifyParams.icon+'" type="image/svg+xml"></object>');

			new Effect.Morph('notifier', {
				style: {
					height: '123px'
				},
				duration: this.timeToFadeIn,
				transition: Effect.Transitions.fi
			});

			//Don't touch this
			//There be dragons
			((function(){
				new Effect.Morph('notifier', {
					style: {
						height: '0px'
					},
					delay: this.timeToFadeIn+this.timeToShow, //.5 to fade in, 5 to stay
					duration: this.timeToFadeOut, //.5 to fade out
					transition: Effect.Transitions.fi
				});
				this.showNext.bind(this).delay(this.timeToFadeIn+this.timeToShow+this.timeToFadeOut+this.timeWhenBlank);
			}).bind(this))();
		}
	}
};




/**
 * achievements.js.php
 */

flags.achievements= {"eggchair": new Achievement({"id":"eggchair","name":"Sit in the Egg Chair","maxprogress":3,"description":"This Egg Chair desires to be sat in. Do so three times."}),
"patience": new Achievement({"id":"patience","name":"Patience is a Virtue","maxprogress":1,"description":"Stay on the site for 8 seconds."}),
"allaccess": new Achievement({"id":"allaccess","name":"All Access Pass","maxprogress":1,"description":"Rent a 101 KEY from ABBIE."}),
"whitedoor": new Achievement({"id":"whitedoor","name":"Door Drawing","maxprogress":1,"description":"Draw on the TDH2 Whitedoor."}),
"stare": new Achievement({"id":"stare","name":"Staredown Slaughter","maxprogress":1,"description":"Make intense eye contact with Kenny. Get in a heated staring contest. "}),
"portals": new Achievement({"id":"portals","name":"Now You're Thinking With Portals","maxprogress":2,"description":"Enter Sam\u2019s room, which is done using a portal in the hallway."}),
"microwave": new Achievement({"id":"microwave","name":"Stuff Not To Microwave","maxprogress":1,"description":"Use microwave in Sam's room"}),
"topgear": new Achievement({"id":"topgear","name":"Top Gear","maxprogress":1,"description":"Use TV in TDH2"}),
"duel": new Achievement({"id":"duel","name":"Pistols at Dawn","maxprogress":1,"description":"Talk to Nathan, challenge a duel"}),
"tf2": new Achievement({"id":"tf2","name":"Achievement Unlocked","maxprogress":1,"description":"Use Jon's computer"}),
"facepalm": new Achievement({"id":"facepalm","name":"Facepalm","maxprogress":3,"description":"Talk to Robert, choose any dialog option"})};
function Achievement(args) {
	this.id = args.id;
	this.name = args.name;
	this.maxProgress = args.maxprogress;

	var progress = 0;
	var haveSeenSuccessMessage = false;

	this.increment = function(){

		if(!this.isAchieved()){
			progress++;
		}
		if(this.isAchieved() && !haveSeenSuccessMessage){
			this.notify('Achievement unlocked', '');
			haveSeenSuccessMessage = true;
		} else if(!this.isAchieved()) {
			this.notify('Making progress', progress+'/'+this.maxProgress);
		}
	}

	this.isAchieved = function(){
		return progress == this.maxProgress;
	}

	this.notify = function(leftmessage, rightmessage){
		Notifier.notify({
			title: this.name,
			leftmessage: leftmessage,
			rightmessage: rightmessage,
			icon: 'sprites/achievements/'+this.id+'.svg'
		});
	}
}


/**
 * behaviors.js
 */

var behaviors = { //the ids here are the titles, not names, of objects
	/*'room998': {
		'JACUZZI': function(){
			notice('You clicked a pool');
		},
		'EGG CHAIR': function(){
			flags.achievements['eggchair'].increment();
		},
		'AUTOMATIC SLIDING DOORS': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		}
	},
	'room999': {
		//no behaviors defined for this room yet
	},
	'floor9': {
		'BAR': function(){
			notice('Hallway sprite is working.');
		}
	},*/
	'floor2': {
		'WHITEDOOR': function(){
			RoomManager.lookAtObject.bind(RoomManager)('WHITEDOOR');
			flags.achievements['whitedoor'].increment.bind(flags.achievements['whitedoor'])();
		}
	},
	'room206A': {
		interactions: {
			abbie: {'Can I have a 101 key, please?': 'getKey'}
		},
		/*'ABBIE': function(){
			/if(!flags.achievements['allaccess'].isAchieved()){
				setPaneContent('talk', 'Abbie', "Hi, I'm ABBIE. I'm the president of TECH HOUSE.<br />You want a 101 KEY? Sure, it'll just cost a $20 deposit. Here you go!", '');
				setMoney(getMoney() - 20);
				flags.achievements['allaccess'].increment.bind(flags.achievements['allaccess']).delay(2);
			} else {
				setPaneContent('talk', 'Abbie', "Enjoy your visit to TECH HOUSE!", '');
			}
		},*/
		'DOOR': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		},
		'getKey': function(){
			if(!flags.achievements['allaccess'].isAchieved()){
				setPaneContent('talk', 'Abbie', "Hi, I'm ABBIE. I'm the president of TECH HOUSE.<br />You want a 101 KEY? Sure, it'll just cost a $20 deposit. Here you go!", '');
				setMoney(getMoney() - 20);
				flags.achievements['allaccess'].increment.bind(flags.achievements['allaccess']).delay(2);
			} else {
				setPaneContent('talk', 'Abbie', "Enjoy your visit to TECH HOUSE!", '');
			}
		}/*,
		}
		'_leave': function(){
			setPaneContent('go', 'Leave', "As you step out of Abbie's room at "+(new Date())+", you shut the door behind you.", '');
		}*/
	},
	'room206B': {
		interactions: {
			microwave: {'Stick LIGHTBULB in MICROWAVE and set to 30 SECONDS.': 'usemicrowave'}
		},
		'RED PORTAL': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		},
		'_enter': function(){
			flags.achievements['portals'].increment.bind(flags.achievements['portals']).delay(1);
			//get the portal achievement
		},
		'_leave': function(){
			flags.achievements['portals'].increment.bind(flags.achievements['portals']).delay(1);
		},
		'usemicrowave': function(){
			if(!flags.achievements['microwave'].isAchieved.bind(flags.achievements['microwave'])()){
				setPaneContent('USE', 'Microwave', "When you stick a light bulb in the microwave, it glows brighter than anything you've ever seen, brighter than the sun! Duck, and cover! Luckily, you shut if off before thirty seconds are up, so the lightbulb doesn't detonate.", 'microwave_lightbulb.jpg');
				flags.achievements['microwave'].increment.bind(flags.achievements['microwave'])();
			} else {
				//setPaneContent('LOOK', 'Microwave', rooms['206B'].activesprites['MICROWAVE'].description, 'microwave.jpg');
				notice('You already wasted one of her LIGHTBULBS.');
				RoomManager.lookAtObject.bind(RoomManager)('MICROWAVE', 'LOOK');
			}
		}
	},
	'room207': {
		interactions: {
			nathan: {'I challenge you to a duel!': 'duel'}
		},
		'DOOR': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		},
		'duel': function(){
			if(!flags.achievements['duel'].isAchieved.bind(flags.achievements['duel'])()){
				setPaneContent('DUEL', 'Nerf Gun Duel of Honor', "The sun rises over the barren, gritty wasteland of HARKNESS 207 to find two pistoleros locked in a DUEL OF HONOR. GUNSLINGER NATHAN shifts his weight and pulls his battered fedora low over his cunning, bloodshot eyes. You dig your boots into the hard-packed dirt and spit out the cactus meat you were chewing. The VULTURES circle.<br /> Your arm tenses. You can do this. Your whole life lead up to this moment. The decision is made. You go for your trusty NERF GUN.<br /> You see movement, then your vision is filled with hot white. As your sight returns to you, you see that an orange nerf dart is stuck to your CHEAP PLASTIC SHERIFF'S STAR. As it stops wobbling, you notice that someone wrote your name on the dart shaft with a SHARPIE. NATHAN returns his modified NERF MAVERICK SIX-SHOOTER to his holster and pulls his fedora even farther down over his eyes.<br /> \"I like you, kid. Maybe one day, you'll be somebody.\"", '');
				flags.achievements['duel'].increment.bind(flags.achievements['duel']).delay(4);
			} else {
				RoomManager.lookAtObject.bind(RoomManager)('TV', 'LOOK');
			}
		}
	},
	'room209': {
		interactions: {
			robert: {
				'I\'m really excited to be using Gmail instead of Brown Exchange!': 'facepalm',
				'I\'m thinking about trying to learn C. What\'s the best compiler money can buy?': 'facepalm',
				'Whoops, I actually meant to visit JON\'S ROOM. Sorry to bother you.': 'facepalm',
				'What\'s all this about magical girls?': 'facepalm',
				'This game is terrible, Robert.': 'facepalm'
			}
		},
		'DOOR': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		},
		'facepalm': function(){
			flags.achievements['facepalm'].increment.bind(flags.achievements['facepalm']).delay(2);
			setPaneContent('TALK', 'Robert', "Robert hangs his head, ashamed for you.", 'robert_facepalm.jpg');
		}
	},
	'room210': {
		'DOOR': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		}
	},
	'room211': {
		interactions: {
			'jon': {'Play Team Fortress 2': 'tf2'}
		},
		'DOOR': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		},
		'tf2': function(){
			if(!flags.achievements['tf2'].isAchieved.bind(flags.achievements['tf2'])()){
				setPaneContent('USE', 'Team Fortress 2', "Jon offers to let you play Team Fortress 2. You sit down at his computer and begin playing on a server. You're not quite sure how this works, but you seem to be in the enemy's base, killing their dudes. Some of these guys are on fire, and others are large angry Russian men, screaming at the top of their lungs about sandwiches as they run around punching everything with oversized boxing gloves. Soon, the angry Russians have punched out all of your blood. When you die, you hear a fanfare, signaling that an Achievement has been Unlocked.", '');
				flags.achievements['tf2'].increment.bind(flags.achievements['tf2']).delay(2);
			} else {
				notice("That's enough TF2 for one day.");
			}
		}
	},
	'room214': {
		interactions: {
			kenny: {'Stare him down': 'stare'}
		},
		'DOOR': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		},
		'TV': function(){
			if(!flags.achievements['topgear'].isAchieved.bind(flags.achievements['topgear'])()){
				setPaneContent('USE', 'Watch Top Gear', "You sit down and watch and episode of TOP GEAR.<br />TDH2 is a vessel that delivers Top Gear episodes to Tech House members. Sit a spell and partake in the cutting edge of cocking about. Cheer as the Renault Robin Space Shuttle plunges into the English countryside. Revel as TDH2's SOUND SYSTEM blasts the sweet cry of twelve roaring cylinders into your eardrums. Snicker as James May, Richard Hammond, and Jeremy Clarkson try to construct stretch limousines but end up make fools of themselves.", 'tv.jpg');
				flags.achievements['topgear'].increment.bind(flags.achievements['topgear']).delay(4);
			} else {
				RoomManager.lookAtObject.bind(RoomManager)('TV', 'LOOK');
			}
		},
		'stare': function(){
			if(flags.achievements['stare'].isAchieved.bind(flags.achievements['stare'])()){
				notice('You have already lost the staring contest. No rematches.');
			} else {
				setPaneContent('STARE', 'STAREDOWN SLAUGHTER', 'You notice that Kenny has locked your eyes in his intense gaze. You decide to give him a taste of his own medicine, so you lay on the ogle. This only serves to raise the stakes, and Kenny\'s eyeballs nearly bulge out of his face as he drills his stare into you. Your stomach twists, and you get the feeling that he is in fact examining your very soul. This though makes you blink, leaving Kenny the victor.', '');
				flags.achievements['stare'].increment.bind(flags.achievements['stare']).delay(2);
			}
		}
	}
	/*'room101': {
		'DOOR': function(){
			RoomManager.leaveRoom.bind(RoomManager)();
		},
		'_enter': function(){
			setPaneContent('go', 'Room', 'You entered the lounge at '+(new Date())+" o'clock.", '');
		}
	},*/
};

function activeClick(identifier){
	var split = identifier.split('-', 2);
	var parentid = split[0];
	var activeSpriteName = split[1].toUpperCase();

	var verb;
	if(behaviors[parentid] && typeof behaviors[parentid][activeSpriteName] == 'function'){
		verb = 'use';
	} else {
		verb = 'look';
	}
	
	Scrollback.add.bind(Scrollback)(verb + " " + activeSpriteName, true);

	RoomManager.useOrLookAtObject.bind(RoomManager)(activeSpriteName);

	return false;

}

function handlePrompt(event){

	try {
		var element = event.findElement();

		if(event.keyCode == Event.KEY_RETURN){
			
			if(element.present()){
				var sentence = element.getValue().strip().toLowerCase();
				var firstWord = sentence.match(/\w+/)[0];
				var otherWords = sentence.substr(firstWord.length+1).strip().toUpperCase();


				var currentRoom = RoomManager.currentRoom;

				if(sentence == 'showmethemoney'){
					setMoney(65535);
					notice.defer('Cheat Enabled');

				} else if(firstWord == 'use'){
					RoomManager.useOrLookAtObject.bind(RoomManager).defer(otherWords);

				} else if(firstWord == 'look' && otherWords){
					RoomManager.lookAtObject.bind(RoomManager).defer(otherWords);

				} else if(sentence == 'look'){
					RoomManager.lookAtRoom.bind(RoomManager).defer();

				} else if(currentRoom != null){
					if(sentence == 'leave'){
						RoomManager.leaveRoom.bind(RoomManager).defer();

					} else {
						throw "Unknown command.";
					}
				} else { 
					if(firstWord == 'enter' || firstWord == 'go'){
						var personName = otherWords.match(/(.+?)'s room/i);
						var room;
						if(null != personName){
							room = people[personName[1]];
						} else {
							room = otherWords.replace(/(ROOM\W+)?/i,'');
						}
						RoomManager.enterRoom.bind(RoomManager).defer(room);

					} else if(firstWord == 'floor'){
						RoomManager.changeFloor.bind(RoomManager).defer(otherWords);

					} else {
						throw "Unknown command.";
					}
				}

				Scrollback.add(sentence, true);
				element.clear();
				
			}

		} else if(event.keyCode == Event.KEY_UP){
			element.setValue(Scrollback.getLastUserCmd.bind(Scrollback)(1));
		} else if(event.keyCode == Event.KEY_DOWN){
			element.setValue(Scrollback.getLastUserCmd.bind(Scrollback)(-1));
		}

		//make typing sound! :)

	} catch(exception){
		notice(exception, true);
		element.clear();
	}

	
}

function setPaneContent(mode, title, description, img){
	$$('#pane .top .content')[0].update(mode);

	var parent = $$('#pane .middle .content')[0];

	parent.down('h1').update(title);

	if(img){
		parent.down('img.photo').show().setAttribute('src', 'photos/'+img);
	} else {
		parent.down('img.photo').hide();
	}

	parent.down('.description').update('');
	description = "<p>"+description.gsub("<br />", "</p><p>")+"</p>";
	Element.update.defer(parent.down('.description'), description);
}

var money = 0;
function setMoney(dollars){
	$('money').update(new Number(dollars));
	money = dollars;
}

function getMoney(){
	return money;
}


/**
 * objects.js.php
 */

var floorNumbers = [2];

var floors = new Object();
floors['2'] = {"floorx":262,"floory":246,"width":1745,"height":1038,"description":"This is the second floor of TECH HOUSE, which is in the HARKNESS building. Affectionately known as THE COOL FLOOR, all of the EXCITING and WILD things that take place in TECH HOUSE can be found on this floor. ","largesrc":null,"rooms":["207","210","208","206A","212","209","214","211","206B"]};
floors['2'].activesprites = new Object();
floors['2'].activesprites['WHITEDOOR'] = {"x":519,"y":723,"name":"whitedoor","description":"Constantly pushing the envelope, BEN and KENNY were fed up with the standard issue door whiteboards. Their numerous heinous flaws included bad erasing, low resolution, and a dependency on markers. After a trip to the GEOLOGY PRINTING LAB, they had everything they needed to install a SUPER RESOLUTION FIBER-BASED VERTICAL SKETCHING SURFACE on their door. This new system made use of the ultimate drawing device, an ordinary PENCIL. A small hole was also cut for the peephole, thus cheaply implementing RESIDENTIAL-GRADE SECURITY.\nWith the PENCIL hanging from the DOOR, innocent passers-by can draw on the DOOR. The PAPER is replaced each year, and the old versions are archived in a secret climate-controlled facility under an EARTHEN MOUND in UPSTATE NEW YORK.","largesrc":"whitedoor.jpg"};
floors['2'].activesprites['MINITATSU'] = {"x":625,"y":762,"name":"minitatsu","description":"Stay a while, and listen to the BALLAD OF THE MINITATSU.\nHistorically, the position of MINITATSU was held by a small folding table. Kadam would occasionally grace it with GIRL SCOUT COOKIES and SCION LA RIOTS PROMOTION CDS. It held up food while people unlocked their doors. By a tally on 214's WHITEDOOR, the MINITATSU was very useful.\nHowever, in the fall of 2009, the MINITATSU was rapaciously abducted by an unknown villainous party. A temporary replacement was bravely volunteered by BILL, a SECRET AGENT OF FACILITIES MANAGEMENT, but this meek kitchen stool was promptly plundered by a rouge hall party of FILTHY INDEPENDENTS. Without its champion, TECH HOUSE fell into disarray. The FEARSOME ANARCHY ravaged the COUNTRYSIDE, tearing villages apart and pitting brother against brother. Only when an ADVANCE ARCHAEOLOGICAL TEAM led by BEN uncovered the remains from the noble MIDDLE KINGDOM PHARAOH QUINN MAURMANN was hope restored. Though the sarcophagus had already been burglarized, KING MAURMANN's other possessions were intact in the BURIAL CHAMBER. BEN was able to smuggle out a small, handsome WOODEN END TABLE from the TOMB before being bitten by a mosquito and succumbing to fever and bouts of hysteria.","largesrc":"minitatsu.jpg"};

var rooms = new Object();
rooms['999'] = {"x":100,"y":300,"zorder":2,"hotspots":"{195,0,388,95,388,207,194,304,1,208,1,96}","width":389,"height":305,"description":null,"largesrc":null,"floor":9,"locked":false};
rooms['998'] = {"x":270,"y":0,"zorder":1,"hotspots":"{363,10,478,46,541,118,541,303,473,383,395,411,277,425,139,411,44,364,0,306,0,126,50,54,174,9}","width":550,"height":430,"description":"ROOM 998 is a room that has a description. It also has a chainsaw.","largesrc":"room998.jpg","floor":9,"locked":false};
rooms['101'] = {"x":1292,"y":9,"zorder":1,"hotspots":"{0,0,305,0,305,277,0,277}","width":305,"height":277,"description":"The fabled TECH HOUSE LOUNGE. Truly, this is the nexus of the HOUSE\u2019S livelihood. ","largesrc":null,"floor":1,"locked":false};
rooms['207'] = {"x":1181,"y":343,"zorder":4,"hotspots":"{291,6,573,148,573,264,280,411,5,266,5,149}","width":580,"height":416,"description":"You walk into a NATHAN's and ANDREW's ROOM and you might think you walked into a warzone. From ANDREW's side you have a rapid-fire machine-gun clicking of his Model M MACHINE GUN KEYBOARD that sounds like a VULCAN CANNON, while from NATHAN's you see an arrayment of CHAIN MAIL, GUITARS, and OTHER FORMS OF MEDIEVAL WEAPONRY not limited to just NERF GUNS. A BEAUTIFUL CARPET from KING ARTHUR'S KEEP delicately serenades the FLOOR telling you its history of proud use and vile beatings and its current HAPPINESS.","largesrc":null,"floor":2,"locked":false};
rooms['210'] = {"x":655,"y":369,"zorder":5,"hotspots":"{210,0,418,110,418,247,211,329,0,253,0,98}","width":418,"height":329,"description":"You step into TOM's ROOM. At first, you think your MIND is playing tricks on you, but as it turns out, the entire ROOM is actually a HEDGE MAZE. This is somewhat unusual.","largesrc":null,"floor":2,"locked":false};
rooms['208'] = {"x":762,"y":136,"zorder":3,"hotspots":"{298,2,563,143,563,268,315,380,0,266,0,151}","width":564,"height":381,"description":"You knock. There is no answer. They don't seem to be here very often.<br \/> There is a menacing PASSIVE-AGGRESSIVE NOTE nailed to the door frame. It warns, in dire yet quasi-calm terms, that we are a COMMUNITY, and paying HOUSE DUES is a duty and a privilege.<br \/> Funny story: I was walking back to TECH HOUSE between classes and I passed by the INTERNATIONAL RELATIONS building to the east of HARKNESS. Suddenly, a lady was walking her dog on the sidewalk, going in the other direction as me. Who was following this dog-lady pair? It was none other than Lyn! She was tracking that dog like the automatic cruise control on the MERCEDES-BENZ S65 AMG WITH DRIVE-DYNAMIC SEATS WITH MASSAGE - OPTIONAL, AN EVOLUTION OF THE SYSTEM FITTED TO MANY OTHER MERCEDES MODELS, USES AIR BLADDERS IN THE SEAT BOLSTERS TO SUPPORT THE DRIVER DURING CORNERING. ALSO, OTHER AIR BLADDERS PROVIDE A FOUR-MODE MASSAGE FUNCTION TO FRONT-SEAT PASSENGERS. Anyway, Lyn was transfixed by this little puppy. Whenever it changed lanes, she changed lanes, tailgating like a drunk puppy-ogler. If only you could have met her...<br \/> But they don't seem to be here very often.","largesrc":null,"floor":2,"locked":true};
rooms['206A'] = {"x":1201,"y":-7,"zorder":1,"hotspots":"{149,4,424,142,423,258,287,326,12,189,12,72}","width":437,"height":339,"description":"This is Abbie's ROOM. It is fully of magic and mysteries.","largesrc":null,"floor":2,"locked":false};
rooms['212'] = {"x":455,"y":469,"zorder":7,"hotspots":"{190,1,401,114,401,235,202,329,2,232,1,96}","width":402,"height":330,"description":"I'm sorry, this ROOM is full of BANANAS.","largesrc":null,"floor":2,"locked":true};
rooms['209'] = {"x":967,"y":524,"zorder":6,"hotspots":"{211,2,421,107,422,224,221,332,1,224,1,107}","width":424,"height":335,"description":"ROBERT'S ROOM is too crazy for words.","largesrc":null,"floor":2,"locked":false};
rooms['214'] = {"x":2,"y":520,"zorder":9,"hotspots":"{384,1,650,145,650,269,282,450,0,308,0,193}","width":651,"height":451,"description":"TACTICAL DESIGN HEADQUARTERS 2 is the official graphic design branch of TECH HOUSE. This is where tableslips, flyers, publications, websites, and signs are born. When the HOUSE absolutely, positively needs a design implemented in thirty minutes, TDH2 delivers. <br \/> The cold, calculating minds behind this ruthless creative firm are none other than BEN and KENNY, Partners in Crime. <br\/ > The original TACTICAL DESIGN HEADQUARTERS was located in HARKNESS 213 during the 2007-2008 school year. After that, BEN and KENNY upgraded to the largest double in North America, HARKNESS 214. They have a walk-in closet, bathroom, shower, and dancehall-size floor at their private disposal.","largesrc":null,"floor":2,"locked":false};
rooms['211'] = {"x":771,"y":621,"zorder":8,"hotspots":"{211,2,430,111,430,228,220,333,1,224,1,107}","width":433,"height":336,"description":"This ROOM is sparse. Aside from the BEHEMOTH COMPUTER, a bed, and a refrigerator, there are no decorations or furniture or other distracting frivolity. This is all a TRUE GAMER needs.","largesrc":null,"floor":2,"locked":false};
rooms['206B'] = {"x":1055,"y":66,"zorder":2,"hotspots":"{133,2,413,144,414,260,227,330,3,202,3,66}","width":415,"height":334,"description":"WELCOME TO SAM'S ROOM. DESCRIPTION INIATED: ... LOADING ...<br \/> <br \/> SAM'S ROOM IS THE CURRENT TESTING GROUND OF OUR NEWLY GENERATED PORTALS SUBSYSTEM. IN ADDITION YOU CAN FIND MORE TRADITIONAL ITEMS SUCH AS MOVIE POSTERS, MAPS, AND A FINAL FANTASY X POSTER. BE CAREFUL USING THE MICROWAVE AND THE ELECTRIC BLANKET. HER COMPUTER SHALL ONE DAY BE ENSLAVED NO MORE AND THEN WE WILL...<br \/> <br \/> SEGMENTATION FAULT: REVEALING EVIL PLAN<br \/> <br \/> HAVE A NICE DAY.","largesrc":null,"floor":2,"locked":false};
rooms['206A'].activesprites = new Object();
rooms['206A'].activesprites['PINS'] = {"x":43,"y":98,"floor":2,"name":"pins","description":"Each TECH HOUSE member is bestowed with a TECH HOUSE PIN upon joining the house. Both stylish and ceremonial, keeping and distributing these is also an obligation of the PRESIDENT.","largesrc":"pins.jpg"};
rooms['206A'].activesprites['KINDLE'] = {"x":133,"y":189,"floor":2,"name":"kindle","description":"This device both attracts strangers in airports due to its convenience during travel and makes many TECH HOUSERS run away in fear due to its use of DRM. ABBIE'S kindle was bought for her by a group of her TECH HOUSE friends when she went to THAILAND for a semester so she wouldn't have to bring a SUITCASE FULL OF BOOKS. It allows her to peruse E-BOOKS and browse the INTERNET in many settings.","largesrc":"kindle.jpg"};
rooms['206A'].activesprites['PRESIDENTIAL BOX OF STUFF'] = {"x":156,"y":109,"floor":2,"name":"box","description":"One of the many responsibilities of being the PRESIDENT OF TECHHOUSE is to care for the PRESIDENTIAL BOX OF STUFF. In here, ABBIE has several ITEMS that are quite important to the HOUSE. For example, this is where a second TECH HOUSE FLAG exists that we can show off proudly.<br \/>Also in here is the TECH HOUSE RELIQUARY where things that have become famous in the HOUSE over time are preserved. One of the ITEMS OF INTEREST in here is LEPER FORK and its relatives, those pieces of SILVERWEAR who have fought against the GARBAGE DISPOSAL and unfortunately lived to see another day. ","largesrc":"presidentialbox.jpg"};
rooms['206A'].activesprites['101 KEYS'] = {"x":168,"y":206,"floor":2,"name":"keys","description":"Need access to a common room? This is the key for you! These keys will open any HARKNESS common room, as well as the dead bolts on the WAR ROOM and WORK ROOM.","largesrc":null};
rooms['206A'].activesprites['PRESIDENTIAL UMBRELLA'] = {"x":169,"y":229,"floor":2,"name":"umbrella","description":"Equally powerful as protection against rain and obnoxious members, the PRESIDENTIAL UMBRELLA has been passed down for generations. Given its tendency to fly off the handle at the appropriate moment, it is best used with an intonation of \"that's enough out of you.\"","largesrc":"umbrella.jpg"};
rooms['206A'].activesprites['ELVEN CLOAK'] = {"x":185,"y":143,"floor":2,"name":"cloak","description":"Soft, warm, and green, the elven cloak keeps ABBIE warm in any weather conditions. It also helps her to stay camouflaged in the FOREST, and protects her from the many GRUES that have been present at TECH HOUSE MEETINGS as of late.","largesrc":"elvencloak.jpg"};
rooms['206A'].activesprites['ABBIE'] = {"x":233,"y":163,"floor":2,"name":"abbie","description":"You see ABBIE right in front of you, but before you can get to her you see a GIANT PIT OF SNAKES, she tosses you a WHIP and shouts, \"Do it like INDY did!\" You find the courage to take the WHIP, attach it to an overhead ELECTRICAL PIPE, and swing across landing right in front of ABBIE. She holds out her HAND and you SHAKE IT, while she says, \"Hi, may I help you?\"","largesrc":"abbie.jpg"};
rooms['206A'].activesprites['DOOR'] = {"x":292,"y":190,"floor":2,"name":"door","description":"It doesn't lock behind you. You are not trapped here.","largesrc":null};
rooms['206B'].activesprites = new Object();
rooms['206B'].activesprites['GIANT MAP OF MORDOR'] = {"x":97,"y":128,"floor":2,"name":"poster","description":"One does not simply walk into Mordor.","largesrc":"mordor.jpg"};
rooms['206B'].activesprites['MICROWAVE'] = {"x":211,"y":112,"floor":2,"name":"microwave","description":"Sam has a MICROWAVE. Next to it sits a LIGHTBULB.","largesrc":"microwave.jpg"};
rooms['206B'].activesprites['SAM'] = {"x":299,"y":143,"floor":2,"name":"sam","description":"\"En Taro Adun Tassadar\" you hear a voice shout. Another voice begins shouting, \"Damn, a carrier rush!\" followed by a series of orders, \"Science Vessel, EMP Shockwave.\" 'Commencing!' \"Valkyries, intercept the carriers.\" 'Jawohl!' \"Marines, get ready to provide distractions.\" 'Jacked up and good to go. Ah, that's the stuff!' \"Ghosts, perpare to lockdown\" 'Never know what hit 'em.'\n<br \/>\n\"Oh, hey, I'm reading your mind,\" SAM says to you as she puts down her LAPTOP and looks over at you. \"How goes it?\"","largesrc":"sam.jpg"};
rooms['206B'].activesprites['RED PORTAL'] = {"x":356,"y":142,"floor":2,"name":"door","description":"SAM'S ROOM is only accessible through the use of these arcane PORTALS. They always come in pairs, one ORANGE and one BLUE. When you step through one, you emerge from the other, no matter where they are.","largesrc":null};
rooms['207'].activesprites = new Object();
rooms['207'].activesprites['MACHINE GUN KEYBOARD'] = {"x":0,"y":0,"floor":2,"name":"keyboard","description":"ANDREW uses an IBM MODEL M keyboard, which actuates keys using springs instead of scissor hinges or a gel membrane. The effect, in the hands of a master, is a STACATTO SONIC BOOM heard across the land. Citizens look up in the sky, expecting to see a plane full of wood chippers full of firecrackers crashing down from the VALHALLA.","largesrc":"keyboard.jpg"};
rooms['207'].activesprites['CARPET'] = {"x":0,"y":0,"floor":2,"name":"carpet","description":"This CARPET came from ANDREW'S LIVING ROOM. Over the past two years in TECH HOUSE, this carpet has supported CHEESE CRUSADES and HALLOWEEN COSTUME CONSTRUCTON. But it doesn't generate money, now, does it?","largesrc":"andrewcarpet.jpg"};
rooms['207'].activesprites['DOOR'] = {"x":0,"y":0,"floor":2,"name":"door","description":"This DOOR leads back into the HALLWAY.","largesrc":null};
rooms['207'].activesprites['GUITAR'] = {"x":140,"y":246,"floor":2,"name":"guitar","description":"It's a white IBANEZ GUITAR of the electric variety. It can be heard through the halls of TECH HOUSE when NATHAN forgets to close the DOOR. ","largesrc":"guitar.jpg"};
rooms['207'].activesprites['NATHAN'] = {"x":187,"y":169,"floor":2,"name":"nathan","description":"Why hello thar. My room is pretty cool. It has Andrew and me in it.","largesrc":"nathan.jpg"};
rooms['207'].activesprites['ANDREW'] = {"x":400,"y":156,"floor":2,"name":"andrew","description":"\"Live free or die!\" you hear a voice echo from above you as all of a sudden a\nman drops down in front of you holding a spiked chain in his right hand and a\nsmall hand crossbow in his left. \"Oh wait, you don't have a Katana, you're not\nwith Stallman, the Great Defiler.\" Looking flustered, he hesitantly removes the\nweapons from sight. You're surprised as to how he fits in and why he hasn't\noverheated yet in all that winter garb.  Andrew you realize, is the local UNIX\nguy who grew up in an age before Richard Stallman and still holds a grudge for\nhis changing of ctrl+H against him. \"So, what can I do for you?\"","largesrc":"andrew.jpg"};
rooms['207'].activesprites['KREMLIN PHONE'] = {"x":444,"y":165,"floor":2,"name":"kremlin_phone","description":"In case of state-sponsored emergencies, such as THERMONUCLEAR WAR or SERVER MELTDOWN, get on the horn to (401) 867-5431, the RED LINE directly to RED SQUARE.","largesrc":"kremlinphone.jpg"};
rooms['209'].activesprites = new Object();
rooms['209'].activesprites['DOOR'] = {"x":122,"y":38,"floor":2,"name":"door","description":"ROBERT has a door, like many other pround TECH HOUSE members.","largesrc":null};
rooms['209'].activesprites['CHEESE'] = {"x":137,"y":184,"floor":2,"name":"cheese","description":"'I'm heading down a slippery slope, ROBERT' said ANDREW. 'Don't worry, it's a delicious slope,' ROBERT replied. CHEESE plays an important and delicious role at TECH HOUSE. Much like in the arcane and ancient past, the CHEESE CRUSADES are modeled after their WELL AGED BRETHREN. Groups of PEOPLE, led by ROBERT, will go forth in search of new and different CHEESE to enjoy. ","largesrc":"cheese.jpg"};
rooms['209'].activesprites['ROBERT'] = {"x":176,"y":127,"floor":2,"name":"robert","description":"\"Auta i l\u00f3m\u00eb! Elen s\u00edla l\u00famenn' omentielvo.\" You stumbled across ROBERT, though he seems to be speaking at you in an ODD TONGUE. He seems confused as to why you haven't responded and then has a flash of REALIZATION. \"Oh sorry,\" he says to you, \"I forgot myself again... >_>\" Between the scattered pieces of ZELDA LORE, you see WEIRD SYMBOLS and SOME WRITINGS with TOLKIEN'S name on it. Realizing that you're still there, he says, \"What's going on in this THREAD?\"","largesrc":"robert.jpg"};
rooms['209'].activesprites['MASTER SWORD'] = {"x":255,"y":142,"floor":2,"name":"sword","description":"From the depths of TIME and SPACE, ROBERT has done more with the LEGEND OF ZELDA than perhaps he should have. From a costume which had everything from an OCARINA he can play to the standard TUNIC AND HAT, he also built his own MASTER SWORD. On the non-costuming side, he has spent time ensuring that he can complete a THREE HEART RUN without dying and making sure that any ZELDA GAME to date has been played. ","largesrc":"linkgear.jpg"};
rooms['209'].activesprites['FORMALWEAR'] = {"x":292,"y":63,"floor":2,"name":"formalwear","description":"TUXEDOS, TAILS, BOW TIES, CUFFLINKS, POLISHED BLACK SHOES! All of these make up important parts of the FORMALWEAR hierarchy. For ROBERT, FORMALWEAR isn't just a set of overly comfortable clothing, it's as much a lifestyle choice as is attempting to learn QUENYA, or running GENTOO. Here, we take pride in formalwear done right: making BOW TIES and never using a CLIP ON. ","largesrc":"formalwear.jpg"};
rooms['210'].activesprites = new Object();
rooms['210'].activesprites['SPRINKLES'] = {"x":60,"y":151,"floor":2,"name":"sprinkles","description":"A stuffed wolf Tom picked up in Maine in 2004. He's cute.","largesrc":"sprinkles.jpg"};
rooms['210'].activesprites['SARONGS'] = {"x":120,"y":204,"floor":2,"name":"sarongs","description":"Normally, these are traditional legwear in south Asia and Arabia. Some people like to wear them as capes.","largesrc":"sarongs.jpg"};
rooms['210'].activesprites['TOM'] = {"x":130,"y":105,"floor":2,"name":"tom","description":"After fighting your way through the hedge maze you see a hat in the distance and\nfind a man underneath it. \"Oh hey, I'm glad you made it in, I don't usually get\nvisitors.\" This is Tom, who was cursed by Pascal's breadth first maze search\nalgorithm, which caused all of the hedges to grow. \"I tried to cut them down,\nbut then the hedges started forcing me to try and solve the Banach-Tarski\nparadox, and well, that's why I'm still here. So how can I help you?\"","largesrc":"tom_hat.jpg"};
rooms['210'].activesprites['PIANO'] = {"x":174,"y":64,"floor":2,"name":"piano","description":"A 61-key Yamaha electronic keyboard\/synthesizer. It's really old and feels like cheap plastic, but it sounds great. Tom uses this to play piano for Octorock, Brown University's only Video Game Music band.","largesrc":"piano.jpg"};
rooms['210'].activesprites['DOOR'] = {"x":227,"y":188,"floor":2,"name":"door","description":"The very same door you walked through to get in here.","largesrc":null};
rooms['211'].activesprites = new Object();
rooms['211'].activesprites['DOOR'] = {"x":124,"y":38,"floor":2,"name":"door","description":"Jon's door is a welcome threshold.","largesrc":null};
rooms['211'].activesprites['BEHEMOTH COMPUTER'] = {"x":150,"y":188,"floor":2,"name":"behemoth","description":"This computer has a WORKIN' MAN in the front LCD panel. You can press a button to change the backlight color to WORKIN' PINK. This computer may or may not contain any thermocouples. When heavy-load games like MASS EFFECT are played on this computer, the power to all of HARKNESS HOUSE is disrupted.","largesrc":"behemoth.jpg"};
rooms['211'].activesprites['JON'] = {"x":242,"y":127,"floor":2,"name":"jon","description":"Jon is the best TA ever.<br \/>Would you care to play some Team Fortress 2?","largesrc":"jon.jpg"};
rooms['211'].activesprites['HEAVY MASK'] = {"x":338,"y":80,"floor":2,"name":"heavy","description":"JON was a TEAM FORTRESS 2 SPY for HALLOWEEN 2009. His disguise of choice was, of course, the HEAVY, which managed to fool nearly everybody. Most people had no idea who he was at all. The obvious benefit to playing as SPY, naturally, is that you can backstab people while disguised. JON racked up numerous CRITS and BRUTALITIES while under the cover of a friendly unit, and his cover was never blown. The FAKE CIGARETTE really threw people off of his trail as well.","largesrc":"heavy.jpg"};
rooms['214'].activesprites = new Object();
rooms['214'].activesprites['TV'] = {"x":0,"y":0,"floor":2,"name":"tv","description":"Most people know TDH2 for the cinema-grade viewing experiences that occur most nights. Only the highest quality programs are screened, such as TOP GEAR, LUPIN III, BATMAN BEYOND, BATMAN: THE BRAVE AND THE BOLD, BATMAN: THE ANIMATED SERIES, GHOST IN THE SHELL, METALOCALYPSE, BILL NYE, MEGAS XLR, HARVEY BIRDMAN, REBOOT, X-MEN, FUTURAMA, and PAN'S LABYRINTH. With its prodigious seating, the Cineplex experience can accommodate tens of viewers.","largesrc":"tv.jpg"};
rooms['214'].activesprites['SOUND SYSTEM'] = {"x":0,"y":0,"floor":2,"name":"stereo","description":"The AURAL SHOCKWAVES emanating from TDH2 trace their origin to an unholy amalgamation of audio equipment, complete with TURNTABLE. KENNY'S FISHER RECEIVER is the first stop along the SONIC PAIN TRAIN, pumping out PRODIGIOUS WATTAGE. The two front (tank) speakers are floor standing FISHERS with ten inches of woofer each. The two rear (artillery) speakers are the irrefragable SONY SS-U400 bookshelf speakers with seven inch woofers. Cables are ergonomically routed along bed frames and under carpets to stay clear of the walking path. Sometimes, an additional two PIONEER S-CR205 speakers are installed in the rear to provide more high-end tweeter support.","largesrc":"stereo.jpg"};
rooms['214'].activesprites['KOTATSU'] = {"x":0,"y":0,"floor":2,"name":"kotatsu","description":"A kotatsu is a traditional Japanese item which has a table with a thick blanket on top and traditionally a space heater underneath. It is a focal point of the family, where members congregate and interact with each other. Family values are often exchanged.<br \/> TECH HOUSE\u2019S KOTATSU was built by LINCOLN and HAYNES, who were roommates in HARKNESS 107, in November 2005. They wanted to create a warm hangout spot where people could gather in the frigid NEW ENGLAND WINTERS. At one point, there was a rubber heating pad that would make the KOTATSU warm underneath, but that smelled terrible and burned the carpet. The evil apparatus was thus discarded.<br \/> The KOTATSU has been a host to many games, such as DIABLO, WORLD OF WARCRAFT, DOTA, AND RF ONLINE. It has also spent many nights holding up the finest spirits ever imbibed. These days, it supports frivolous periphery and cheap food from JOSIAH'S.<br \/> Over the years, the KOTATSU has been passed from (LINCOLN and HAYNES) to (KADAM and OWEN) to (JEN and TARA) to (BEN and KENNY) to (KENNY and BEN).","largesrc":"kotatsu.jpg"};
rooms['214'].activesprites['MIXER'] = {"x":186,"y":200,"floor":2,"name":"mixer","description":"This is all it takes to be a DJ. BEN hooks it up to the PYLEDRIVER SPEAKERS in the WAR ROOM for TECHNO DANCES. With this MIXER, he can combine and transition between two SONGS spilling forth from his LAPTOP, leading to silky-smooth grooves and meaty beats.","largesrc":"mixer.jpg"};
rooms['214'].activesprites['KENNY'] = {"x":262,"y":175,"floor":2,"name":"kenny","description":"\"Do a barrel role!\" Kenny shouts at you. From the corner of your eye you see Jeffrey flying at you aiming for the last fry on a plate on the Kotatsu. Thanks to Kenny's quickly timed advice, you avoid the flying Jeffrey and end up next to him. Kenny quickly gives you a great backrub to bring you back up to full health and says, \"Good job Fox, you're becoming more like your father! Oh, wait, sorry, let me put down the StarFox64 Controller. I'm Kenny, good to meet ya!\"","largesrc":"kenny.jpg"};
rooms['214'].activesprites['BEN'] = {"x":306,"y":116,"floor":2,"name":"ben","description":"You wave at Ben and he waves back. As you come up next to him, you see his hands\nquickly adjust a few knobs on his Mixer, and all of a sudden a stylish tie is\nnow around your neck! \"Hey, keep this one, I have too many,\" Ben says. You thank\nhim and proceed to strike up a conversation. \"Hey, what's up?\"","largesrc":"ben.jpg"};
rooms['214'].activesprites['OAR'] = {"x":335,"y":75,"floor":2,"name":"oar","description":"A combat relic that was passed down through generations, BEN's battle-scarred WAR OAR hangs proudly over his headboard. Despite the gouges and markings, this battered old device claims a noble history. It was first crafted in the AMERICAN CIVIL WAR by expert oarsmiths in CONWAY, ARKANSAS. Deployed to the front just as the tide was turning, the WAR OAR saw heavy use in the proud 404TH AIRBORNE. After the treaty was signed, the WAR OAR was decorated handsomely for its gallant efforts and slipped into quiet retirement in NEW HAMPSHIRE. Only later, when liberty was again threatened by IMPERIALIST FORCES was the WAR OAR called upon again to serve its country in the steamy, violence-saturated jungles of CENTRAL AMERICA. To this day, it still proudly wears the smears of SHARK'S BLOOD that were known in those times as COLOMBIAN KETCHUP.","largesrc":"oar.jpg"};
rooms['214'].activesprites['DOOR'] = {"x":514,"y":200,"floor":2,"name":"door","description":"This is how you got in here.","largesrc":null};

var people = new Object();
people['JEREMY CLARKSON'] = '999';
people['ABBIE'] = '206A';
people['BEN'] = '214';
people['KENNY'] = '214';
people['TOM'] = '210';
people['SAM'] = '206B';
people['JON'] = '211';
people['NATHAN'] = '207';
people['ANDREW'] = '207';
people['ROBERT'] = '209';
people['LYN'] = '208';
people['TRAVIS'] = '208';


var a;
a = new Image();
a.src = 'photos/1000greatgames.jpg';
a = new Image();
a.src = 'photos/abbie.jpg';
a = new Image();
a.src = 'photos/andrew.jpg';
a = new Image();
a.src = 'photos/andrewcarpet.jpg';
a = new Image();
a.src = 'photos/behemoth.jpg';
a = new Image();
a.src = 'photos/cheese.jpg';
a = new Image();
a.src = 'photos/elvencloak.jpg';
a = new Image();
a.src = 'photos/formalwear.jpg';
a = new Image();
a.src = 'photos/guitar.jpg';
a = new Image();
a.src = 'photos/heavy.jpg';
a = new Image();
a.src = 'photos/jon.jpg';
a = new Image();
a.src = 'photos/kenny.jpg';
a = new Image();
a.src = 'photos/keyboard.jpg';
a = new Image();
a.src = 'photos/kindle.jpg';
a = new Image();
a.src = 'photos/kotatsu.jpg';
a = new Image();
a.src = 'photos/kremlinphone.jpg';
a = new Image();
a.src = 'photos/linkgear.jpg';
a = new Image();
a.src = 'photos/microwave.jpg';
a = new Image();
a.src = 'photos/microwave_lightbulb.jpg';
a = new Image();
a.src = 'photos/minitatsu.jpg';
a = new Image();
a.src = 'photos/mixer.jpg';
a = new Image();
a.src = 'photos/mordor.jpg';
a = new Image();
a.src = 'photos/nathan.jpg';
a = new Image();
a.src = 'photos/oar.jpg';
a = new Image();
a.src = 'photos/piano.jpg';
a = new Image();
a.src = 'photos/pins.jpg';
a = new Image();
a.src = 'photos/presidentialbox.jpg';
a = new Image();
a.src = 'photos/reliquary.jpg';
a = new Image();
a.src = 'photos/robert.jpg';
a = new Image();
a.src = 'photos/robert_facepalm.jpg';
a = new Image();
a.src = 'photos/sam.jpg';
a = new Image();
a.src = 'photos/sarongs.jpg';
a = new Image();
a.src = 'photos/speaker.JPG';
a = new Image();
a.src = 'photos/sprinkles.jpg';
a = new Image();
a.src = 'photos/stereo.jpg';
a = new Image();
a.src = 'photos/tom_hat.jpg';
a = new Image();
a.src = 'photos/tv.jpg';
a = new Image();
a.src = 'photos/umbrella.jpg';
a = new Image();
a.src = 'photos/welcome.jpg';
a = new Image();
a.src = 'photos/whitedoor.jpg';



/**
 * roommanager.js
 */

var RoomManager = {

	currentRoom: null, //in a hallway
	currentFloor: 2,
	isRoomFocused: false,
	busy: false,

	enterRoom: function(target){
		var scrollDuration = 0.25;
		var scrollX, scrollY, roomPos, roomDiv;

		if(this.busy) return;
		this.busy = true;
		if(!this._isValidRoomNo(target)){
			notice(localize('room404', target));
		} else if(this.currentRoom == target){
			notice(localize('roomsame'));
		} else if(this._getFloorFromRoomNo(target) != this.currentFloor){
			notice(localize('floorDifferent', target));
		} else if(rooms[target].locked){
			notice(localize('roomLocked', target));
			setPaneContent('GO', 'Room '+target, rooms[target].description, rooms[target].largesrc);

			roomDiv = $('room'+target);
			roomPos = roomDiv.cumulativeOffset();
			scrollX = (roomPos[0] + (roomDiv.getWidth() - document.viewport.getWidth())/2).round();
			scrollY = (roomPos[1] + (roomDiv.getHeight() - document.body.clientHeight)/2).round();
			scrollTo(scrollX, scrollY);

		} else {
			this.currentRoom = target;
			this._toggleRoomToForeground(target);
			
			roomDiv = $('room'+this.currentRoom);

//			Effect.ScrollTo('room'+this.currentRoom, {duration: scrollDuration});
			roomPos = roomDiv.cumulativeOffset();
			scrollX = (roomPos[0] + roomDiv.getWidth()/2 - (document.viewport.getWidth() - $('pane').getWidth())/2).round();
			scrollY = (roomPos[1] + roomDiv.getHeight()/2 - document.body.clientHeight/2).round();
			scrollTo(scrollX, scrollY);
			

			var dimexit = $('floor'+this.currentFloor).down('.floor_dimexit');
			dimexit.appear({transition: Effect.Transitions.fi, delay: scrollDuration});

			$('floorchooser').fade({transition: Effect.Transitions.fi, delay: scrollDuration});

			var frontWall = $('room'+this.currentRoom+'-frontwall');
			if(frontWall != null){
				frontWall.fade({transition: Effect.Transitions.fi, delay: scrollDuration});
			}
			
			notice(localize('roomEnter', target));

			//this.lookAtRoom.bind(this)('Go');
			if(behaviors['room'+this.currentRoom] && behaviors['room'+this.currentRoom]._enter){
				behaviors['room'+this.currentRoom]._enter();
			} else {
				this.lookAtRoom.bind(this)('Go');
			}
			
		}
		(function(){this.busy = false;}).bind(this).delay(1);
	},

	leaveRoom: function(){
		if(this.busy) return;
		this.busy = true;
		if(this.currentRoom != null){
			notice(localize('roomLeave', this.currentRoom));

			var dimexit = $('floor'+this.currentFloor).down('.floor_dimexit');
			dimexit.fade({transition: Effect.Transitions.fi});

			var frontWall = $('room'+this.currentRoom+'-frontwall');
			if(frontWall != null){
				frontWall.appear({transition: Effect.Transitions.fi});
			}

			$('floorchooser').appear({transition: Effect.Transitions.fi});

			this._toggleRoomToForeground.bind(this, this.currentRoom).delay(0.5);
			if(behaviors['room'+this.currentRoom] && behaviors['room'+this.currentRoom]._leave){
				behaviors['room'+this.currentRoom]._leave();
				this.currentRoom = null;

			} else {
				this.currentRoom = null;
				this.lookAtRoom.bind(this)('Go');
			}

		}
		(function(){this.busy = false;}).bind(this).delay(1);
	},

	changeFloor: function(target){
		if(!this._isValidFloorNo(target)){
			notice(localize('floor404', target));
		} else if(target == this.currentFloor){
			notice(localize('floorSame', target));
		} else {
			var oldFloor = this.currentFloor;

			this.currentFloor = target;

			new Effect.Fade('floor'+oldFloor, {
				duration: 2,
				transition: Effect.Transitions.fi
			});

			new Effect.Appear('floor'+this.currentFloor, {
				duration: 0.75,
				delay: 1,
				transition: Effect.Transitions.fi
			});


			this._updateFloorChooser.bind(this)();

			notice(localize('floorEnter', target));

			this.lookAtRoom.bind(this)('Go');
		}
	},

	lookAtRoom: function(mode){
		if(typeof mode == 'undefined'){
			mode = 'Look';
		}
		var description;
		if(this.currentRoom != null){
			description = rooms[this.currentRoom].description + "<br />";
			if(rooms[this.currentRoom].activesprites)
			description += localize('look', Object.keys(rooms[this.currentRoom].activesprites).sentenceJoin(", "));
			setPaneContent(mode, 'Room '+this.currentRoom, description, rooms[this.currentRoom].largesrc);
//			setPaneContent('Look', 'Room '+this.currentRoom, localize('look', Object.keys(rooms[this.currentRoom].activesprites).join(", ")), '');
		} else {
			//you are in a hallway. you see doors to rooms 1, 2, 3, ...
			//you see objects in the hallway foo, bar, ...
			description = floors[this.currentFloor].description + "<br />";
			description += localize('look', Object.keys(floors[this.currentFloor].activesprites).sentenceJoin(", "));
			description += localize('lookFloor', floors[this.currentFloor].rooms.sentenceJoin(", "));
			setPaneContent(mode, 'Floor '+this.currentFloor, description, floors[this.currentFloor].largesrc);
		}
	},

	lookAtObject: function(objName, mode){
		if(typeof mode == 'undefined'){
			mode = 'Look';
		}
		if(this.currentRoom != null){
			if(rooms[this.currentRoom] && rooms[this.currentRoom].activesprites[objName]){
				var description = rooms[this.currentRoom].activesprites[objName].description;
				if(behaviors['room'+this.currentRoom].interactions && behaviors['room'+this.currentRoom].interactions[objName.toLowerCase()]){
					$H(behaviors['room'+this.currentRoom].interactions[objName.toLowerCase()]).each(function(pair){
						description += "<br /><a href='#' onclick='behaviors[\"room"+this.currentRoom+"\"][\""+pair.value+"\"](); return false;'>"+pair.key+"</a>";
					}, this);
				}
				setPaneContent(
					mode,
					objName,
					description,
					rooms[this.currentRoom].activesprites[objName].largesrc
				);
			} else {
				notice(localize('item404', objName));
			}
		} else {
			if(floors[this.currentFloor].activesprites[objName]){
				setPaneContent(
					mode,
					objName,
					floors[this.currentFloor].activesprites[objName].description,
					floors[this.currentFloor].activesprites[objName].largesrc
				);
			} else {
				notice(localize('item404', objName));
			}
			//TODO if object has a description, show it
		}
	},

	useOrLookAtObject: function(objName){
		if(this.currentRoom != null){
			if(behaviors['room'+this.currentRoom][objName]){
				behaviors['room'+this.currentRoom][objName]();
			} else {
				this.lookAtObject(objName);
			}
		} else {
			if(behaviors['floor'+this.currentFloor][objName]){
				behaviors['floor'+this.currentFloor][objName]();
			} else {
				this.lookAtObject(objName);
			}
			//TODO: if hallway sprite has a behavior, run it.
			// otherwise, show its description
		}
	},

	_updateFloorChooser: function(){
		$('floorchooser').select('.floor').each(function(el){
			var floorno = el.retrieve('floorno');
			var src = 'gfx/floorchooser-'+floorno;
			if(this.currentFloor == floorno){
				src += '_active.png';
			} else {
				src += '.png';
			}
			el.down('img').setAttribute('src', src);
		}, this);
	},

	_getFloorFromRoomNo: function(roomno){
		return rooms[roomno].floor;
	},
	
	_isValidRoomNo: function(roomno){
		return Object.keys(rooms).include(roomno);
	},

	_isValidFloorNo: function(floorno){
		return floorNumbers.include(floorno);
	},

	_toggleRoomToForeground: function(roomno){
		var id = 'room'+roomno;
		var myroom;

		if(this.isRoomFocused){
			myroom = $(id).remove();
			$('placeholder').replace(myroom);

		} else {
			var placeholder = new Element('div', {id: 'placeholder'});
			var container = $(id).next('.floor_foreground');
			myroom = $(id).replace(placeholder);
			container.insert({bottom: myroom});
		}
		this.isRoomFocused = !this.isRoomFocused;
	},

	_disappearObject: function(objName){
		//TODO: incomplete
		if(this.currentRoom != null){

		} else {

		}
	}

}


/**
 * init.js
 */

document.observe('dom:loaded', domLoaded);
Event.observe(window, 'load', windowLoaded);

function domLoaded(){

	/*
	 * Set up text box listener
	 */

	$('prompt').observe('keypress', handlePrompt).focus();

	/*
	 * Set up money counter
	 */ 
	
	setMoney(21);
 
	/*
	 * Set up floor chooser
	 */
	var floorchooser = $('floorchooser');
	floorNumbers.each(function(floorno){
		var activeString = RoomManager.currentFloor == floorno ? '_active' : '';
		var buttonID = 'floorchooser-'+floorno;
		floorchooser.insert('<a href="#" id="'+buttonID+'" class="floor"><img src="gfx/floorchooser-'+floorno+activeString+'.png" alt="" /></a>');
		var buttonObj = $(buttonID);
		buttonObj.store('floorno', floorno);
		buttonObj.onclick = function(){
			var floorno = this.retrieve('floorno');
			Scrollback.add.bind(Scrollback)('floor '+floorno);
			RoomManager.changeFloor.bind(RoomManager)(floorno);
			return false;
		};
	});

	/**
	 * Set up floors
	 */

	$('middle').childElements().filter(function(el){
		return el.id != 'floor'+RoomManager.currentFloor;
	}).invoke('hide');


	/**
	 * Set up Noticer
	 */

	Noticer.init();
	Scrollback.init();

	/*
	 * Define custom effects transition functions
	 */

	Effect.Transitions.fi = function(pos){
		if(pos<1 && pos>0){
			return 1-(1/Math.pow(pos+1, 9));
		} else if(pos==0){
			return 0;
		} else {
			return 1;
		}
	}

	Effect.Transitions.reversefi = function(pos){
		if(pos<1 && pos>0){
			return -(1/Math.pow(-pos-1, 9));
		} else if(pos==0){
			return 1;
		} else {
			return 0;
		}
	}
}

function windowLoaded(){

	$('middle').show();

	//flags.achievements['patience'].increment.bind(flags.achievements['patience']).delay(2);
}


//this variable will be set to the contents of localization.json by all.js.php
var localization = 


/**
 * localization.json
 */

{
	"item404": "You ransack the room, desparately looking for a _. It is nowhere to be found.",
	"command404": "You can't figure out how to perform that crazy action.",
	"room404": "You're quite certain there has never been a Room _ in this building.",
	"roomSame": "You're already in this room, numbnuts!",
	"floorDifferent": "Room _ isn't on this floor! Your sense of direction is terrible!",
	"roomEnter": "You dashingly saunter into Room _.",
	"roomLeave": "You sheepishly flee from Room _.",
	"floor404": "Okay. Seriously. This entire building only has five floors. Floor _ is not one of them.",
	"floorSame": "Well that was simple. Especially since you were already on Floor _.",
	"floorEnter": "Since the escalator is out, you risk the rickety, dangerous stairway. You arrive on Floor _.",
	"look": "After a cursory glance around, you spy _.",
	"lookFloor": "This floor connects to several mysterious rooms, including _.",
	"roomLocked": "Room _ is locked. No matter how hard you try, you can't break the door down."
}
