﻿function DownloadUserIntentContentFormView() {
	/****************************************************/
	/*                                                  */
	/*                                                  */
	/*          Class Level Priveleged Methods          */
	/*                                                  */
	/*                                                  */
	/****************************************************/
	
	this.addListBoxOptions = function(oListBox, aOptions, sFirstOption) {
		try {
			oListBox.appendChild(createListBoxOption(sFirstOption, ""));
			var oOption;
			for (var iOption = 0; iOption < aOptions.length; iOption++) {
				oOption = aOptions[iOption];
				oListBox.appendChild(createListBoxOption(oOption.text, oOption.value));
			}
		}
		catch (eException) {
		
		}
		
		function createListBoxOption(sText, sValue) {
			var oOption = document.createElement("option");
			oOption.setAttribute("value", sValue);
			oOption.innerHTML = sText;
			return oOption;
		}
	}
	
	this.disablePhoneNumber = function() {
	    $("txtPhoneNumber").disabled = true;
	}
	
	this.enablePhoneNumber = function() {
	    $("txtPhoneNumber").disabled = false;
	}
	
	this.hideErrorMessage = function(oFormElement) {
		try {
			oFormElement.next("em").addClassName("Hidden");
		}
		catch (eException) {
		
		}
	}
	
	this.hideFormElement = function(oFormElement) {
		try {
			oFormElement.up("div").addClassName("Hidden");
		}
		catch (eException) {
		
		}
	}
	
	this.setAndShowErrorMessage = function(oFormElement, sErrorMessage) {
		try {
			var oErrorMessage = oFormElement.next("em");
			oErrorMessage.innerHTML = sErrorMessage;
			oErrorMessage.removeClassName("Hidden");
		}
		catch (eException) {
		
		}
	}
	
	this.setErrorMessage = function(oFormElement, sErrorMessage) {
		try {
			oFormElement.next("em").innerHTML = sErrorMessage;
			
		}
		catch (eException) {
		
		}
	}
	
	this.setValue = function(oFormElement, sValue) {
		try {
			oFormElement.value = sValue;
		}
		catch (eException) {
		
		}
	}
	
	this.showErrorMessage = function(oFormElement) {
		try {
			oFormElement.next("em").removeClassName("Hidden");
		}
		catch (eException) {
		
		}
	}
	
	this.showFormElement = function(oFormElement) {
		try {
			oFormElement.up("div").removeClassName("Hidden");
		}
		catch (eException) {
		
		}
	}
}