var EditArticleDialog = {

	createInputElement: function(id, type, classname, value) {
      var tInput = document.createElement("input");
      tInput.id = id;
      tInput.type = type;
      tInput.className = classname;
		tInput.value = value;
		return tInput;
	},

	createButtonLinkElement: function(id, src, href) {
		var tButton = document.createElement('a');
		tButton.onclick = this.closeBox;
		tButton.id = id;
		tButton.setAttribute('href', href);
		tButton.dialogBox = this;
		var tLinkImage = document.createElement('img');
		tLinkImage.src = src;
		tButton.appendChild(tLinkImage);
		return tButton;
	},

	createButtonTextElement: function(pId, pOnClick, pHref, pText) {
		var linkTxtOk = document.createElement('a');
		linkTxtOk.onclick = pOnClick;
		linkTxtOk.id = pId;
		linkTxtOk.setAttribute('href', pHref);
		linkTxtOk.dialogBox = this;
		linkTxtOk.appendChild(document.createTextNode(pText));
		return linkTxtOk;
	},

	/**
	 * Fills the container div with CBEvent info
	 */
   setContent: function(pArticleHtml) {
      this.container.className = "articleDialogBox";
		var tArticle = document.createElement('div');
		tArticle.className = 'simpleArticlePanel';
		tArticle.innerHTML = pArticleHtml;
		//alert(pArticleHtml);
		this.content.appendChild(tArticle);
		
		this.content.appendChild(document.createElement('br'));
		this.content.appendChild(this.createButtonLinkElement("ok", "pics/link_button.gif", "#"));
		this.content.appendChild(this.createButtonTextElement("ok", this.closeBox, "#", "OK"));
		this.content.appendChild(document.createElement('br'));
		this.content.appendChild(this.createButtonLinkElement("cancel", "pics/link_button.gif", "#"));
		this.content.appendChild(this.createButtonTextElement("cancel", this.closeBox, "#", "Cancel"));
	}
}

function showEditArticleDialog(pTitle, pMoveToDocumentElement, pOkCallback, pCancelCallback, pArticleHtml)
{
   var dialog = new VeilDialog(pTitle); // modal dialog object   
   Object.extend(dialog, EditArticleDialog);
   dialog.setContent(pArticleHtml);
   dialog.setCallOK(pOkCallback);
   dialog.setCallCancel(pCancelCallback);
   dialog.moveTo(0,0,document.getElementById(pMoveToDocumentElement));
   dialog.show();
}

