var oTagCloudDialog = null;
var trayTagCloud = null;

var TC_Dialog = Class.create();

Object.extend(TC_Dialog.prototype,{
	initialize: function(tagCloundTargetDivId,returnTxtFieldId,cloudMode,trayDatasource,currentDigitalObjectName){
		var strTopMessage = new Array();
		var strContent = '<div id="' + tagCloundTargetDivId + '">Loading.. please wait</div>';
		var strBottomBar = new Array();

		if(cloudMode == 'edit')
			strContent += '<div style="margin-top:10px;text-align:center;"><input type="button" class="dekoh_button" value="Close" onclick="trayTagCloud.closeDialogWindow()" /></div>';
		
		var dialogHeight = (cloudMode == "edit") ? 470 : 420;
		this.tagCloudId = 'trayTagCloud';
		this.dioName = (currentDigitalObjectName) ? currentDigitalObjectName : '[unknown]';

		//build header message
		strTopMessage = (cloudMode == "edit") ? 'Tags for collection "' + currentDigitalObjectName + '"' : 'Click on the tags you want and press OK';
		var strDialogtitle = (cloudMode == "edit") ? 'Edit Tags' : 'Select Tags';
		//build header message
		strBottomBar = '';

		gDialogId = 'TagCloud'
		//open dialog
		oTagCloudDialog = new dekohDialog(gDialogId,{className:'dekoh',title:strDialogtitle,height:dialogHeight,width:700,resizable:false,maximizable:false,minimizable:false,content:strContent,topMessage:strTopMessage,toolBarContent:strBottomBar});
		trayTagCloud = new oTagCloud(this.tagCloudId,tagCloundTargetDivId, trayDatasource, {mode:cloudMode, minimalMode:'off', tagView:"view_cloud", tagsLimit:25, tagSeparator:", ", dialogWin:true, returnTxtFieldId:returnTxtFieldId});
	}
})
