﻿/*
 * Embeds a Facility Map on the page
 *
 * Usage:
 *	myCamera = new FacilityObject(facility_id);
 *
*/

FacilityObject = function(id, use_enhanced_popups) {
    this.id = id;
    
    //Use 'regular' thumbnail popups, or the enhanced popups for 4.1.5
    if (use_enhanced_popups) {
        this.use_enhanced_popups = use_enhanced_popups;
    } else {
        this.use_enhanced_popups = 0;
    }
    
}

FacilityObject.prototype.getHTML = function() {
    var html = "<iframe frameborder='0' src='facilitymap.aspx?fmid=" + this.id + "&popupex=" + this.use_enhanced_popups + "' width='100%' height='100%'></iframe>";
    return html;
}

FacilityObject.prototype.write = function(elementId) {
    //alert(this.getHTML());
	if (elementId) {
		document.getElementById(elementId).innerHTML = this.getHTML();
	} else {
		document.write(this.getHTML());
	}		
}



