<?php
///////////////////////////////////////////////////////////////////////////

require_once 'lib/abstract_controls_screen.php';

///////////////////////////////////////////////////////////////////////////

class MyPlugIN_SetupScreen extends AbstractControlsScreen
{
    const ID = 'setup';
	const EPG_FONTSIZE_DEF_VALUE	= 'normal';
	private	$epg_font_size;
    private $session;
    ///////////////////////////////////////////////////////////////////////
   public static function get_media_url_str()
    {
        return MediaURL::encode(
            array
            (
                'screen_id' => self::ID,
            ));
    }
    public function __construct($session,$tv)
    {
        parent::__construct(self::ID);
        $this->session = $session;
        $this->tv = $tv;
    }

	public function do_get_control_defs(&$plugin_cookies)
	{
		$defs = array();
		$epg_font_size = isset($plugin_cookies->epg_font_size) ? $plugin_cookies->epg_font_size : self::EPG_FONTSIZE_DEF_VALUE;
		$show_tv = isset($plugin_cookies->show_tv) ? $plugin_cookies->show_tv : 'yes';
		$show_vod = isset($plugin_cookies->show_vod) ? $plugin_cookies->show_vod : 'yes';
		$islogged = $this->session->is_logged_in();
		#hd_print("is_logged->>>>: $islogged");
		$is_login_correct = isset($plugin_cookies->is_login_correct) ? $plugin_cookies->is_login_correct : false;
		#hd_print("is_login_correct:$is_login_correct");
		$paket = $this->session->get_set_pro();
		$settings = $this->session->get_account_settings();
		#hd_print("paket-------->" . json_encode($paket));
//echo("settings..........................................." . print_r($settings,true));

		if ($paket !== 0)
		{
			$akk = $paket->results->fname;
		}
		$acc_time_shift = isset($plugin_cookies->time_shift) ? strval($acc_settings->time_shift) : 0;		
		$plugin_dir = DuneSystem::$properties['install_dir_path'];
		$xml = simplexml_load_file($plugin_dir . '/dune_plugin.xml');
		//$this->add_label($defs,'Версия плагина:', VERSION_MAJOR . '.' . VERSION_MINOR . '.' . VERSION_SUBMINOR . ' [' . VERSION_DATE . ']');
		$this->add_label($defs,'Версия плагина:', trim($xml->version));		
		$this->add_button($defs, 'abonement', "Абонемент для $akk:", 'Подробнее', 700);		
		//hd_print("timeshift:$acc_time_shift");
		$time_shift_ops = array();
		for ($i=0; $i<=24; $i++)
		{
			$time_shift_ops[$i] = $i;
		}		
		$epg_shift = isset($plugin_cookies->epg_shift) ? strval($acc_settings->time_zone) : '0';
		for ($i = -12; $i<13; $i++)
			$shift_ops[$i*60] = $i;
		$buf_time = isset($plugin_cookies->buf_time) ? $plugin_cookies->buf_time : 0;
		$show_buf_time_ops = array();
		$show_buf_time_ops['0'] = 'По умолчанию';
		$show_buf_time_ops['500'] = '0.5 сек';
		$show_buf_time_ops['1000'] = '1 сек';
		$show_buf_time_ops['1500'] = '1.5 сек';
		$show_buf_time_ops['2000'] = '2.0 сек';
		$show_buf_time_ops['2500'] = '2.5 сек';
		$show_buf_time_ops['3000'] = '3 сек';
		$show_buf_time_ops['5000'] = '5 сек';
		$show_buf_time_ops['8000'] = '8 с';
		$show_buf_time_ops['10000']	= '10 сек';
		$show_buf_time_ops['15000'] = '15 с';		
		/* $paket = $paket->results->tariff_plan;
		$this->add_label($defs,'Ваш аккаунт:', $akk);		
		$this->add_label($defs,'Ваш пакет:', $paket); */
		$this->add_button($defs, 'edit_subscription', null, 	'Изменить пользователя', 0);		
		$this->add_button($defs, 'edit_pcode','Код закрытых каналов:', 'Изменить...', 0);
		$this->add_combobox($defs, 'http_caching', 'Время буферизации:', $buf_time, $show_buf_time_ops, 0, true);
		//////////////////////////epg font//////////////////////////////////////
		$epg_font_size_ops = array();
		$epg_font_size_ops ['normal'] = 'Обычный';
		$epg_font_size_ops ['small'] = 'Мелкий';
		$this->add_combobox($defs,
		'epg_font_size', 'Размер шрифта EPG:',
		$epg_font_size, $epg_font_size_ops, 700, true);
		#############deinterlace####################
		$deinterlace = isset($plugin_cookies->deinterlace) ? $plugin_cookies->deinterlace : 'bob';
		$deit_ops = array();
		$deit_ops['0'] = 'Выкл.';
		$deit_ops['blend'] = 'blend';
		$deit_ops['bob'] = 'bob';
		$deit_ops['discard'] = 'discard';
		$deit_ops['linear'] = 'linear';
		$deit_ops['mean'] = 'mean';
		$deit_ops['x'] = 'x';
		$deit_ops['yadif'] = 'yadif';
		$deit_ops['yadif2x'] = 'yadif2x';
		#hd_print("deinterlace--->$deinterlace");
		$this->add_combobox($defs, 'deinterlace', 'Деинтерлейс:', $deinterlace, $deit_ops, 700, true	);
		
		//////////////////////////Servers TV//////////////////////////////////
		$stream_server_tv_ops = array();
		$stream_server_tv = $settings->results->custom_streamer_itv;
		foreach ($settings->results->custom_streamers_itv as $servers_tv)
		{
if ($servers_tv == "http_de")
$servers_tv_human="Германия HTTP";
if ($servers_tv == "hls_de")
$servers_tv_human="Германия HLS";
if ($servers_tv == "apple_hls_de")
$servers_tv_human="Германия Apple HLS";
if ($servers_tv == "http_fr")
$servers_tv_human="Франция HTTP";
if ($servers_tv == "hls_fr")
$servers_tv_human="Франция HLS";
if ($servers_tv == "apple_hls_fr")
$servers_tv_human="Франция Apple HLS";
if ($servers_tv == "http_ca")
$servers_tv_human="Канада HTTP";
if ($servers_tv == "hls_ca")
$servers_tv_human="Канада HLS";
if ($servers_tv == "apple_hls_ca")
$servers_tv_human="Канада Apple HLS";
if ($servers_tv == "http_ge")
$servers_tv_human="Германия 2 HTTP";
if ($servers_tv == "hls_ge")
$servers_tv_human="Германия 2 HLS";
if ($servers_tv == "apple_hls_ge")
$servers_tv_human="Германия 2 Apple HLS";
		
			$stream_server_tv_ops[$servers_tv] = $servers_tv_human;
			//$stream_server_tv_ops[$servers_tv] = $servers_tv;
		}
		$this->add_combobox($defs, 'tv_server', 'Сервер вещания ТВ:', $stream_server_tv, $stream_server_tv_ops, 700, true);
		
		////////////////////////Servers ARC///////////////////////////////////
		$stream_server_arc_ops = array();
		$stream_server_arc = $settings->results->custom_streamer_tvarchive;
		foreach ($settings->results->custom_streamers_tvarchive as $servers_arc)
		{
if ($servers_arc == "http_de")
$servers_arc_human="Германия HTTP";
if ($servers_arc == "hls_de")
$servers_arc_human="Германия HLS";
if ($servers_arc == "apple_hls_de")
$servers_arc_human="Германия Apple HLS";
if ($servers_arc == "http_fr")
$servers_arc_human="Франция HTTP";
if ($servers_arc == "hls_fr")
$servers_arc_human="Франция HLS";
if ($servers_arc == "apple_hls_fr")
$servers_arc_human="Франция Apple HLS";
if ($servers_arc == "http_ca")
$servers_arc_human="Канада HTTP";
if ($servers_arc == "hls_ca")
$servers_arc_human="Канада HLS";
if ($servers_arc == "apple_hls_ca")
$servers_arc_human="Канада Apple HLS";
if ($servers_arc == "http_ge")
$servers_arc_human="Германия 2 HTTP";
if ($servers_arc == "hls_ge")
$servers_arc_human="Германия 2 HLS";
if ($servers_arc == "apple_hls_ge")
$servers_arc_human="Германия 2 Apple HLS";		
			$stream_server_arc_ops[$servers_arc] = $servers_arc_human;
			//$stream_server_arc_ops[$servers_arc] = $servers_arc;
		}
		#hd_print("servers_arc---->$servers_arc");
		$this->add_combobox($defs, 'arc_server', 'Сервер вещания ТВ архива:', $stream_server_arc, $stream_server_arc_ops, 700, true);
		/////////////////////////////////////////////////////////////////////		
		$this->add_button($defs, 'speedtest', "Тест скорости серверов", 	'Пуск', 700	);		
		return $defs;
	}
            

