text: /******/ (function(modules) { // webpackBootstrap
  /******/ 	// The module cache
  /******/ 	var installedModules = {};
  
  /******/ 	// The require function
  /******/ 	function __webpack_require__(moduleId) {
  
  /******/ 		// Check if module is in cache
  /******/ 		if(installedModules[moduleId])
  /******/ 			return installedModules[moduleId].exports;
  
  /******/ 		// Create a new module (and put it into the cache)
  /******/ 		var module = installedModules[moduleId] = {
  /******/ 			exports: {},
  /******/ 			id: moduleId,
  /******/ 			loaded: false
  /******/ 		};
  
  /******/ 		// Execute the module function
  /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  
  /******/ 		// Flag the module as loaded
  /******/ 		module.loaded = true;
  
  /******/ 		// Return the exports of the module
  /******/ 		return module.exports;
  /******/ 	}
  
  
  /******/ 	// expose the modules object (__webpack_modules__)
  /******/ 	__webpack_require__.m = modules;
  
  /******/ 	// expose the module cache
  /******/ 	__webpack_require__.c = installedModules;
  
  /******/ 	// __webpack_public_path__
  /******/ 	__webpack_require__.p = "";
  
  /******/ 	// Load entry module and return exports
  /******/ 	return __webpack_require__(0);
  /******/ })
  /************************************************************************/
  /******/ ([
  /* 0 */
  /***/ function(module, exports, __webpack_require__) {
  
  	// Generated by CoffeeScript 1.9.3
  	(function() {
  	  var adjust, animate, back_pano, camera, change_pano, container, fallback_image, front_pano, house_id, init, one_dataset, position, renderer, root, scene, slider, texture_placeholder, update;
  
  	  root = __webpack_require__(1);
  
  	  front_pano = void 0;
  
  	  back_pano = void 0;
  
  	  house_id = void 0;
  
  	  position = void 0;
  
  	  fallback_image = "";
  
  	  root.pano_paths = [];
  
  	  root.blur_paths = [];
  
  	  root.full_dataset = {};
  
  	  localStorage.setItem('full_dataset', JSON.stringify(root.full_dataset));
  
  	  one_dataset = {
  	    "pano_path": void 0,
  	    "hotspot": {}
  	  };
  
  	  root.Config = {
  	    img_name: ['r', 'l', 'u', 'd', 'f', 'b'],
  	    webgl: true,
  	    lon: 0,
  	    lat: 0
  	  };
  
  	  container = $("#container");
  
  	  scene = new THREE.Scene;
  
  	  texture_placeholder = $('<canvas/>').width(128).height(128);
  
  	  renderer = new THREE.WebGLRenderer;
  
  	  renderer.setPixelRatio(window.devicePixelRatio);
  
  	  container.append(renderer.domElement);
  
  	  renderer.setSize(container.outerWidth(), container.outerHeight());
  
  	  camera = new THREE.PerspectiveCamera(90, container.outerWidth() / container.outerHeight(), 1, 1100);
  
  	  camera.target = new THREE.Vector3(0, 0, 0);
  
  	  animate = function() {
  	    requestAnimationFrame(animate);
  	    if (root.Config.target_lon !== void 0 && root.Config.current_lon !== void 0 && Math.abs(root.Config.target_lon - root.Config.current_lon) > 0.1) {
  	      root.Config.current_lon = root.Config.current_lon + (root.Config.target_lon - root.Config.current_lon) * 0.15;
  	      root.Config.lon = (root.Config.current_lon + 360) % 360;
  	    }
  	    if (root.Config.target_lat !== void 0 && root.Config.current_lat !== void 0 && Math.abs(root.Config.target_lat - root.Config.current_lat) > 0.1) {
  	      root.Config.current_lat = root.Config.current_lat + (root.Config.target_lat - root.Config.current_lat) * 0.15;
  	      root.Config.lat = root.Config.current_lat;
  	    }
  	    update();
  	  };
  
  	  update = function() {
  	    var phi, theta;
  	    root.Config.lon = (root.Config.lon + 360) % 360;
  	    root.Config.lat = Math.max(-35, Math.min(35, root.Config.lat));
  	    phi = THREE.Math.degToRad(90 - root.Config.lat);
  	    theta = THREE.Math.degToRad(root.Config.lon);
  	    camera.target.x = 500 * Math.sin(phi) * Math.cos(theta);
  	    camera.target.y = 500 * Math.cos(phi);
  	    camera.target.z = 500 * Math.sin(phi) * Math.sin(theta);
  	    camera.lookAt(camera.target);
  	    renderer.render(scene, camera);
  	  };
  
  	  init = function(scrollid, num_panos) {
  	    var i, test;
  	    test = "";
  	    i = 1;
  	    while (i <= num_panos) {
  	      test = test + "<option value='" + i + "'>pano" + i + "</option>";
  	      i++;
  	    }
  	    return document.getElementById(scrollid).innerHTML = test;
  	  };
  
  	  change_pano = function(id, value) {
  	    var error, error_value, opc;
  	    opc = $("#opacity")[0].value;
  	    if (id === 1) {
  	      try {
  	        front_pano.destroy_pano();
  	        front_pano = void 0;
  	      } catch (_error) {
  	        error = _error;
  	        front_pano = void 0;
  	      }
  	      front_pano = new root.Pano(value - 1);
  	      return front_pano.create_pano(opc);
  	    } else {
  	      try {
  	        back_pano.destroy_pano();
  	        back_pano = void 0;
  	      } catch (_error) {
  	        error = _error;
  	        back_pano = void 0;
  	      }
  	      back_pano = new root.Pano(value - 1);
  	      back_pano.create_pano(1 - opc);
  	      error_value = $("#adjust")[0].value;
  	      return back_pano.mesh.rotation.y = THREE.Math.degToRad(error_value);
  	    }
  	  };
  
  	  animate();
  
  	  $("#xml-submit").on('click', function() {
  	    var i, num_panos, xmlDoc, xml_scene, xmlhttp;
  	    xmlhttp = new XMLHttpRequest();
  	    xmlhttp.open("GET", $("#xml-path").val(), false);
  	    xmlhttp.send();
  	    xmlDoc = xmlhttp.responseXML;
  	    house_id = $("#xml-path").val();
  	    console.log(house_id);
  	    num_panos = xmlDoc.getElementsByTagName("scene").length;
  	    root.pano_paths = [];
  	    root.blur_paths = [];
  	    i = 0;
  	    while (i < num_panos) {
  	      xml_scene = xmlDoc.getElementsByTagName("scene")[i];
  	      root.blur_paths[i] = xml_scene.getElementsByTagName("preview")[0].getAttribute("url");
  	      root.pano_paths[i] = xml_scene.getElementsByTagName("image")[0].getElementsByTagName("level")[1].getElementsByTagName("cube")[0].getAttribute("url");
  	      i++;
  	    }
  	    init("list1", num_panos);
  	    init("list2", num_panos);
  	    $("#list1").trigger('change');
  	    $("#list2").trigger('change');
  	  });
  
  	  $("#list1").on('change', function() {
  	    var list, value;
  	    list = $("#list1");
  	    value = list[0].options[list[0].selectedIndex].value;
  	    change_pano(1, value);
  	  });
  
  	  $("#list2").on('change', function() {
  	    var list, value;
  	    list = $("#list2");
  	    value = list[0].options[list[0].selectedIndex].value;
  	    change_pano(2, value);
  	  });
  
  	  $("#save-data-button").click(function() {
  	    var from_id, title, to_show_side_panel;
  	    root.save_annotation();
  	    root.save_hotspot();
  	    if (root.full_dataset[house_id] === void 0) {
  	      one_dataset = {};
  	      root.full_dataset[house_id] = one_dataset;
  	    } else {
  	      one_dataset = root.full_dataset[house_id];
  	    }
  	    from_id = $("#list1").val() - 1;
  	    title = $("#pano-title").val();
  	    to_show_side_panel = false;
  	    if ($("#side-panel").val() === "on") {
  	      to_show_side_panel = true;
  	    }
  	    if (one_dataset[from_id] === void 0) {
  	      one_dataset[from_id] = {
  	        "title": title,
  	        "path": root.pano_paths[from_id],
  	        "blur_image_path": root.blur_paths[from_id],
  	        "side_panel": to_show_side_panel,
  	        "start_position": position,
  	        "fallback_image": fallback_image,
  	        "hotspots": [],
  	        "annotations": []
  	      };
  	    }
  	    one_dataset[from_id]["annotations"] = root.annotation_angles;
  	    one_dataset[from_id]["hotspots"] = root.hotspots_angle;
  	    console.log(one_dataset);
  	    console.log(root.full_dataset);
  	    return localStorage.setItem('full_dataset', JSON.stringify(one_dataset));
  	  });
  
  	  $('#container').click(function(e) {
  	    var l, t;
  	    if ($('#add-hotspot-image').css('display') === 'block') {
  	      l = e.pageX - 25;
  	      t = e.pageY - 15;
  	      $('#add-hotspot-image').css({
  	        width: '50px',
  	        height: '50px',
  	        left: l,
  	        top: t,
  	        position: 'absolute'
  	      });
  	    }
  	  });
  
  	  root.camera = camera;
  
  	  root.scene = scene;
  
  	  root.renderer = renderer;
  
  	  root.texture_placeholder = texture_placeholder;
  
  	  slider = $("#opacity");
  
  	  slider.on('change mousemove', function() {
  	    var i, j, opacity, value;
  	    opacity = slider[0].value;
  	    value = $("#display");
  	    value.html(opacity);
  	    i = 0;
  	    while (i < 6) {
  	      j = 0;
  	      while (j < 1) {
  	        front_pano.mesh.children[i].children[j].material.opacity = opacity;
  	        back_pano.mesh.children[i].children[j].material.opacity = 1 - opacity;
  	        j++;
  	      }
  	      i++;
  	    }
  	  });
  
  	  $("#set-position").on('click', function() {
  	    position = parseInt(root.Config.lon);
  	  });
  
  	  $("#fallback-image-button").on('click', function() {
  	    fallback_image = $("#fallback-image").val();
  	  });
  
  	  adjust = $("#adjust");
  
  	  adjust.on('change mousemove', function() {
  	    var error, error_value;
  	    error_value = adjust[0].value;
  	    error = $("#error");
  	    error.html(error_value);
  	    back_pano.mesh.rotation.y = THREE.Math.degToRad(error_value);
  	  });
  
  	  root.add_listeners();
  
  	  module.exports = root;
  
  	}).call(this);
  
  
  /***/ },
  /* 1 */
  /***/ function(module, exports, __webpack_require__) {
  
  	// Generated by CoffeeScript 1.9.3
  	(function() {
  	  var angle, angle1, flag, lat, lon, onPointerDownLat, onPointerDownLon, onPointerDownPointerX, onPointerDownPointerY, root, uns_hotspot, update;
  
  	  root = __webpack_require__(2);
  
  	  root.hotspot_count = 0;
  
  	  angle = void 0;
  
  	  angle1 = void 0;
  
  	  onPointerDownPointerX = void 0;
  
  	  onPointerDownPointerY = void 0;
  
  	  onPointerDownLon = void 0;
  
  	  onPointerDownLat = void 0;
  
  	  flag = false;
  
  	  lat = 0;
  
  	  lon = 0;
  
  	  uns_hotspot = void 0;
  
  	  $("#add-hotspot-button").on('click', function() {
  	    var delete_div, div, hotspot_id;
  	    hotspot_id = "hotspot_" + root.hotspot_count;
  	    div = $("<div></div>", {
  	      id: hotspot_id
  	    });
  	    div.prepend("<div class='hotspot-title' style='color:yellow'>Title</div> <img class='hotspot' height='40px' width='40px' src='../test/images/logo.png'></img>");
  	    delete_div = $("<img height='20px' width='20px' src = '../test/images/delete.png'/>");
  	    delete_div.click(function() {
  	      div.remove();
  	      return delete_div.remove();
  	    });
  	    div.append(delete_div);
  	    div.attr('lat', parseInt(root.Config.lat));
  	    div.attr('lon', parseInt(root.Config.lon));
  	    div.css('position', 'absolute');
  	    div.css('left', $("#container").outerWidth() / 2 + 'px');
  	    div.css('top', $("#container").outerHeight() / 2 + 'px');
  	    $("#container").append(div);
  	    uns_hotspot = div;
  	  });
  
  	  $("#save-hotspot-button").on('click', function() {
  	    uns_hotspot.attr('lat', parseInt(root.Config.lat));
  	    uns_hotspot.attr('lon', parseInt(root.Config.lon));
  	    uns_hotspot.find('.hotspot-title').html($("#hotspot-title").val());
  	    root.hotspot_count += 1;
  	  });
  
  	  root.save_hotspot = function() {
  	    var count, data_hotspot, error, hotspot, hotspot_id, hotspots_angle, i, to_id;
  	    count = 0;
  	    hotspots_angle = [];
  	    i = 0;
  	    while (i < root.hotspot_count) {
  	      hotspot_id = "#hotspot_" + i;
  	      hotspot = $(hotspot_id);
  	      data_hotspot = {};
  	      error = $("#adjust").val();
  	      error = parseInt(error);
  	      to_id = $("#list2").val() - 1;
  	      if (hotspot.length !== 0) {
  	        data_hotspot.to_id = to_id;
  	        data_hotspot.angle = parseInt(hotspot.attr('lon'));
  	        data_hotspot.error = error;
  	        if (hotspot.find('.hotspot-title').html()) {
  	          data_hotspot.text = hotspot.find('.hotspot-title').html();
  	        }
  	        hotspots_angle[count] = data_hotspot;
  	        count = count + 1;
  	        hotspot.remove();
  	      }
  	      i++;
  	    }
  	    root.hotspots_angle = hotspots_angle;
  	  };
  
  	  update = function() {
  	    var container, hotspot, hotspot_id, i, pos, rad_angle, vector;
  	    i = 0;
  	    while (i < root.hotspot_count) {
  	      hotspot_id = "#hotspot_" + i;
  	      hotspot = $(hotspot_id);
  	      angle = $(hotspot_id).attr('lon');
  	      angle1 = $(hotspot_id).attr('lat');
  	      rad_angle = THREE.Math.degToRad(angle);
  	      vector = new THREE.Vector3(30 * Math.cos(rad_angle), angle1, 30 * Math.sin(rad_angle));
  	      vector.x += 13 * Math.cos(rad_angle);
  	      vector.z += 13 * Math.sin(rad_angle);
  	      vector = vector.project(root.camera);
  	      container = $("#container");
  	      pos = {
  	        x: (vector.x + 1) / 2 * container.outerWidth(),
  	        y: -(vector.y - 1) / 2 * container.outerHeight()
  	      };
  	      if (hotspot) {
  	        if (vector.x > 1 || vector.x < -1 || vector.y > 1 || vector.y < -1 || vector.z > 1 || vector.z < -1) {
  	          if ($(hotspot_id).css('display') !== 'none') {
  	            $(hotspot_id).removeAttr('style');
  	            $(hotspot_id).css('display', 'none');
  	          }
  	        } else {
  	          $(hotspot_id).css('display', 'inline');
  	          $(hotspot_id).css('left', '0px');
  	          $(hotspot_id).css('top', '0px');
  	          $(hotspot_id).css('transform', 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0px)');
  	          $(hotspot_id).css('position', 'absolute');
  	          $(hotspot_id).css({
  	            'font-family': "'Helvetica Neue', Helvetica, Arial, sans-serif"
  	          });
  	          $(hotspot_id).css('font-size', '16px');
  	        }
  	      }
  	      i++;
  	    }
  	    requestAnimationFrame(update);
  	  };
  
  	  update();
  
  	  module.exports = root;
  
  	}).call(this);
  
  
  /***/ },
  /* 2 */
  /***/ function(module, exports, __webpack_require__) {
  
  	// Generated by CoffeeScript 1.9.3
  	(function() {
  	  var angle, angle1, flag, lat, lon, nl2br, onPointerDownLat, onPointerDownLon, onPointerDownPointerX, onPointerDownPointerY, root, uns_annotation, update;
  
  	  root = __webpack_require__(3);
  
  	  root.annotation_count = 0;
  
  	  angle = void 0;
  
  	  angle1 = void 0;
  
  	  onPointerDownPointerX = void 0;
  
  	  onPointerDownPointerY = void 0;
  
  	  onPointerDownLon = void 0;
  
  	  onPointerDownLat = void 0;
  
  	  flag = false;
  
  	  lat = 0;
  
  	  lon = 0;
  
  	  uns_annotation = void 0;
  
  	  $("#add-annotation-button").on('click', function() {
  	    var annotation_id, delete_div, div;
  	    annotation_id = "annotation_" + root.annotation_count;
  	    div = $("<div></div>", {
  	      id: annotation_id
  	    });
  	    div.prepend("<img class='annotation' height='40px' width='40px' src='../test/images/info.png'></img> <div class='hotspot-title'> <div class='hotspot-text'>" + "title" + "</div> </div> <div class='info-hotspot'>" + "Description" + "</div>");
  	    delete_div = $("<img height='20px' width='20px' src = '../test/images/delete.png'/>");
  	    delete_div.click(function() {
  	      div.remove();
  	      return delete_div.remove();
  	    });
  	    div.append(delete_div);
  	    div.attr('lat', parseInt(root.Config.lat));
  	    div.attr('lon', parseInt(root.Config.lon));
  	    div.css('position', 'absolute');
  	    div.css('left', $("#container").outerWidth() / 2 + 'px');
  	    div.css('top', $("#container").outerHeight() / 2 + 'px');
  	    $("#container").append(div);
  	    uns_annotation = div;
  	    $("#" + annotation_id).bind('click touchstart', function() {
  	      if ($("#" + annotation_id).find('.hotspot-title').css('visibility') === 'visible' || $("#" + annotation_id).find('.hotspot-title').css('opacity') === '1') {
  	        $("#" + annotation_id).find('.info-hotspot').css('visibility', 'hidden');
  	        $("#" + annotation_id).find('.hotspot-title').css('visibility', 'hidden');
  	        $("#" + annotation_id).find('.hotspot-title').css('opacity', '0');
  	        $("#" + annotation_id).find('.annotation').css('border-radius', '100px');
  	      } else {
  	        $("#" + annotation_id).find('.info-hotspot').css('visibility', 'visible');
  	        $("#" + annotation_id).find('.hotspot-title').css('visibility', 'visible');
  	        $("#" + annotation_id).find('.hotspot-title').css('opacity', '1');
  	        $("#" + annotation_id).find('.annotation').css('border-radius', '10px 0px 0px 0px');
  	      }
  	    });
  	  });
  
  	  $("#fix-annotation-button").on('click', function() {
  	    uns_annotation.attr('lat', parseInt(root.Config.lat));
  	    uns_annotation.attr('lon', parseInt(root.Config.lon));
  	    uns_annotation.find('.hotspot-text').html($("#annotation-title").val());
  	    uns_annotation.find('.info-hotspot').html(nl2br($("#annotation-desc").val()));
  	    root.annotation_count += 1;
  	  });
  
  	  root.save_annotation = function() {
  	    var annotation, annotation_angles, annotation_id, count, data_annotation, i;
  	    count = 0;
  	    annotation_angles = [];
  	    i = 0;
  	    while (i < root.annotation_count) {
  	      annotation_id = "#annotation_" + i;
  	      annotation = $(annotation_id);
  	      data_annotation = {};
  	      if (annotation.length !== 0) {
  	        data_annotation.lon = parseInt(annotation.attr('lon'));
  	        data_annotation.lat = parseInt(annotation.attr('lat'));
  	        data_annotation.title = annotation.find('.hotspot-text').html();
  	        data_annotation.desc = nl2br(annotation.find('.info-hotspot').html());
  	        console.log(data_annotation);
  	        annotation_angles[count] = data_annotation;
  	        count = count + 1;
  	        annotation.remove();
  	      }
  	      i++;
  	    }
  	    root.annotation_angles = annotation_angles;
  	  };
  
  	  nl2br = function(str) {
  	    var breakTag;
  	    breakTag = '<br>';
  	    return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag);
  	  };
  
  	  update = function() {
  	    var annotation, annotation_id, container, i, pos, rad_angle, vector;
  	    i = 0;
  	    while (i < root.annotation_count) {
  	      annotation_id = "#annotation_" + i;
  	      annotation = $(annotation_id);
  	      angle = $(annotation_id).attr('lon');
  	      angle1 = $(annotation_id).attr('lat');
  	      rad_angle = THREE.Math.degToRad(angle);
  	      vector = new THREE.Vector3(30 * Math.cos(rad_angle), angle1, 30 * Math.sin(rad_angle));
  	      vector.x += 13 * Math.cos(rad_angle);
  	      vector.z += 13 * Math.sin(rad_angle);
  	      vector = vector.project(root.camera);
  	      container = $("#container");
  	      pos = {
  	        x: (vector.x + 1) / 2 * container.outerWidth(),
  	        y: -(vector.y - 1) / 2 * container.outerHeight()
  	      };
  	      if (annotation) {
  	        if (vector.x > 1 || vector.x < -1 || vector.y > 1 || vector.y < -1 || vector.z > 1 || vector.z < -1) {
  	          if ($(annotation_id).css('display') !== 'none') {
  	            $(annotation_id).removeAttr('style');
  	            $(annotation_id).css('display', 'none');
  	          }
  	        } else {
  	          $(annotation_id).css('display', 'inline');
  	          $(annotation_id).css('left', '0px');
  	          $(annotation_id).css('top', '0px');
  	          $(annotation_id).css('transform', 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0px)');
  	          $(annotation_id).css('position', 'absolute');
  	          $(annotation_id).css({
  	            'font-family': "'Helvetica Neue', Helvetica, Arial, sans-serif"
  	          });
  	          $(annotation_id).css('font-size', '16px');
  	        }
  	      }
  	      i++;
  	    }
  	    requestAnimationFrame(update);
  	  };
  
  	  update();
  
  	  module.exports = root;
  
  	}).call(this);
  
  
  /***/ },
  /* 3 */
  /***/ function(module, exports, __webpack_require__) {
  
  	// Generated by CoffeeScript 1.9.3
  	(function() {
  	  var add_listeners, onPointerDownLat, onPointerDownLon, onPointerDownPointerX, onPointerDownPointerY, on_key_down, on_key_up, on_mouse_down, on_mouse_move, on_mouse_up, on_mouse_wheel, remove_listeners, root;
  
  	  root = __webpack_require__(4);
  
  	  onPointerDownPointerX = void 0;
  
  	  onPointerDownPointerY = void 0;
  
  	  onPointerDownLon = void 0;
  
  	  onPointerDownLat = void 0;
  
  	  on_mouse_down = function(event) {
  	    var container, tantheta, theta, vector;
  	    event.preventDefault();
  	    root.Config.current_lon = root.Config.lon;
  	    root.Config.target_lon = root.Config.lon;
  	    root.Config.current_lat = root.Config.lat;
  	    root.Config.target_lat = root.Config.lat;
  	    root.Config.isUserInteracting = true;
  	    onPointerDownPointerX = event.clientX;
  	    onPointerDownPointerY = event.clientY;
  	    onPointerDownLon = root.Config.lon;
  	    onPointerDownLat = root.Config.lat;
  	    vector = new THREE.Vector3;
  	    container = $("#container");
  	    vector.set(event.clientX / container.outerWidth() * 2 - 1, -(event.clientY / container.outerHeight()) * 2 + 1, 0.5);
  	    vector.unproject(root.camera);
  	    tantheta = vector.z / vector.x;
  	    theta = Math.atan(tantheta);
  	    theta = theta * 180 / Math.PI;
  	    if (theta < 0) {
  	      if (vector.x < 0) {
  	        theta += 180;
  	      } else {
  	        theta += 360;
  	      }
  	    } else if (vector.z < 0 && vector.x < 0) {
  	      theta += 180;
  	    }
  	    root.theta = parseInt(theta);
  	  };
  
  	  on_mouse_move = function(event) {
  	    var mouseSpeed;
  	    if (root.Config.isUserInteracting === true) {
  	      mouseSpeed = 0.3;
  	      root.Config.target_lon = (onPointerDownPointerX - event.clientX) * mouseSpeed + onPointerDownLon;
  	      root.Config.target_lat = (event.clientY - onPointerDownPointerY) * mouseSpeed + onPointerDownLat;
  	    }
  	  };
  
  	  on_mouse_up = function(event) {
  	    root.Config.isUserInteracting = false;
  	    root.Config.stop_time = Date.now();
  	    root.Config.autoplay = false;
  	  };
  
  	  on_mouse_wheel = function(event) {
  	    if (event.wheelDeltaY) {
  	      root.camera.fov -= event.wheelDeltaY * 0.05;
  	    } else if (event.wheelDelta) {
  	      root.camera.fov -= event.wheelDelta * 0.05;
  	    } else if (event.detail) {
  	      root.camera.fov += event.detail * 1.0;
  	    }
  	    root.camera.fov = Math.max(60, Math.min(90, root.camera.fov));
  	    root.camera.updateProjectionMatrix();
  	  };
  
  	  on_key_down = function(event) {
  	    var keyPressed, near_id;
  	    near_id = void 0;
  	    if (!event) {
  	      event = window.event;
  	    }
  	    root.Config.isUserInteracting = true;
  	    keyPressed = event.keyCode;
  	    if (keyPressed === 37) {
  	      root.Config.current_lon = root.Config.lon;
  	      root.Config.target_lon = root.Config.lon - 20;
  	    } else if (keyPressed === 39) {
  	      root.Config.current_lon = root.Config.lon;
  	      root.Config.target_lon = root.Config.lon + 20;
  	    }
  	  };
  
  	  on_key_up = function(event) {
  	    root.Config.isUserInteracting = false;
  	    root.Config.stop_time = Date.now();
  	    root.Config.autoplay = false;
  	  };
  
  	  add_listeners = function() {
  	    return $("#container").on({
  	      click: function(event) {
  	        $("#container").focus();
  	      },
  	      mousedown: function(event) {
  	        on_mouse_down(event);
  	      },
  	      mousemove: function(event) {
  	        on_mouse_move(event);
  	      },
  	      mouseup: function(event) {
  	        on_mouse_up(event);
  	      },
  	      mousewheel: function(event) {
  	        on_mouse_wheel(event.originalEvent);
  	      },
  	      DOMMouseScroll: function(event) {
  	        return on_mouse_wheel(event.originalEvent);
  	      },
  	      keydown: function(event) {
  	        on_key_down(event);
  	      },
  	      keyup: function(event) {
  	        on_key_up(event);
  	      }
  	    });
  	  };
  
  	  remove_listeners = function() {
  	    $("#container").off();
  	  };
  
  	  root.add_listeners = add_listeners;
  
  	  root.remove_listeners = remove_listeners;
  
  	  module.exports = root;
  
  	}).call(this);
  
  
  /***/ },
  /* 4 */
  /***/ function(module, exports) {
  
  	// Generated by CoffeeScript 1.9.3
  	(function() {
  	  var Pano, dist, offset, root, sides, size;
  
  	  root = {};
  
  	  size = 256 / 2;
  
  	  offset = [
  	    {
  	      position: [-size / 2, size / 2, 0]
  	    }, {
  	      position: [size / 2, size / 2, 0]
  	    }, {
  	      position: [-size / 2, -size / 2, 0]
  	    }, {
  	      position: [size / 2, -size / 2, 0]
  	    }
  	  ];
  
  	  dist = 256 / 2;
  
  	  sides = [
  	    {
  	      position: [-1 * dist, 0, 0],
  	      rotation: [0, Math.PI / 2, 0]
  	    }, {
  	      position: [dist, 0, 0],
  	      rotation: [0, -Math.PI / 2, 0]
  	    }, {
  	      position: [0, dist, 0],
  	      rotation: [Math.PI / 2, 0, Math.PI]
  	    }, {
  	      position: [0, -1 * dist, 0],
  	      rotation: [-Math.PI / 2, 0, Math.PI]
  	    }, {
  	      position: [0, 0, dist],
  	      rotation: [0, Math.PI, 0]
  	    }, {
  	      position: [0, 0, -1 * dist],
  	      rotation: [0, 0, 0]
  	    }
  	  ];
  
  	  Pano = (function() {
  	    function Pano(pano_id1) {
  	      this.pano_id = pano_id1;
  	      this.name = "panorama";
  	      this.destroy = false;
  	      this.img_width = 512;
  	      this.tile_width = 512;
  	    }
  
  	    Pano.prototype.create_pano = function(opacity) {
  	      var dfrd, geometry, i, j, material, num_slices, path, path1, slice, slices, texture;
  	      this.mesh = new THREE.Object3D();
  	      dfrd = [];
  	      num_slices = (this.img_width / this.tile_width) * (this.img_width / this.tile_width);
  	      i = 0;
  	      while (i < 6 * num_slices) {
  	        dfrd[i] = $.Deferred();
  	        i++;
  	      }
  	      path1 = root.pano_paths[this.pano_id];
  	      i = 0;
  	      while (i < 6) {
  	        j = 0;
  	        slices = new THREE.Object3D();
  	        while (j < num_slices) {
  	          path = path1;
  	          path = path.replace(/%s/g, root.Config.img_name[i]);
  	          path = path.replace(/%h/g, j % 2 + 1);
  	          path = path.replace(/%v/g, parseInt(j / 2) + 1);
  	          console.log(path);
  	          texture = this.load_clear_texture(path, dfrd[num_slices * i + j]);
  	          material = new THREE.MeshBasicMaterial({
  	            map: texture,
  	            overdraw: 0,
  	            side: THREE.DoubleSide,
  	            blending: THREE.AdditiveBlending,
  	            depthTest: false
  	          });
  	          geometry = new THREE.PlaneBufferGeometry(256 / Math.sqrt(num_slices), 256 / Math.sqrt(num_slices), 7, 7);
  	          slice = new THREE.Mesh(geometry, material);
  	          slice.material.transparent = true;
  	          slice.material.opacity = opacity;
  	          if (num_slices === 1) {
  	            slice.position.x = 0;
  	            slice.position.y = 0;
  	            slice.position.z = 0;
  	          } else {
  	            slice.position.x = offset[j].position[0];
  	            slice.position.y = offset[j].position[1];
  	            slice.position.z = 0;
  	          }
  	          slices.add(slice);
  	          j++;
  	        }
  	        slices.rotation.x = sides[i].rotation[0];
  	        slices.rotation.y = sides[i].rotation[1];
  	        slices.rotation.z = sides[i].rotation[2];
  	        slices.updateMatrix();
  	        slices.position.x = sides[i].position[0];
  	        slices.position.y = sides[i].position[1];
  	        slices.position.z = sides[i].position[2];
  	        slices.updateMatrix();
  	        this.mesh.add(slices);
  	        i++;
  	      }
  	      root.scene.add(this.mesh);
  	      return $.when.apply($, dfrd).done(function() {}).promise();
  	    };
  
  	    Pano.prototype.destroy_pano = function() {
  	      var i, j, num_slices, results;
  	      this.destroy = true;
  	      root.scene.remove(this.mesh);
  	      num_slices = (this.img_width / this.tile_width) * (this.img_width / this.tile_width);
  	      i = 0;
  	      results = [];
  	      while (i < 6) {
  	        j = 0;
  	        while (j < num_slices) {
  	          this.mesh.children[i].children[j].material.map.dispose();
  	          this.mesh.children[i].children[j].material.dispose();
  	          this.mesh.children[i].children[j].geometry.dispose();
  	          this.mesh.children[i].children[j] = null;
  	          j++;
  	        }
  	        this.mesh.children[i] = null;
  	        results.push(i++);
  	      }
  	      return results;
  	    };
  
  	    Pano.prototype.load_clear_texture = function(path, dfrd) {
  	      var image, pano_id, texture;
  	      texture = new THREE.Texture(root.texture_placeholder);
  	      pano_id = this.pano_id;
  	      image = new Image();
  	      image.onload = function() {
  	        image.onload = null;
  	        texture.image = this;
  	        texture.needsUpdate = true;
  	        dfrd.resolve();
  	      };
  	      image.src = path;
  	      return texture;
  	    };
  
  	    return Pano;
  
  	  })();
  
  	  root.Pano = Pano;
  
  	  module.exports = root;
  
  	}).call(this);
  
  
  /***/ }
  /******/ ]);