/*
 * Requires: jquery, profile.js, phones.js, address.js, section.js
 */
var Institutions = {};

function Institution(id, name, edit) {
	this.name = name;
	this.id = id;
	this.edit = edit;
}
Institution.prototype = {
	info: function() {
		var self = this;
		if (this.edit) {
			if (Profiles[this.getId()] && Profiles[this.getId()].setUpdate) {}
			else Profiles[this.getId()] = this;

			Phones[this.getId()] = new Contact('phone', this.getId());
			Addresses[this.getId()] = new Contact('address', this.getId());

			$(document).ready(function(){
				self.date = self.getElt('productiondate').datepicker();
			});
		}
		else Profiles[this.getId()] = this;
		
		Sections[this.getId() + 'contact'] = new Section('contact', this.getId());
		Emails[this.getId()] = new Email(this.getId());
	}
};
Institution.prototype = jQuery.extend(Institution.prototype, Profile.prototype);