function GetPage($res = '', $o_type = '')
{
    if (empty($o_type)) {
        $o_type = $res['type'];
    }
    $stream = $res['stream'];
    //-----------Temporary----Only--Distribution------------
    if (empty($o_type)) {
        $o_type = 4;
    }
    //-----------/Temporary---------/Only--/Distribution-------
    $data = '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" class="form-dialog" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>

	    	<table width="90%" class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="o_type">ზედნადების ტიპი</label></td>
					<td style="width: 170px;"><label for="o_number">ზედნადების №</label></td>
					<td style="width: 170px;"><label for="actation_data">გააქტიურების თარიღი</label></td>
					<td style="width: 170px;"><label for="object" class="object">საწყობი</label></td>
				</tr>
				<tr>
					<td>
						<select id="o_type" class="idls">' . GetOverheadType($o_type) . '</select>
					</td>
					<td>
						<input type="text" id="o_number" class="idle" disabled="disabled" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['waybill_number'] . '" />
					</td>
					<td>
						<input type="text" id="actation_data" class="idle" disabled="disabled" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['activate_date'] . '" />
					</td>
					<td>
						<select id="object" class="idls object">' . GetObject($res['id'], $o_type) . '</select>
					</td>
				</tr>
			</table>
        </fieldset>
    ';
    $data .= GetRelationsSection($res, $o_type, $stream);
    $data .= GetTransportSection($res, $o_type);
    $data .= GetAccountSection($res, $o_type);
    $data .= '
		<fieldset>
	    	<legend>საქონელი</legend>

		    <div class="inner-table">
			    <div id="dt_example" class="ex_highlight_row">
			        <div id="container" class="overhead_container">
			        	<div id="button_area">
			        		<button id="add_button_goods">დამატება</button><button id="delete_button_goods">წაშლა</button>
			        	</div>
			            <div id="dynamic">';
    $data .= GetTableSection($o_type, $stream);
    $data .= '
			            </div>
			            <div id="bottom_button_area">
			        		<button id="sub_overhead_button" class="left">ახალი ქვე-ზედნადები</button>
			        	</div>
			        </div>
			    </div>
			</div>
		</fieldset>
		<!-- ID -->
		<input type="hidden" id="overhead_id" value="' . $res['id'] . '" />
		<input type="hidden" id="local_overhead_id"/>
		<input type="hidden" id="overhead_status" value="' . $res['status'] . '" />
		<input type="hidden" id="overhead_confirmed" value="' . $res['is_confirmed'] . '" />
    </div>    
    ';
    return $data;
}
function GetPage($res = '')
{
    $data = '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" class="form-dialog" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>

	    	<table width="80%" class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="d_number">დოკუმენტის №</label></td>
					<td style="width: 170px;"><label for="operation_data">ოპერაციის თარიღი</label></td>
					<td style="width: 170px;"><label for="object" class="object">საწყობი</label></td>
				</tr>
				<tr>
					<td>
						<input type="text" id="d_number" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['waybill_number'] . '" />
					</td>
					<td>
						<input type="text" id="operation_data" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['activate_date'] . '" />
					</td>
					<td>
						<select id="object" class="idls object">' . GetObject($res['id']) . '</select>
					</td>
				</tr>
			</table>
        </fieldset>
    ';
    $data .= GetRelationsSection($res);
    $data .= GetAccountSection($res);
    $data .= '
		<fieldset>
	    	<legend>საქონელი</legend>

		    <div class="inner-table">
			    <div id="dt_example" class="ex_highlight_row">
			        <div id="container" class="overhead_container">
			        	<div id="button_area">
			        		<button id="add_button_goods">დამატება</button><button id="delete_button_goods">წაშლა</button>
			        	</div>
			            <div id="dynamic">';
    $data .= GetTableSection();
    $data .= '
			            </div>
			        </div>
			    </div>
			</div>
		</fieldset>
		<!-- ID -->
		<input type="hidden" id="buying_id" value="' . $res['id'] . '" />
		<input type="hidden" id="local_buying_id"/>
		<input type="hidden" id="status" value="' . $res['status'] . '" />
    </div>    
    ';
    return $data;
}