<script language="javascript">
	var asInitVals = new Array();
	
	$(document).ready(function() {
		$("#tabs").tabs( {
			"show": function(event, ui) {
				var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
				var tab2 = $("#tabs-2").is(":visible");
				
				if(tab2)
					$("#tab_id").val("2");
				
				if ( oTable.length > 0 ) {
					oTable.fnAdjustColumnSizing();
				}
			}
		} );
	} );
	
	function frm_validation()
	{
		if(navigator.appName != "Microsoft Internet Explorer")
			frmname = document.recuirtment;
		
		var tab2 = $("#tabs-2").is(":visible");
		
		if(tab2)
			$("#tab_id").val("2");
		
		if(tab2)
		{
			if(frmname.tst_rslt_code.value == "")
			{
				alert("Please Provide Code");
				frmname.tst_rslt_code.focus();
				return false;
			}
			if(frmname.tst_rslt_name.value == "")
			{
				alert("Please Provide Name");
				frmname.tst_rslt_name.focus();
				return false;
			}
		}
	}
	
	function frm_edit_val(frmval)
	{
		var url = "";
		var loc = window.location;
		var pathName = loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1);
		url = loc.href.substring(0, loc.href.length - ((loc.pathname + loc.search + loc.hash).length - pathName.length));
		
		$.ajax({
				type: "POST",
				data: "page="+getUrlVars()["page"]+"&mode=edit&id="+frmval,
				url: url+"index.php?page="+getUrlVars()["page"],
				error: function(msg){
						alert( msg.status );
				},
				success: function(msg){
						close_frame();
						$('#tabs-2').html(msg);
						$("#delete_img").show();
				}
		});
	}
</script>
<div style="width: 95%; margin: 0 auto; padding: 10px;">
	<div id="frm_display">
        <div id="tabs">
            <ul>
                <li class="active"><a href="#tabs-2">&nbsp;Test Result Master&nbsp;</a></li>
            </ul>
            
            <form class="form" name="recuirtment" id="recuirtment" method="post" action="<?php echo $action; ?>" onsubmit="return frm_validation();">
                <div id="tabs-2">
                    <div class="questionrow">
                        <div class="question">Test Result Code</div>
                        <div class="answer">
                        	<input type="text" name="tst_rslt_code" id="tst_rslt_code" value="" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Test Result Name</div>
                        <div class="answer">
                            <input type="text" name="tst_rslt_name" id="tst_rslt_name" value="" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
					<div class="questionrow">
						<div class="question">Status</div>
						<div class="answer">
							<input type="checkbox" name="status" id="status" value="Y" />
						</div>
					</div>
					<div class="clear_form">
					</div>
                    <div class="questionrow">
                        <div style="padding: 5px;" align="center">
                            <input type="submit" name="Submit" value="Submit" />
                        </div>
                    </div>
				</div>
            </form>
		</div>
	</div>
</div>