// Create ArchVision namespace.
var ArchVision = new Object();

// Embeds can be called with:
// new ArchVision.Embeds().display( {src:'dvsrc',dest:'my_embed_final'} );

// Class to resolve the 'activation' issue in IE.
//	To use this class:
// 1. Include a textarea element
//  	in your page that wraps the embed html tag.
// 2. Set the style of the textarea to 'display:none;"
// 		and give it an id.
// 3. Place an empty div in your page where you want
//		the embed html to appear and give it an id.
// 4. Place a javascript block in the page AFTER the 
// 		textarea and empty div to make the following
//		call:
//
//	new ArchVision.Embeds().display( { src: 'ID_OF_TEXT_AREA', dest: 'ID_OF_DIV' } );
//
// 5. Change the values in the javascript block above
// 		to the id of the textarea and div tags.
ArchVision.Embeds = function(version){
	
	if(typeof(version) != "undefined")
		this.ver = version;
	else
		this.ver = 1;
		
	this.h = '';
	this.s = '';
	this.d = '';
	
	this.display = function(viewer_props){
		this.s = viewer_props.src;
		this.d = viewer_props.dest;
		this.h = this.read();
		this.write();
	};
	
	this.read = function(elem_id){
		return document.getElementById(this.s).value;
	};
	
	this.write = function(){
		document.getElementById(this.d).innerHTML = this.h;
	};
};

// Define namespace and routines for use with 
// the DiscoveryViewer HTML pages.
ArchVision.DiscoveryViewer = ArchVision.Embeds;
