	<script language="JavaScript" type="text/javascript">
		var req;
		var reqRefreshAttachmentStatus;
		var url = '%%GLOBAL_pathToKB%%/admin/remote.php';
		function DoCallback(data)
		{
			if (!req) {
				// branch for native XMLHttpRequest object
				if (window.XMLHttpRequest) {
					req = new XMLHttpRequest();
				// branch for IE/Windows ActiveX version
				} else if (window.ActiveXObject) {
					req = new ActiveXObject('Microsoft.XMLHTTP')
				}
			}
			req.onreadystatechange = processReqChange;
			req.open('POST', url, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(data);
		}
		
		function processReqChange() {

			// only if req shows 'loaded'
			if (req.readyState == 4) {
				// only if 'OK'
				if (req.status != 200) {
					alert('There was a problem retrieving the XML data:\n' +
						req.responseText);
				} else {
					ProcessData(req.responseXML);
				}
			}
		}
		
		function ProcessData(data)
		{
			var root = data.documentElement;
			var items = root.childNodes;
			var status = 0;
			for (i = 0; i < items.length; i++) {
				var text = '';
				var value = '';
				for (j = 0; j < items[i].attributes.length; j++) {
					switch (items[i].attributes[j].nodeName) {
						case 'id':
							elementId = items[i].attributes[j].value;
							break;
						case 'text':
							status = items[i].attributes[j].value;
							break;
					}
				}
			}
			element = document.getElementById(elementId + '_Refresh');
			if (status != 1) {
				alert ('%%LNG_QuestionStatusUpdateFailed%%');
			} else {
				parent.document.getElementById("Message").innerHTML = '%%GLOBAL_UpdateSuccess%%';
			}
			req=null;
		}
		
		function sendApprovalEmail (skipEmail) {
			var questionIds = $("#questionIds").val();
			var status = $("#status").val();
			if (skipEmail == 0) {
				var emailSubject = $("#emailSubject").val();
				var emailBody = $("#emailBody").val();
				
				if (emailSubject == '') {
					alert('%%LNG_NoEmailSubject%%');
					$('#emailSubject').focus();
					return false;
				}
			
				if (emailBody == '') {
					alert('%%LNG_NoEmailBody%%');
					$('#emailBody').focus();
					return false;
				}
			}
			tb_remove();
			DoCallback("type=sendapprovalemail&skip="+skipEmail+"&emailBody="+emailBody+"&emailSubject="+emailSubject+"&questionIds="+questionIds+"&status="+status);
		}
	</script>
		
<form action="%%GLOBAL_FormAction%%" method="POST">
	<table class="OuterPanel" id="outerpanel" cellspacing="0" cellpadding="0" border="0" width="100%">
	<tr>
		<td><div class="HeaderBox" style="margin-top:13px;line-height:normal;">%%GLOBAL_Message%%</div></td>
	</tr>
	<tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" >
			<tr>
				<td>
					<table width="100%" style="padding-top:10px">
					<tr style="%%GLOBAL_EmailToDisplay%%">
						<td class="FieldLabel">%%LNG_EmailTo%%: </td>
						<td class="Text">
							%%GLOBAL_ApprovalEmailTo%%
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">%%LNG_EmailSubject%%: </td>
						<td>
							<input id="emailSubject" name="subject" class="Field450" value="%%GLOBAL_ApprovalEmailSubject%%">
						</td>
					</tr>
					<tr>
						<td class="FieldLabel">%%LNG_EmailBody%%: </td>
						<td>
							<textarea id="emailBody" name="body" class="Field450" rows="12" style="overflow:none;">%%GLOBAL_ApprovalEmailBody%%</textarea>
						</td>
					</tr>
					<tr>
						<td>
							&nbsp;
						</td>
						<td>
							%%GLOBAL_SendButton%%
							%%GLOBAL_SkipButton%%
							%%GLOBAL_CalcelButton%%
						</td>
					</tr>
					<tr>
						<td class="gap"></td>
					</tr>
					</table>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
	<input type="hidden" value="%%GLOBAL_questionIds%%" name="questionIds" id="questionIds" />
	<input type="hidden" value="%%GLOBAL_status%%" name="status" id="status" />
	</form>