(function() {

    angular
    .module('app.common', [])
    .factory('commonService', commonService);
	
  
  // Initialize Firebase
  var config = {
    apiKey: "AIzaSyA1C3DGIpn6zY1p9z4a7qDnE60p28HDgxQ",
    authDomain: "fyp-development.firebaseapp.com",
    databaseURL: "https://fyp-development.firebaseio.com",
    storageBucket: "fyp-development.appspot.com",
    messagingSenderId: "1024577960550"
  };
  
  //Replace with your login google account email
  var adminEmail = "jianhua.wu.2014@smu.edu.sg";
  
  //Replace with the name of your course
  var courseName = "Pivotal Expert_Development";
  
  firebase.initializeApp(config);
  
  function commonService($mdToast,$mdDialog) {

	var service = {
      getAdminEmail: getAdminEmail,
      getCouseName:getCouseName,
      guid: guid,
      showSimpleToast:showSimpleToast
    };
    
    
	var last = {
        bottom: true,
        top: false,
        left: false,
        right: true
      };

    var toastPosition = angular.extend({},last);

	return service;

    function getAdminEmail() {
      return adminEmail;
    }
    
    function getCouseName() {
      return courseName;
    }
    
    function guid() {
      function s4() {
        return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
      }
      return s4() + s4() + s4() + s4();
    }
   
    function getToastPosition(){
      sanitizePosition();

      return Object.keys(toastPosition)
        .filter(function(pos) { return toastPosition[pos]; })
        .join(' ');
    };

    function sanitizePosition() {
      var current = toastPosition;

      if ( current.bottom && last.top ) current.top = false;
      if ( current.top && last.bottom ) current.bottom = false;
      if ( current.right && last.left ) current.left = false;
      if ( current.left && last.right ) current.right = false;

      last = angular.extend({},current);
    }

    function showSimpleToast(msg) {
      var pinTo = getToastPosition();

      $mdToast.show(
        $mdToast.simple()
          .textContent(msg)
          .position(pinTo)
          .hideDelay(3000)
      );
    };

    
  }

})();
@@ -166,41 +166,41 @@
 zaSy
-A1C3DGIpn6zY1p9z4a7qDnE60p28HDgxQ
+DqIamDUsdAduBh2eOWFKYZCdVHLmSJv1s
 %22,%0A 
@@ -216,30 +216,35 @@
 main: %22f
-yp-development
+irst-firebase-e2ce4
 .firebas
@@ -281,30 +281,35 @@
 ttps://f
-yp-development
+irst-firebase-e2ce4
 .firebas
@@ -343,22 +343,27 @@
 : %22f
-yp-development
+irst-firebase-e2ce4
 .app
@@ -401,21 +401,20 @@
 d: %22
-1024577960550
+451367003153
 %22%0A  
@@ -492,23 +492,15 @@
  = %22
-jianhua.wu.2014
+cboesch
 @smu
@@ -591,20 +591,8 @@
 pert
-_Development
 %22;%0A 

change to API key back to origin