    public function get_control_defs(MediaURL $media_url, &$plugin_cookies)
    {
        $this->tv->unload_channels();
        return $this->do_get_control_defs($plugin_cookies);
    }
    
	public function do_get_fav_show_defs()
	{
		$defs = array();
		ControlFactory::add_label($defs, "", "Для применения изменений необходима перезагрузка плагина.");
		ControlFactory::add_label($defs, "", "Перезагрузить плагин сейчас?");
		$this->add_close_dialog_and_apply_button($defs, 'restart_pl', 'Да', 250);
		$this->add_close_dialog_button($defs, 'Нет', 250);
		return $defs;
	}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public function handle_user_input(&$user_input, &$plugin_cookies)
{
$servers_array = array("de"=>array("name"=>"Германия", "server"=>"185.102.219.90"), "fr"=>array("name"=>"Франция", "server"=>"195.154.194.73"), "ca"=>array("name"=>"Канада", "server"=>"23.237.104.58"), "ge"=>array("name"=>"Германия 2", "server"=>"50.7.85.74"));	

	//hd_print('Setup: handle_user_input:');
	//foreach ($user_input as $key => $value)
	//hd_print("  $key => $value");
	$need_close_dialog = false;
	$need_reset_controls = false;
	$post_action = null;
	//hd_print("Setup: changing $control_id value to $new_value");
	
	if ($user_input->action_type === 'confirm')
	{	
		$control_id = $user_input->control_id;
		$new_value = $user_input->{$control_id};
//		if ($control_id === 'show_tv')
//			$plugin_cookies->show_tv = $new_value;
//		else if ($control_id === 'show_vod')
//			$plugin_cookies->show_vod = $new_value;	
		if($control_id === 'http_caching')
		{
			$buf_time = intval($new_value);
			$plugin_cookies->buf_time = $buf_time;
		}
		else if ($control_id == 'deinterlace')
		{
			$deinterlace = strval($new_value);
			$plugin_cookies->deinterlace = $deinterlace;
			$msg = 'Деинтерлейс изменен!';
		}
		else if ($control_id === 'timeshift')
		{
			$p_var = $new_value;
			$plugin_cookies->time_shift = $new_value;
			$this->session->set_set_pro($control_id, $p_var);
		}
		else if ($control_id === 'epg_shift')
		{
			$plugin_cookies->epg_shift = $new_value;
			$this->session->set_set_pro($control_id, $new_value);
		}
		////////////////////////////////////////////////////
		else if ($control_id === 'restart_pl')
		{
			$url = 'plugin_launcher://prosttv';
			return ActionFactory::launch_media_url($url);
		}
		///////////////////////////////////////////////////
		else if ($control_id == 'epg_font_size')
		{
			$plugin_cookies->epg_font_size = $new_value;
		}
		//////////////////////////////////////////////////
		
//		else if ($control_id === 'stream_server')
//		{
//			$p_var = $new_value;
//			$plugin_cookies->stream_server = $new_value;
//			$this->session->set_set_pro($control_id, $p_var);
//		}
		
		
		else if ($control_id == 'tv_server')
		{
			$akk_id = $plugin_cookies->token;
			$stream_server_tv = $user_input->tv_server;
			
			$pre = explode("_", $stream_server_tv);
			$www = end($pre);
			$plugin_cookies->stream_server = $servers_array[$www]["server"];
			
			hd_print("stream_server_tv------>$stream_server_tv");
			#hd_print("akk_id------>$akk_id");
			$tmp = explode('.', $akk_id);
			$id = $tmp[0];
			$tok = $tmp[1];
			$url = MyPlugIN_Config::API_URL.'/stalker_portal/api/api_v2.php?_resource=users/'.$id . '/settings';	
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL, $url);
			hd_print("http put document url= $url");
			curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Authorization: Bearer '.$akk_id));
			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
			curl_setopt($ch, CURLOPT_POSTFIELDS,"custom_streamer_itv=$stream_server_tv");
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			$response  = curl_exec($ch);
			curl_close($ch);
			#hd_print("response------>$response");
			$res = json_decode($response);
		}
		else if ($control_id == 'arc_server')
		{
			$akk_id = $plugin_cookies->token;
			$stream_server_arc = $user_input->arc_server;
			hd_print("stream_server_arc------>$stream_server_arc");
			$tmp = explode('.', $akk_id);
			$id = $tmp[0];
			$tok = $tmp[1];
			$url = MyPlugIN_Config::API_URL.'/stalker_portal/api/api_v2.php?_resource=users/'.$id . '/settings';	
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL, $url);
			hd_print("http put document url= $url");
			curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Authorization: Bearer '.$akk_id));
			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
			curl_setopt($ch, CURLOPT_POSTFIELDS,"custom_streamer_tvarchive=$stream_server_arc");
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			$response  = curl_exec($ch);
			curl_close($ch);
			#hd_print("response------>$response");
			$res = json_decode($response);
		}
		$need_reset_controls = true;
	}
	
	else if ($user_input->action_type === 'apply')
	{
		$control_id = $user_input->control_id;
		hd_print("idcon:$control_id");
		if ($control_id === 'edit_subscription')
		{
			return $this->do_get_edit_subscription_action($plugin_cookies, $this);
		}
		else if ($control_id === 'edit_pcode')
		{
			hd_print("pcod");
			return $this->do_get_edit_pcode_action();
		}
		elseif ($control_id === 'apply_sub')
		{
			if ($user_input->login === '' || $user_input->pass === '')
			{
				return ActionFactory::show_error(false,'Error',array('Поле Логин или Пароль не может быть пустым.'));
			}	
			$islogged = $this->session->is_logged_in();
			if ($islogged == true)
			{
				$this->session->unset_login();
			}
			try
			{
				$this->session->get_new_login($user_input->login, $user_input->pass, &$plugin_cookies);
			}
			catch (DuneException $e)
			{
				#hd_print("nooooooooooooooooooooo");
				return $this->session->api_exception($e,'login failed.', false);
				#$post_action = $e->get_error_action();
			}
			if ($plugin_cookies->is_login_correct == true)
				hd_print("---------------------------------");
			{
				$plugin_cookies->login = $user_input->login;
				$plugin_cookies->pass = $user_input->pass;
			}	
			$need_close_dialog = true;
			$need_reset_controls = true;
			hd_print("gfhdhfh");
		}
		elseif ($control_id === 'pcode')
		{
			$ttt = $this->session->get_sett();
			$pass_sex = $ttt->results->parent_password;
			hd_print("pass_sex----->$pass_sex");
			if ($user_input->current_pcode !== $pass_sex)
			{
				$no_correct = 'Текущий код введен неверно!!!';
				hd_print("not korrekt");
				return ActionFactory::show_title_dialog($no_correct);
			}
			else if ($user_input->new_pcode_copy !== $user_input->new_pcode)
			{
				$no_ident = 'Новый код и код подтверждения - не одинаковы!!!';
				hd_print("not korrekt");
				return ActionFactory::show_title_dialog($no_ident);
			}
			else
			{
				$akk_id = $plugin_cookies->token;
				$new_pass_sex = $user_input->new_pcode;	
				#hd_print("akk_id------>$akk_id");
				$tmp = explode('.', $akk_id);
				$id = $tmp[0];
				$tok = $tmp[1];
				$url = MyPlugIN_Config::API_URL.'/stalker_portal/api/api_v2.php?_resource=users/'.$id . '/settings';	
				$ch = curl_init();
				curl_setopt($ch, CURLOPT_URL, $url);
				hd_print("http put document url= $url");
				curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Authorization: Bearer '.$akk_id));
				curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
				curl_setopt($ch, CURLOPT_POSTFIELDS,"parent_password=$new_pass_sex");
				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
				$response  = curl_exec($ch);
				curl_close($ch);
				hd_print("response------>$response");
				$res = json_decode($response);	
				if($res->status === 'OK')
				{
					$all_ok = 'Пароль изменен!';
					hd_print("response1------>$all_ok ".$res->status);
					$need_reset_controls = true;
					$need_close_dialog = true;	
				}
			}
		}
		elseif ($control_id === 'close')
		{
			//return null;
			$need_reset_controls = true;
			$need_close_dialog = true;
		}
		/////////////////////////////////////////////////////////////////////////////////////
		else if ($control_id === 'abonement')
		{
			$account_info = $this->session->get_set_pro();	
			#$subscription = $account_info->subscriptions->item;
			$abo = $account_info->results->fname;
			hd_print("account_info----->$abo");
			$phone = $account_info->results->phone;
			$end_date = $account_info->results->end_date;	
			$post_action = null;	
			$text = '  Ваш ID: ' . $account_info->results->id;
			$text_0 = '  Ваш абонемент: ' . $abo;
			$text_0_1 = '  Ваш E-Mail: ' . $account_info->results->account;
			$text_1 = '  Ваш телефон: ' . $account_info->results->phone;
			$text_2 = '  Tарифный план: ' . $account_info->results->tariff_plan;
			$text_3 = '  Заканчивается: ' . $end_date;
			$text_4 = '  Ваш MAC адрес: ' . $account_info->results->mac;
			$defs = array();	
			$plugin_dir  = DuneSystem::$properties['install_dir_path'];
			$id_ico      = "$plugin_dir/icons/special/id_ico.png";
			$mac_ico     = "$plugin_dir/icons/special/mac_ico.png";
			$abo_ico     = "$plugin_dir/icons/special/abo_ico.png";
			$email_ico   = "$plugin_dir/icons/special/email_ico.png";
			$telefon_ico = "$plugin_dir/icons/special/telefon_ico.png";
			$plan_ico    = "$plugin_dir/icons/special/plan_ico.png";
			$time_ico    = "$plugin_dir/icons/special/time_ico.png";	
			ControlFactory::add_img_label($defs, '', "<icon>$id_ico</icon><text dy='7' size='normal'>$text</text>", 0, 0, 0);
			ControlFactory::add_img_label($defs, '', "<icon>$mac_ico</icon><text dy='7' size='normal'>$text_4</text>", 0, 0, 0);
			ControlFactory::add_img_label($defs, '', "<icon>$abo_ico</icon><text dy='7' size='normal'>$text_0</text>", 0, 0, 0);
			ControlFactory::add_img_label($defs, '', "<icon>$email_ico</icon><text dy='7' size='normal'>$text_0_1</text>", 0, 0, 0);
			ControlFactory::add_img_label($defs, '', "<icon>$telefon_ico</icon><text dy='7' size='normal'>$text_1</text>", 0, 0, 0);
			ControlFactory::add_img_label($defs, '', "<icon>$plan_ico</icon><text dy='7' size='normal'>$text_2</text>", 0, 0, 0);
			ControlFactory::add_img_label($defs, '', "<icon>$time_ico</icon><text dy='7' size='normal'>$text_3</text>", 0, 0, 0);
			ControlFactory::add_label($defs, "", '                                                                 ');
			ControlFactory::add_custom_close_dialog_and_apply_buffon($defs, 'setup', 'Ok', 150,  $post_action);	
			return ActionFactory::show_dialog('Ваша подписка', $defs, true);
		}
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		else if ($control_id === 'speedtest')
		{
			//$settings = $this->session->get_account_settings();
			//$stream_server_tv_ops = array();
			//$stream_server_tv = $settings->results->custom_streamer_itv;
			//foreach ($settings->results->custom_streamers_itv as $servers_tv)
			//$stream_server_tv_ops[$servers_tv] = $servers_tv;	
			//echo (print_r($stream_server_tv_ops, true));

			$defs = array();
//			foreach ($servers as $k=>$server)
//			{
//				$A=HD::speedtest($server);
//				ControlFactory::add_img_label($defs, '', "<text dy='7' size='normal'>$k..................$A</text>", 0, 0, 0);
//			}
			
			foreach ($servers_array as $m)
			{
				$k=$m["name"];
				$server = "http://" . $m["server"] . "/7907740.jpg";
				$A=HD::speedtest($server);
				ControlFactory::add_img_label($defs, '', "<text dy='7' size='normal'>$k..................$A</text>", 0, 0, 0);			
			}
			
			
			ControlFactory::add_label($defs, "", '                                                                 ');
			ControlFactory::add_custom_close_dialog_and_apply_buffon($defs, 'setup', 'Ok', 150,  $post_action);
			return ActionFactory::show_dialog('Тест скорости', $defs, true);
		}
		
		/////////////////////////////////////////////////////////////////////////////////////
		else
		{
			$need_reset_controls = true;
			$need_close_dialog = true;
		}
	}
	if ($need_reset_controls)
	{
		$defs = $this->do_get_control_defs($plugin_cookies);
		#hd_print("uuuuuuuuuuuuu");
		$reset_controls_action = ActionFactory::reset_controls($defs, $post_action);	
		if ($need_close_dialog)
		{
			return ActionFactory::close_dialog_and_run($reset_controls_action);
		}	
		return $reset_controls_action;
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    private function do_get_edit_subscription_defs(&$plugin_cookies, $handler, $add_params)
    {
        $defs = array();
        $login = isset($plugin_cookies->login) ? $plugin_cookies->login : '';
        $pass = isset($plugin_cookies->pass) ? $plugin_cookies->pass : '';

        ControlFactory::add_text_field($defs,
            $handler, $add_params,
            'login', 'Логин на prostotele.vision:',
            $login, false, false, false, false, 750);

        ControlFactory::add_text_field($defs,
            $handler, $add_params,
            'pass', 'Пароль на prostotele.vision:',
            $pass, false, true, false, false, 750);

        ControlFactory::add_vgap($defs, 50);

        ControlFactory::add_button($defs,
            $handler, $add_params,
            'apply_sub', null, 'Ввести', 300);

        ControlFactory::add_vgap($defs, -3);

        ControlFactory::add_close_dialog_button($defs,
            'Отмена', 300);
			
		ControlFactory::add_img_label($defs, '', '<text dy="7" size="small"> Нажмите </text><icon>gui_skin://special_icons/controls_button_blue.aai</icon><text dy="7" size="small"> для вызова экранной клавиатуры</text>', 0, 0, 0);
        return $defs;
    }
   public function do_get_edit_subscription_action(&$plugin_cookies, $handler, $add_params = null) 
	{
		$message = 'Введите данные логин и пароль';
        	return ActionFactory::show_dialog(
            		$message,
            		$this->do_get_edit_subscription_defs(
                	$plugin_cookies, $handler, $add_params),
            		true);

	}

    private function do_get_edit_pcode_defs()
    {
        $defs = array();

        $this->add_text_field($defs,
            'current_pcode', 'Текущий код:',
            '', true, true, false,false,500);

        $this->add_text_field($defs,
            'new_pcode', 'Новый код:',
            '', true, true, false,false,500);

        $this->add_text_field($defs,
            'new_pcode_copy', 'Код потверждения',
            '', true, true, false,false,500);

        $this->add_vgap($defs, 50);

        $this->add_button($defs,
            'pcode', null, 'Изменить', 300);

        $this->add_vgap($defs, -3);

        $this->add_close_dialog_button($defs,
            'Отменить', 300);

        return $defs;
    }

    private function do_get_edit_pcode_action()
    {
        return ActionFactory::show_dialog(
            'Смена кода для закрытых каналов',
            $this->do_get_edit_pcode_defs(),
            true);
    }


}

///////////////////////////////////////////////////////////////////////////
?>
