irise.namespace("irise"); // sets the namespace

irise.HTMLSnippet = function() {
}

irise.HTMLSnippet.prototype.onload = function() {
	var str;
	var widget = this.getWidgetDiv();
	
	// ------------- retrieve the widget properties --------------- 
	var thisWidth = this.getWidth();
	var thisHeight = this.getHeight();
	var htmlSnip =  this.getProperty('snippet');	
	if(htmlSnip === "" || htmlSnip === null || htmlSnip === "undefined"){
		htmlSnip = "";
	}
	
	var autoSize = this.getProperty('autosize');
	// ------------- append the html snippet to the page ----------
	try {
		if(!autoSize){
			str = '<div class="fixedSized" style="width: '+thisWidth+'px; height: '+thisHeight+'px;">'+htmlSnip+'</div>';
		}else{
			str = '<div class="autoSized">'+htmlSnip+'</div>';
		}
		$(widget).append(str);
	}catch(e){
		alert(" Error appending the HTML snippet to Parent Div: "+e.message);
	}
}