<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.loc_code.value == "")
			{
				alert("Please Provide Location Code");
				frmname.loc_code.focus();
				return false;
			}
			if(frmname.loc_name.value == "")
			{
				alert("Please Provide Location Name");
				frmname.loc_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;Location 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">Location Code</div>
                        <div class="answer">
                        	<input type="text" name="loc_code" id="loc_code" value="" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Location Name</div>
                        <div class="answer">
                            <input type="text" name="loc_name" id="loc_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>